Lehel44 commented on code in PR #7032:
URL: https://github.com/apache/nifi/pull/7032#discussion_r1139477771
##########
nifi-nar-bundles/nifi-mqtt-bundle/nifi-mqtt-processors/src/main/java/org/apache/nifi/processors/mqtt/ConsumeMQTT.java:
##########
@@ -383,9 +383,8 @@ private void initializeClient(ProcessContext context) {
// non-null but not connected, so we need to handle each case and only
create a new client when it is null
try {
mqttClient = createMqttClient();
- mqttClient.setCallback(this);
mqttClient.connect();
- mqttClient.subscribe(topicPrefix + topicFilter, qos);
+ mqttClient.subscribe(topicPrefix + topicFilter, qos, this);
Review Comment:
It's uneasy to follow the code here. A processor class being a callback
itself is strange. What do you think of implementing the interface with a
lambda or as a class instead of passing 'this'?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]