mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
#665 : Added some changes to reuse PropertyUtils.replaceTenantDomainProperty()
This commit is contained in:
parent
be99ca571b
commit
f7dbc156b3
@ -57,10 +57,6 @@ public class MQTTEventAdapter implements InputEventAdapter {
|
|||||||
,globalProperties);
|
,globalProperties);
|
||||||
String topic = eventAdapterConfiguration.getProperties().get(MQTTEventAdapterConstants.ADAPTER_MESSAGE_TOPIC);
|
String topic = eventAdapterConfiguration.getProperties().get(MQTTEventAdapterConstants.ADAPTER_MESSAGE_TOPIC);
|
||||||
String tenantDomain = topic.split("/")[0];
|
String tenantDomain = topic.split("/")[0];
|
||||||
if (tenantDomain.equals("${tenant-domain}")) {
|
|
||||||
tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
|
|
||||||
topic = topic.replaceAll("\\$\\{tenant-domain\\}", tenantDomain);
|
|
||||||
}
|
|
||||||
mqttAdapterListener = new MQTTAdapterListener(mqttBrokerConnectionConfiguration
|
mqttAdapterListener = new MQTTAdapterListener(mqttBrokerConnectionConfiguration
|
||||||
,topic
|
,topic
|
||||||
,eventAdapterConfiguration
|
,eventAdapterConfiguration
|
||||||
|
|||||||
@ -88,7 +88,7 @@ public class MQTTAdapterListener implements MqttCallback, Runnable {
|
|||||||
int keepAlive = mqttBrokerConnectionConfiguration.getKeepAlive();
|
int keepAlive = mqttBrokerConnectionConfiguration.getKeepAlive();
|
||||||
this.topic = PropertyUtils.replaceTenantDomainProperty(topic);
|
this.topic = PropertyUtils.replaceTenantDomainProperty(topic);
|
||||||
this.eventAdapterListener = inputEventAdapterListener;
|
this.eventAdapterListener = inputEventAdapterListener;
|
||||||
this.tenantDomain = tenantDomain;
|
this.tenantDomain = PropertyUtils.replaceTenantDomainProperty(tenantDomain);
|
||||||
|
|
||||||
//SORTING messages until the server fetches them
|
//SORTING messages until the server fetches them
|
||||||
String temp_directory = System.getProperty("java.io.tmpdir");
|
String temp_directory = System.getProperty("java.io.tmpdir");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user