Now, we will learn how to consume messages from a queue. A common way to consume these queues is using a proxy that is attached to the queue. This proxy monitors the queue, consuming every message that is received in the queue:
In order to achieve this, we have to enable the transport receiver so that the proxy will be able to connect to the JMS Queue, where messages await to be consumed. We will proceed in the same way as we did for the transport sender in the previous section, but in this case, we have to enable the transport receiver:
- Open the axis2.xml file.
- Look for the following string in this file:
transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener"
You must find an XML tag that is commented by default when you download a fresh WSO2 EI:
In our case, we will uncomment the WSO2 Message Broker...