EMS Queues : Hi I am trying to find out the producer count for the EMS Queues and have configred the TibJmsAdmin instance , i have provided the necesary parameters to the below function:
TibJmsAdmin Initiliazation:
private synchronized TibjmsAdmin getTibjmsInboundAdminInstance() throws TibjmsAdminException {
if (tibAdminInbound_ == null) {
tibAdminInbound_ = new TibjmsAdmin(serverUrl, userName, password);
return tibAdminInbound_;
} else {
return tibAdminInbound_;
}
}
In the Code:
TibjmsAdmin tibAdmin = getTibjmsInboundAdminInstance();
DestinationInfo destinationInfo = tibAdmin.getQueue(inQueueName);
if (shouldMonitorInBoundQueueProducer) {
inBoundProducerExists = doesInBoundQueueProducersExist(tibAdmin, destinationInfo);
}
Function to Get Prducer Count:
private boolean doesInBoundQueueProducersExist (TibjmsAdmin tibAdmin, DestinationInfo destinationInfo) throws Exception {
if (destinationInfo == null) {
System.out.println( " Queue " + destinationInfo.getName() + " unable to get record count of Producers");
return false;
} else {
ProducerInfo[] ci = tibAdmin.getProducersStatistics(tibAdmin.getConnectionId(), userName,destinationInfo);
producerCount = ci.length;
System.out.println( " Queue " + destinationInfo.getName() + " number of Producers: " + producerCount);
if (producerCount <= 0) {
return false;
} else {
return true;
}
}
}
but unfortunately always the producer count is showed 0 and function returns false, though i am connected and wrirting on to the queues.Is there any other way to find the Producer Count i used QueueInfo in place of DestinationInfo but no much use.
Please suggest. Thanks.