This scenario is made of two Jobs. The first Job posts messages on a JBoss server queue and the second Job fetches the message from the server.
In the first Job, a string message is created using a tRowGenerator and put on a JBoss server using a tMomOutput. An intermediary tLogRow component displays the flow being passed.
Drop the three components required for the first Job from the Palette onto the design workspace and right-click to connect them using a Main row link.
Double-click on tRowGenerator to set the schema to be randomly generated.
Set just one column called message. This is the message to be put on the MOM queue.
This column is of String type and is nullable. To produce the data, use a preset function which concatenates randomly chosen ascii characters to form a 6-char string. This function is
getAsciiRandomString. (Java version). Click the Preview button to view a random sample of data generated.
Set the Number of rows to be generated to 10.
Click OK to validate.
The tLogRow is only used to display a intermediary state of the data to be handled. In this example, it doesn't require any specific configuration.
Then select the tMomOutput component.
In this case, the MQ server to be used is JBoss.
In the Host and Port fields, fill in the relevant connection information.
Select the Message type from the list. The message can be of Queue or Topic type. In this example, select the Queue type from the list.
In the To field, type in the message source information strictly respecting the syntax expected by the server. This should match the Message Type you selected, such as:
The message name is case-sensitive, therefore
Then click Sync Columns to pass on the schema from the preceding component. The schema being read-only, it cannot be changed. The data posted onto the MQ comes from the first schema column encountered.
Press F6 to execute the Job and view the data flow being passed on in the console, thanks to the tLogRow component.
Then set the second Job in order to fetch the queuing messages from the MOM server.
Drop the tMomInput component and a tLogRow from the Palette to the design workspace.
Select the tMomInput to set the parameters.
Select the MQ server from the list. In this example, a JBoss messaging server is used.
Set the server Host and Port information.
Set the Message From and the Message Type to match the source and type expected by the messaging server.
The Schema is read-only and is made of two columns: From and Message.
Select the Keep listening check box and set the verification frequency to 5 seconds.
When using the Keep Listening option, you'll need to kill the Job to end it.
No need to change any default setting from the tLogRow.
Save the Job and run it (when launching for the first time or if you killed it on a previous run).
The messages fetched on the server are displayed on the console.