Skip to content
Snippets Groups Projects
Commit 9d323174 authored by Andrea Michelotti's avatar Andrea Michelotti
Browse files

no empty key

parent 426e2846
No related branches found
No related tags found
No related merge requests found
......@@ -69,6 +69,10 @@ ele_uptr_t MessagePSConsumer::getMsg(int timeo) {
int MessagePSConsumer::subscribe(const std::string& key) {
std::string topic = key;
if(key.size()==0){
MRDERR_ << " empty subscription name";
return -1;
}
std::replace(topic.begin(), topic.end(), '/', '.');
std::replace(topic.begin(), topic.end(), ':', '.');
......
......@@ -145,7 +145,10 @@ int MessagePSRDKafkaConsumer::applyConfiguration() {
}
int MessagePSRDKafkaConsumer::subscribe(const std::string& key) {
MessagePSConsumer::subscribe(key);
int ret=MessagePSConsumer::subscribe(key);
if(ret!=0){
return ret;
}
if (rk == NULL) {
errstr = "apply configuration first!";
MRDERR_ << errstr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment