Friday, April 12, 2024

Get count of JMS Queue Messages using Automation Script

  • Maximo use JMS queues for inbound, outbound data processing. These messages and message count can be manually viewed from External System application.
  • Here is a simple automation script to get the count of Messages in JMS Queues. It  can be used in Action Launch point to view message count in 'Action button' of an application  OR in an Escalation to send details via Email.

Script:

from psdi.iface.jms import JMSQueueBrowser
from psdi.iface.jms import MaxQueueCache
from psdi.iface.jms import QueueConfig
from psdi.iface.jms import JMSData

qbrowser = None
queueName = "jms/maximo/int/queues/cqin"
selector = "SENDER='ABC'"
config = MaxQueueCache.getInstance().getQueueConfig(queueName);
connectionFactory = config.getConfactName();
env = config.getEnv()
qbrowser = JMSQueueBrowser(queueName, connectionFactory, selector, env);
qList = qbrowser.getAllMessages();
qCount=len(qList)

#raise TypeError("Messages Count - "+str(qCount))
print '-- Number of Messages in the Queue : ' +str(qCount)


Script Variables:
queueName = path of the JMS queue as configured in Maximo


No comments:

Post a Comment

Excel Formulas - Helpful in BIRT Reports

  BIRT reports are widely used in Maximo and sometimes require to build reports with many columns and field mapping. I’ve been using excel f...