Scenario: Writing and fetching queuing messages from Microsoft message queue - 6.3

Talend Open Studio for Big Data Components Reference Guide

EnrichVersion
6.3
EnrichProdName
Talend Open Studio for Big Data
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

This scenario is made of two Jobs. The first Job posts messages on a Microsoft message queue and the second Job fetches the message from the server.

Posting messages on a Microsoft message queue

In the first Job, a string message is created using a tRowGenerator and put on a Microsoft message queue using a tMicrosoftMQOutput. An intermediary tLogRow component displays the flow being passed.

Dropping and linking components

  1. Drop the three components required for the first Job from the Palette onto the design workspace.

  2. Connect the components using a Row > Main link.

Configuring the components

  1. Double-click tRowGenerator to open its editor.

  2. Click the plus button to add three rows into the schema table.

  3. In the Column column, type in a new name for each row to rename it. Here, we type in ID, Name and Address.

  4. In the Type column, select Integer for the ID row from the drop-down list and leave the other rows as String.

  5. In the Functions column, select random for the ID row, getFirstName for the Name row and getUsCity for the Address row.

  6. In the Number of Rows for RowGenerator field on the right end of the toolbar, type in 12 to limit the number of rows to be generated. Then, Click Ok to validate this editing.

    Note

    In real case, you may use an input component to load the data of your interest, instead of the tRowGenerator component.

  7. Double click the tMicrosoftMQOutput component to open its Component view.

  8. In the Host field, type in the host address. In this example, it is localhost.

  9. In the Queue field, type in the queue name you want to write message in. In this example, name it AddressQueue.

  10. In Message column (String Type) field, select Address from the drop-down list to determine the message body to be written.

Saving and executing the Job

  1. Press Ctrl+S to save your Job.

  2. Press F6 or click Run on the Run tab to execute the Job.

    You can see that this queue has been created automatically and that the messages have been written.

Fetching the first queuing message from the message queue

Now set the second Job in order to fetch the first queuing message from the message queue.

Dropping and linking components

  1. Drop tMicrosoftMQInput and tLogRow from the Palette to the design workspace.

  2. Connect these two components using a Row > Main link.

Configuring the components

  1. Double-click the tMicrosoftMQInput to open its Component view.

  2. In the Host field, type in the host name or address. Here, we type in localhost.

  3. In the Queue field, type in the queue name from which you want to fetch the message. In this example, it is AddressQueue.

Saving and executing the Job

  1. Press Ctrl+S to save your Job.

  2. Press F6 or click Run on the Run tab to execute the Job.

    The message body Atlanta fetched from the queue is displayed on the console.