Nizami
Nizami

Reputation: 239

Get the Message from the MQ Queue on the basis of Put Time?

How can I filter the messages from IBM MQ queue in IIB ACE and pick only those messages which are there for more than 5 minutes filtering on the basis on put time?

Upvotes: 0

Views: 46

Answers (1)

chughts
chughts

Reputation: 4737

JMS Messages have a JMSTimestamp field, which holds the time the message was sent.

You could create a selector based on

String messageSelector = "JMSTimestamp <= " + System.currentTimeMillis() - (1000 * 60 * 5);

...

receiver = (MessageConsumer) session.createConsumer(replyQueue, messageSelector);

Upvotes: 0

Related Questions