“Route Failed Messages” routes the wrong message – really?
Consider the following scenario:
- You have an adapter on a Receive Location, which submits a message in Format A into BizTalk.
- The Pipeline configured on this Receive Location converts the message into Format B.
- Assume that there is no map configured on the Receive Port.
- You have the “Route Failed Messages” option enabled on the Receive Port.
- You have set up an orchestration (or Send Port) which subscribes to the Error Reports (i.e., the failed messages which are routed due to the “Route Failed Messages” feature) generated by this Receive Port 1.
Problem: When a message is received on this Receive Location, and there are no subscribers for it, you expect that the message in Format B will be received by your error-handling orchestration (or Send Port). However, in some scenarios (depending on the pipeline, pipeline configuration, etc), you see that the message received by the error-handling orchestration (or Send Port) is in Format A. How come?
Here’s what is most probably happening:
- Adapter submits a message in Format A.
- The pipeline executes, and the message is converted to Format B.
- The Messaging Engine attempts to publish the message, but finds that there are no subscribers for this message. It thus returns an error back to the Adapter.
- The Adapter attempts to suspend the message. NOTE – here, it attempts to suspend the message which it knows about (which it received from the back-end) – this message is in Format A.
- The Messaging Engine sees this:
- someone (the adapter in this case) is suspending a message (message in Format A, in this case)
- “Route Failed Messages” is enabled on the port
- The Messaging Engine, instead of suspending, decides to “route” an Error Report corresponding to the message being suspended. This is the message in Format A, in this case.
- Your error-handling orchestration (or send port) thus ended up receiving the message in Format A.
Question: What do you do if you want to have the message received by your error-handling orchestration (or send port) to be in Format B?
Answer: The output message from the pipeline must have the context property “SuspendMessageOnRoutingFailure” present, with a value of true (boolean).
How does that work? Well, it changes the sequence above to be as follows:
- Adapter submits a message in Format A.
- The pipeline executes, and the message is converted to Format B.
- The Messaging Engine attempts to publish the message, but finds that there are no subscribers for this message.
- The Messaging Engine sees the “SuspendMessageOnRoutingFailure” message context property is set to true, and instead of returning an error back to the Adapter, attempts to suspend the message. NOTE that this message is in Format B.
- At the same time, the Messaging Engine also sees this:
- someone (the Messaging Engine itself, in this case) is suspending a message (message in Format B)
- “Route Failed Messages” is enabled on the port
- The Messaging Engine, instead of suspending, decides to “route” an Error Report corresponding to the message being suspended. This is the message in Format B.
- Your error-handling orchestration (or send port) now receives the message in Format B.
The out-of-box XML Disassembler component, has an option named “Recoverable Interchange”. When this option is set to true, the XML Disassembler internally translates this to mean “SuspendMessageOnRoutingFailure”=true, and sets this context property to the message.
Comments
- Anonymous
February 23, 2010
This is super cool. It just shows the breadth of the product, still lot of things left for learning. I certainly didn't know about this feature SuspendMessageOnRoutingFailure. While browsing through the documentation I also noticed there is one more called SuspendMessageOnMappingFailure which work in failed map scenarios. Thanks for this information. Regards, Saraqvana