Walkthrough: Creating a BizTalk Application That Uses the MQSeries Adapter
This section takes you through creating a simple Microsoft BizTalk Server application that uses the MQSeries adapter.
Note
The application assumes that you have installed the IBM WebSphere MQ, server component for Windows platforms on the same computer as BizTalk Server. It also assumes that you have not yet created any send ports or receive locations. If you have existing send ports or receive locations, substitute appropriate names when you work through the steps.
The application is a simple content-based routing application using only a receive location and a send port. The receive location reads from an IBM WebSphere MQ queue. The send port takes the message from the receive location and sends it to a different IBM WebSphere MQ queue.
To create the application, you have to create the IBM WebSphere MQ queues, set up the BizTalk Server receive location and send port, start the send port and enable the receive location, and put a test message in the queue.
If you have the required permissions to the IBM WebSphere MQ installation, you can create the IBM WebSphere MQ queues through the adapter dialog boxes, and can skip the next procedure. If you do not have such access, you can create the queues using the IBM WebSphere MQ, client components for Windows platforms Explorer. To create the queues through the IBM WebSphere MQ Explorer snap-in, perform the following procedure.
To create the IBM WebSphere MQ queues through the IBM WebSphere MQ Explorer
Follow these steps to create the IBM WebSphere MQ queues through the IBM WebSphere MQ Explorer:
Click Start, point to Programs, point to IBM WebSphere MQ, and then click WebSphere MQ Explorer.
Double-click Queue Managers, and then double-click the default queue manager. The default queue manager is typically named QM_<machine_name> where machine_name is the name of your computer.
Right-click Queues, point to New, and then click Local Queue.
In Create Local Queue dialog box, in Queue Name, type BTStoMQS, and then click OK.
Right-click Queues, point to New, and then click Local Queue.
In Create Local Queue dialog box, in Queue Name, type MQStoBTS, and then click OK.
The next steps create the receive location and the send port, and start the send port and enable the receive location. They also create the IBM WebSphere MQ queues.
To create the receive location and the MQSeries queue
Follow these steps to create the receive location and the MQSeries queue:
In the BizTalk Server Administration console, expand BizTalk Server Administration, expand BizTalk Group, expand Applications, and then expand the default application (BizTalk Application 1 by default).
Right-click the Receive Ports node, click New, and select One-Way Port.
In the Receive Port Properties dialog box, in the Name box, type MQStoBTS.
In the left pane, click Receive Locations, and in the right pane, click New.
In the Receive Location Properties dialog box, in the Name box, type MQStoBTS.
Select MQSeries from the drop-down list next to the Type option.
In the Transport section, click Configure.
In the MQSeries Transport Properties dialog box, in the Polling Interval box, type 1.
In the Queue Definition box, click the ellipsis (…) button.
In the Queue Definition dialog box, in the Server Name box, type your computer name.
In the Queue Manager box, select the default queue manager.
In the Queue box, type MQStoBTS, and then click Export.
In the Export dialog box, click Create Queue,and then click OK and OK again to return to the Receive Location Properties dialog box.
In the Receive Handler box, select BizTalkServerApplication.
In the Receive Pipeline box, select PassThruReceive.
Click OK to apply changes.
To create the send port and the MQSeries queue
Follow these steps to create the send port and the MQSeries queue:
Right-click Send Ports, click New, and select Static One-way Send Port.
In the Send Port Properties dialog box, in the Name box, type BTStoMQS.
Select MQSeries from the drop-down list next to the Type option.
In the Transport section, click Configure.
In the MQSeries Transport Properties dialog box, in the Queue Definition box, click the ellipsis (…) button.
In the Queue Definition dialog box, in the Server Name box, type your computer name.
In the Queue Manager box, select the default queue manager.
In the Queue box, type BTStoMQS, and then click Export.
In the Export dialog box, click Create Queue, and then click OK and OK again to return to the Send Port Properties dialog box.
In the Send Pipeline box, select PassThruTransmit.
Click to select Filters in the left pane, and then configure filter options in the right pane.
In the Property drop-down list, select BTS.ReceivePortName.
In the Value box, type MQStoBTS.
Click OK to apply changes.
To enable the receive location and start the send port
Follow these steps to enable the receive location and start the send port:
Right-click the MQStoBTS receive location, and then click Enable.
Right-click the BTStoMQS send port, and then click Start.
The next step is to test the application by sending a test message to the receive queue.
To test the application
Follow these steps to test the application:
Click Start, point to Programs, point to IBM WebSphere MQ, and then click WebSphere MQ Explorer.
Right-click MQStoBTS, and then click Put Test Message.
In the Message Data box, type a test message. Click OK.
After you enter the data, the Current Depth for the MQStoBTS queue is one (1). When the application processes the message, the count returns to zero (0) and the Current Depth for BTStoMQS becomes one (1). You can also view the content of the message.
To view the message
Follow these steps to view the message:
Double-click the BTStoMQS queue.
Double-click the message, and then select the Data sheet. You can view the text of the message in the Message Data box.
Click OK.