|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
IIB 10 no monitoring events with bind_address is hostname |
« View previous topic :: View next topic » |
Author |
Message
|
john.ormerod |
Posted: Mon May 14, 2018 7:15 am Post subject: IIB 10 no monitoring events with bind_address is hostname |
|
|
Apprentice
Joined: 14 Feb 2017 Posts: 49
|
Hello
Windows 10 / IIB 10.0.0.11 / Eclipse paho 3-1.1.0
I have a java app that subscribes to IIB's monitoring events. It works when using JMS/MQ. I have extended it to use MQTT as an alternative.
My app receives monitoring events via MQTT when connected as 'localhost'. However, when I change bind_addresss to be the hostname, my app connects, issues subscription to topics, but never gets any monitoring events. I don't know how to determine whether the problem is with the sub or pub.
I discovered the hostname issue, when I first tried to subscribe to a remote IIB system. In order to get connected, I had to change bind_address on the remote IIB, to be the machine's hostname. After various trials and errors, I found that the problem occurs when the bind_address value is not 'localhost'.
My connection properties (from my startup config) are:
<ClientId>njams#</ClientId>
<Host>JOT420</Host>
<Port>11883</Port>
<KeepAliveInterval>30</KeepAliveInterval> <!-- seconds -->
<QoS>0</QoS>
The ClientId is appended with the topic string to ensure it is unique.
My connection code is
Code: |
protected MqttClient connectToBroker(String serverUrl, String clientId, MqttConnectOptions connOpts, String topic) {
// Connect to Broker
MqttClient mqttClient = null;
try {
mqttClient = new MqttClient(serverUrl, clientId);
mqttClient.setCallback(new MqttEventsConsumer(mqttClient, connOpts, request, topic));
IMqttToken token = mqttClient.connectWithResult(connOpts);
if (token.getException() != null) {
logger.error("Response is: exception = {}.", token.getException().toString()) ;
}
logger.debug("Response from Broker connection: {}.",token.getResponse().toString());
return mqttClient;
} catch (MqttException e) {
logger.error(e.toString(), e);
}catch (Exception e) {
logger.error(e.toString(), e);
}
return mqttClient; // "Failed to connect to " + serverUrl;
}
|
I hope someone can help me with this. I the answer is out there somewhere, I haven't found the right search terms.
Regards, John |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|