I am developing a windows service which will read the messages from MQ using IBM.XMS listeners.
I need to read only messages which are older than 120 seconds. I have successfully created a listener which is reading all the messages coming into the queue but I am not able to put a filter on the listener.
Below is my code which is reading all the messages
ISession sess = connection.CreateSession(false, AcknowledgeMode.AutoAcknowledge);
IDestination readqueue = sess.CreateQueue("XYZ");
IMessageConsumer consumer = sess.CreateConsumer(readqueue);
MessageListener list = new MessageListener(OnMessage);
consumer.MessageListener = list;
connection.Start();
This code is reading all messages, which I do not want.