I'm using XMS 7.5 client to access the IBM MQ and wanted to know one thing about MessageListener. When there are multiple messages are present on the queue,
- will the associated MessageListener method (i.e, ProcessNewMessage in the below code)called concurrently? OR
- The messages will be dispatched to the MessageListener(i.e, ProcessNewMessage in the below code) method only at a time?
The code is something like below:
private XMSFactoryFactory xMSFactoryFactory;
private IConnectionFactory connectionFactory;
private IConnection connectionWMQ;
private ISession sessionWMQ;
private IDestination destination;
private IMessageConsumer messageConsumer;
xMSFactoryFactory= XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);
connectionFactory = _xMSFactoryFactory.CreateConnectionFactory();
// Set queue manager name, set server names, channel, use
// XMSC.WMQ_CM_CLIENT as WMQ_CONNECTION_MODE
connectionWMQ = _connectionFactory.CreateConnection();
sessionWMQ = _connectionWMQ.CreateSession(true, AcknowledgeMode.SessionTransacted);
destination = sessionWMQ.CreateQueue(_queueSettings.QueueName);
messageConsumer = sessionWMQ.CreateConsumer(_destination);
messageConsumer.MessageListener = new MessageListener(ProcessNewMessage)