August 17, 2023

tMicrosoftMQInput – Docs for ESB 5.x

tMicrosoftMQInput

tMicrosoftMQInput_icon32_white.png

tMicrosoftMQInput Properties

Component family

Internet/MOM and JMS

 

Function

This component retrieves the first message in a given Microsoft
message queue (only support String).

Purpose

This component allows you to fetch messages one by one in the ID
sequence of these messages from the Microsoft message queue. Each
execution retrieves only one message.

Basic settings

Property type

Always Built-in. Its schema has
only one read-only column of string type: message.

 

 

Built-in: No property data stored
centrally. Enter properties manually

 

 

Repository: Select the repository
file where properties are stored. The fields that come after are
pre-filled in using the fetched data.

 

Host

Type in the Host name or IP address of the host server.

 

Queue

Enter the queue name you want to retrieve messages from.

 

Queue type

Select a Microsoft message queue type from the drop-down list.

  • Private: a private
    queue, which is registered on the local machine.

  • Public: a public
    queue, which is registered in the directory
    service.

For more information about Microsoft message queue types, see
http://msdn.microsoft.com/en-us/library/ms706878%28v=vs.85%29.aspx.

 

Die on error

This check box is cleared by default, meaning to skip the row on
error and to complete the process for error-free rows.

Advanced settings

tStatCatcher Statistics

Select this check box to gather the Job processing metadata at a
Job level as well as at each component level.

Global Variables

ERROR_MESSAGE: the error message generated by the
component when an error occurs. This is an After variable and it returns a string. This
variable functions only if the Die on error check box is
cleared, if the component has this check box.

A Flow variable functions during the execution of a component while an After variable
functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl +
Space
to access the variable list and choose the variable to use from it.

For further information about variables, see Talend Studio
User Guide.

Usage

This component is generally used as a start component of a Job or
Subjob. It must be linked to an output component.

Connections

Outgoing links (from this component to another):

Row: Main, Iterate

Trigger: Run if; On Subjob Ok, On
Subjob Error, On Component Ok; On Component Error.

Incoming links (from one component to this one):

Row: Iterate;

Trigger: Run if, On Subjob Ok, On
Subjob Error, On Component Ok, On Component Error.

For further information regarding connections, see
Talend Studio User
Guide
.

Limitation

This component supports only String type. Also, it only works with
the Windows systems.

This component requires installation of its related jar files. For more information about the
installation of these missing jar files, see the section describing how to configure the
Studio of the Talend Installation and Upgrade Guide.

Scenario: Writing and fetching queuing messages from Microsoft message queue

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.

    Use_Case_tMicrosoftMQ1.png

Configuring the components

  1. Double-click tRowGenerator to open its
    editor.

    Use_Case_tMicrosoftMQ2.png
  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.

    Use_Case_tMicrosoftMQ3.png
  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.

    Use_Case_tMicrosoftMQ4.png

    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.

    Use_Case_tMicrosoftMQ5.png

Configuring the components

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

    Use_Case_tMicrosoftMQ6.png
  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.

    Use_Case_tMicrosoftMQ7.png

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


Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x