Skip to content

Commit

Permalink
Fix uninitialized connector issue
Browse files Browse the repository at this point in the history
  • Loading branch information
atsag committed Nov 22, 2024
1 parent 8023dde commit 1241387
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ private void processFailedDevices() {
log.info("Trying to use existing BrokerPublisher to publish device lost message");
//device_lost_publisher = new BrokerPublisher(processorProperties.getLost_device_topic(), processorProperties.getNebulous_broker_ip_address(), processorProperties.getNebulous_broker_port(), processorProperties.getNebulous_broker_username(), processorProperties.getNebulous_broker_password(), "");
int sending_attempt = 1;
while (device_lost_publisher.is_publisher_null()){
while (device_lost_publisher==null || device_lost_publisher.is_publisher_null()){

try {
log.warn("Will now make attempt No "+sending_attempt+" to recreate the BrokerPublisher connector for the lost device topic");
log.warn("Will now make attempt No "+sending_attempt+" to (re)create the BrokerPublisher connector for the lost device topic");
log.info("The topic name is "+processorProperties.getLost_device_topic()+", the broker ip is "+ processorProperties.getNebulous_broker_ip_address()+", the broker port is "+ processorProperties.getNebulous_broker_port()+", the username is "+ processorProperties.getNebulous_broker_username()+", and the password is "+ processorProperties.getNebulous_broker_password());

device_lost_publisher = new BrokerPublisher(processorProperties.getLost_device_topic(), processorProperties.getNebulous_broker_ip_address(), processorProperties.getNebulous_broker_port(), processorProperties.getNebulous_broker_username(), processorProperties.getNebulous_broker_password(), "");
Expand Down

0 comments on commit 1241387

Please sign in to comment.