Exploring the message flow
- Minimize the window with the documentation for the sample, and return to the Message Broker Toolkit. You should see that the import has created some projects, as shown below.
Expand the projects and you will see that they contain several prepared files:
The application project named
DotNetApplicationcontains a single message flow (DotNet.msgflow), two files with the extension
.mbtest, which are used to send test messages through the message flow using the built-in Broker Test Client, and the Broker Archive (BAR) file
DotNet.bar, which contains compiled copies of the resources that you will deploy to the runtime broker below. There is also a library project named
DotNetLibrarythat contains DFDL schema definitions for a comma separated style of output message. This library will be used for one of the output branches in the message flow. Next, examine the message flow
DotNet.msgflow, which should already be open:
- The ReadMessages MQInput node takes messages from an input queue named DOTNET.IN.
- The Filter .NETCompute node routes each message down one of the two flow branches, depending on its format.
- The Modify .NETCompute node adds some XML elements to the message.
- The Create .NETCompute node transforms the input message into a new output message, which uses a comma separated format. Both branches of the message flow result in a message being written to the same output queue, named DOTNET.OUT.
- The WriteLoyaltyProgramMessage node has the output queue name of DOTNET.OUT hard-coded as its queue name property
- The WriteStoreTransactionMessage node has its output queue controlled dynamically using a DestinationList, which is set up by the preceding Create node. The sample chooses to set the DestinationList to point at the queue DOTNET.OUT as well.
- Examine the properties of the Filter .NETCompute node:
When you create a .NETCompute node, you associate it with a .Net assembly file. By default, the sample flow has been configured with the name of an assembly file
- You will create a C# Project, add C# source code, and then build it in order to create this assembly file in subsequent steps, then return to the configuration of the message flow after you
have created this transformation code in Microsoft Visual Studio. Right click on the Filter node and select Open Microsoft Visual Studio:
Once a .NETCompute node has been associated with a particular Microsoft Visual Studio solution using the Node property on the Visual Studio tab, it will launch with the solution files open. You are yet to create the .NET solution, so the Visual Studio opens with its splash page showing. The next section explains how to write the C# code.