-
Notifications
You must be signed in to change notification settings - Fork 81
Fix MQTT resources #9025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix MQTT resources #9025
Conversation
@@ -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(); |
There was a problem hiding this comment.
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...
MqttClient client = new MqttClient(data.geturl(""), clientId, getMqttDataStore(data.getPersistenceDirectory())); | ||
client.connect(connectOptions); | ||
return client; |
There was a problem hiding this comment.
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+"/"); |
There was a problem hiding this comment.
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.
|
(cherry picked from commit f2b32cc)
No description provided.