Knowing whether Client Queue/Topic is Connected Or Disconnected

Hi Guys,

I want to know if there is any way to know whether the Broker Client Queue/Topic is connected or disconnected through java API. I know we see this in MWS where green indicates it is connected and orange indicates it is disconnected. But i want fetch these status details programatically.

Thanks,
vinodkumar.

Hi Vinod,

this can be handled by using JavaAPI of Broker.

Refer to class COM.activesw.api.client.BrokerClient and methods isConnected().

Details can be found in the JavaAPI Reference for Broker.

Regards
Holger

Hi Thomsen,

Thanks for the reply. isConnected() method gives the connection status of the client which we have connected from java service. For instance please have a look at the following piece of code.

BrokerAdminClient brokerClient = new BrokerAdminClient(“BrokerHost”, “BrokerName”, null, “admin” ,“Broker Stats Monitor”, null );

Now isConnected() will give the connection status of “admin” client but not connection status of Broker Client Queue/Topic.

Please correct me if i am wrong any where and thanks for ur reply.

Thanks & Regards,
VInodkumar V.

Hi,

Can anyone help me on this.

Thanks & Regards,
VInodkumar V.

Here you go:

// Get admin client object
BrokerAdminClient brokerClient = new BrokerAdminClient("BrokerHost", "BrokerName", null, "admin" ,"Broker Stats Monitor", null ); 

// Check for connected sessions length. Zero indicates not connected (orange icon on mws) to any client (both java and wm trigger)
boolean isConnected = (brokerClient.getClientInfoById(queueName).sessions.length == 0 ? false : true);
2 Likes