Reading and writing to a queue
Talend ESB is supplied with the Apache ActiveMQ software for creating message queues and topics. This recipe shows how we can write to and read from an ActiveMQ queue.
Getting ready
First, we'll need to start ActiveMQ.
Navigate to the folder
<talend installation folder>\Runtime_ESBSE\activemq\bin
and double-click on the fileactivemq.bat
.This will open a command window. Do not close this command window while you are doing this recipe.
You can access the ActiveMQ administration console by opening the URL
localhost:8161/admin
. This will allow you to view your queues and topics.Open the job
jo_cook_ch09_0080_readWriteQueue
.
How to do it...
The first thing to do is to write a message to a queue.
Writing to the queue
Drag a
tMomOutput
component to the canvas.Create a flow between the
tFileInputXML
and thetMomOutput
components.Open the component and set the MQ Server to ActiveMQ, the To field to customerData, and the MessageType to Queue. Your
tMomOuptut
should look...