About the .NETInput node sample

The .NETInput node sample is a message flow sample application that shows how you can use a message flow to get messages from MSMQ by using code which has been written in C#.

The sample uses .NETInput nodes with code written in C#, built into an assembly (with extension .dll) using Microsoft™ Visual Studio 2012. IBM® Integration Bus installs templates into Microsoft Visual Studio, which provide a basic method structure to which a flow developer can then add their own code. Users of this sample may not have access to a Microsoft Visual Studio installation, so a prebuilt assembly file is provided to enable users to deploy and run the sample without Microsoft Visual Studio. The sample also provides the C# source code. For more information, see C# code for the .NETInput node sample.

Scenario:

The scenario consists of an MSMQ Application which provides a lookup service. If the application is sent a house number and a postal code, it returns fully populated address information (street, city, and county). A fixed-length message containing the house number and postal code is sent to a WebSphere MQ queue. A message flow parses this using a DFDL message model and writes an XML message to the MSMQ queue. This XML message is read by a second message flow using a .NETInput node. The address fields are populated, and a response message is written to an MSMQ response queue. A third message flow reads this data, and returns it to a WebSphere MQ response queue.

There are three message flows used:

  1. The message flow named MQRequestToMSMQ.msgflow, does the following:

    1. The MQInput node named MQ COBOL Input reads a message from WebSphere MQ and parses it, using a DFDL message model.
    2. The .NETCompute node named .NET Send XML to MSMQ copies the MsgId of the MQMD header into the CorrelID of the MSMQ message header.
    3. MQRequestToMSMQ.msgflow

  2. The second message flow named SimulateMSMQApp.msgflow copies the MSMQ CorrellD to the reply message, which is written to the MSMQ reply queue:

    1. The .NETInput node named .NETInput from MSMQ reads a message from the MSMQ queue.
    2. The .NETCompute node named .NET Process and Reply to MSMQ looks up and returns a fully-populated address with street, city, and county to the MSMQ Reply Queue.
    3. SimulateMSMQApp.msgflow

  3. The message flow named MSMQResponseToMQ.msgflow, reads the message from the MSMQ Reply Queue and sends to the MQ Output Queue. The CorrelID of MSMQ is put into CorrelID of MQMD.

  4. MSMQResponseToMQ.msgflow

For more information about COBOL, see the COBOL sample.

The following sections include example input messages in a fixed-length format. The output messages are included in the Running the sample section.

Input COBOL test message

888                                                                 
                                                                                     ABC888DEE
777                                                                 
                                                                                     ABC777DEE
666                                                                 
                                                                                     ABC666DEE
555                                                                 
                                                                                     ABC555DEE
444                                                                 
                                                                                     ABC444DEE

Running the .NETInput node sample

After you have imported and deployed the sample, you can run it by following the instructions in the Running the sample section.

Back to sample home