I am new to JMS
. As far as I understood Consumers
are capable of picking messages from queue/topic. So why do you need a MessageList
The difference is that MessageConsumer is used to receive messages synchronously:
MessageConsumer mc = s.createConsumer(queue);
Message msg = mc.receive();
For asynchronous delivery, we can register a MessageListener object with a message consumer:
mc.setMessageListener(new MessageListener() {
public void onMessage(Message msg) {
...
}
});