1. Problem
BizTalk has encountered an
error and suspended the processing of an inbound message. You need to
fix the error and resume message processing to receive it successfully.
2. Solution
This example demonstrates
the resumable inbound message-processing capabilities of BizTalk.
BizTalk initially receives a message that has no recipients. In the
publish/subscribe architecture of the MessageBox, the error message will
indicate that BizTalk cannot find a subscriber to the message. After
creating the appropriate subscription, this example resumes processing
and successfully delivers the message.
Begin by creating the receive port and receive location that will accept the message:
Open the BizTalk Server Administration Console.
Right-click the Receive Ports folder under an application, and select New => One-Way Receive Port from the context menu.
Enter SuspendedMessagesExampleIn for the name of the new receive port.
Add a receive location to the receive port, using the default PassThroughReceive pipeline.
Using the File transport type, specify C:\SuspendedMessagesExample\In as the receive folder. Create the folder if necessary.
Grant the BizTalk Application Users group full control to the C:\SuspendedMessagesExample folder.
Enable the receive location.
BizTalk can now receive
messages, but the administrator has not specified where BizTalk should
deliver the messages. BizTalk will raise an error to the event log and
suspend messages received through the SuspendedMessagesExampleIn receive port. Follow these steps:
Place an XML file in the C:\SuspendedMessagesExample\In folder.
In
the left tree view of the BizTalk Server Administration Console, click
the BizTalk Group to show the Group Hub page. Press the F5 key to
refresh the Group Overview page. Note that you will be able to see the
count of suspended messages, as shown in Figure 1.
Click
the Suspended Service Instances link to open the Suspended tab. The
Suspended tab will display all resumable suspended service instances, as
shown in Figure 2.
Now that there is a suspended message in BizTalk, create a send port to deliver the message and resume message processing:
Create a new static one-way send port in the same BizTalk application as the receive port was created in.
Enter SuspendedMessagesExampleOut for the name of the send port, and configure the File adapter to deliver messages to the C:\SuspendedMessagesExample\Out folder. Create the folder if necessary. Use the default PassThruTransmit send pipeline.
In the left pane of the SuspendedMessagesExampleOut – Send Port Properties dialog box, select Filters.
Define a filter where BTS.ReceivePortName equals SuspendedMessagesExampleIn, as shown in Figure 3. This will create a subscription for all messages received through the SuspendedMessagesExampleIn receive port.
Enlist and start the SuspendedMessagesExampleOut send port.
On the Group Hub page, return to the Suspended tab.
Select the Suspended (Resumable) query results to display the suspended SuspendedMessagesExampleIn service instance.
Right-click
the suspended service instance, and select Resume Instance from the
context menu. Click Yes when prompted to confirm. If the Resume Instance
option is not available, verify that the selected service instance's
status is Suspended (Resumable) under the query results.
Verify that BizTalk successfully delivered the XML message to the C:\SuspendedMessagesExample\Out folder.
3. How It Works
BizTalk supports
resumable inbound interchange processing. It suspends the message while
receiving it, and the administrator can resume the message after fixing
the configuration error. The BizTalk administrator can perform
extensive troubleshooting to identify the cause of a suspended message.
Double-clicking the Suspended (resumable) service instance shown in Figure 10-25
opens a Service Details dialog box containing detailed information
about the suspended message. The Error Information tab, shown in Figure 4, displays detailed error information indicating that the message was suspended because BizTalk could not identify a subscriber.
The Messages tab displays
all the messages in the suspended service instance. Double-clicking a
message opens the Message Details dialog box. Select Context in the left
pane of the Message Details dialog box to display the message's context
properties, as shown in Figure 5. BizTalk can use the Promoted context properties to identify the subscriber of a message.
Back on the Suspended tab of the
Group Hub page, the BizTalk administrator can right-click a suspended
message and navigate the Troubleshoot Routing Failure submenu to
identify the cause of a routing failure.
Although most suspended
messages in BizTalk are resumable, in some situations, BizTalk cannot
resume message processing. One example is when BizTalk uses order
delivery messages in the same order BizTalk receives them. In this
situation, resuming a message would also deliver it out of order, so
BizTalk prevents resuming the message.