Skip to content

Conversation

nielsm5
Copy link
Member

@nielsm5 nielsm5 commented May 21, 2025

No description provided.

@@ -58,14 +59,12 @@ protected MqttClient map(MqttClientSettings data) {

String clientId = data.getClientId();
if (StringUtils.isEmpty(clientId)) {
clientId = AppConstants.getInstance().getProperty("transactionmanager.uid");
clientId = Misc.getHostname()+"-"+ UUIDUtil.createSimpleUUID();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not always set, so it was an unreliable property...

Comment on lines +65 to +67
MqttClient client = new MqttClient(data.geturl(""), clientId, getMqttDataStore(data.getPersistenceDirectory()));
client.connect(connectOptions);
return client;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not be closed!

@@ -87,7 +88,8 @@ protected O map(P object) {
* If not cached yet, attempts to traverse all {@link IObjectLocator IObjectLocators} to do so.
*/
protected final O get(String name, Properties environment) {
return objects.computeIfAbsent(name, k -> compute(k, environment));
String nameWithResourcePrefix = StringUtils.prependIfMissing(name, resourcePrefix+"/");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allow omitting the default resource prefix.

@nielsm5 nielsm5 requested review from tnleeuw and evandongen and removed request for tnleeuw May 21, 2025 15:10
Copy link

sonarqubecloud bot commented May 21, 2025

@nielsm5 nielsm5 merged commit f2b32cc into master May 21, 2025
35 checks passed
@nielsm5 nielsm5 deleted the bug/fix-mqtt-resourceyml-parsing branch May 21, 2025 17:36
@nielsm5 nielsm5 linked an issue May 22, 2025 that may be closed by this pull request
nielsm5 added a commit that referenced this pull request May 22, 2025
(cherry picked from commit f2b32cc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using MQTT causes IllegalStateExceptions
2 participants