Skip to content

Commit

Permalink
Merge pull request #37111 from pjgg/fix/gh-32463
Browse files Browse the repository at this point in the history
Fix MQTT devService always start even if the host/port channel is set
  • Loading branch information
cescoffier committed Nov 30, 2023
2 parents 2f41793 + b973e85 commit 07ca9f7
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,17 +203,16 @@ private boolean hasMqttChannelWithoutHostAndPort() {
boolean isIncoming = name.startsWith("mp.messaging.incoming.");
boolean isOutgoing = name.startsWith("mp.messaging.outgoing.");
boolean isConnector = name.endsWith(".connector");
boolean isConfigured = false;
boolean isConfigured;
if ((isIncoming || isOutgoing) && isConnector) {
String connectorValue = config.getValue(name, String.class);
boolean isMqtt = connectorValue.equalsIgnoreCase("smallrye-mqtt");
boolean hasHost = ConfigUtils.isPropertyPresent(name.replace(".connector", ".host"));
boolean hasPort = ConfigUtils.isPropertyPresent(name.replace(".connector", ".port"));
isConfigured = isMqtt && (hasHost || hasPort);
}

if (!isConfigured) {
return true;
if (!isConfigured) {
return true;
}
}
}
return false;
Expand Down

0 comments on commit 07ca9f7

Please sign in to comment.