Monday, July 13, 2009

Recoverable Process Interchange

What is Recoverable Interchange?

Take for instance we have multiple messages bundled together and sent as one single unit. Now if one message fails in a bundle of 5 the entire messages will fail. In BTS 2006 we can avoid this using Recoverable Interchange Processing. This is simple but powerful. If one message fails in a bundle of five rest 4 will be delivered in this case. How is that? Kewl isn’t it?

What is Failed Message Routing?

BTS 2006 allows us to subscribe for failed messages which was not available in previous versions


I will use a small example to understand the above concept. Please follow the above steps carefully.

1. Create a Biztalk Project “RecoverAndFailedRouting”
2. Add a schema “OrderEnvelope.xsd”
3. Change the root node “Orders”
4. Add a child record “Order”
5. Add any element to the “Order” Record

Configure the above schema to envelope schema

1. Select the Schema node set Envelope -> Yes
2. Select the root node “Orders” goto -> BodyXpath
3. Select the node which will contain your body schema. In this case it should be “Orders” as it contains the “Order”
4. Save the schema

Create Body Schema

1. Add a new schema “Order.xsd”
2. Change the root node “Order”
3. Add a child element “OrderID”
4. Add a child element “City”
5. Save the Schema

Create a Receive Pipeline

1. Add a new receivepipeline “RecvEnvelope.btp”
2. Add a XmlDissassembler in the disassemble portion of pipeline
3. Set document schema to “Order.xsd”
4. Set the envelope schema to “OrderEnvelope.xsd”
5. Set Validate Document Structure and Recoverable Interchange to true
6. Save all


General


1. Add the .snk file to the project
2. Select solution ->configuration->check deploy
3. Select project->configuratrion->Deployment->Give an application name
4. Deploy the solution

Administration

1. Open the BTS Admin Console
2. Expand the Group and then expand the Application
3. Select the deployed application
4. Create a new receive port a) Pipeline -> RecvEnvelope.btp b) Adapter -> File c) specify File path
5. Create a new send port “SuccessFulMessages” a)Adapter ->File b)Specify Filepath c)Go to Filters -> Add BTS.ReceivePortName = name of the receive port created
6. Create a new send port “FailedMessages” a)Adapter ->File b)Specify Filepath c)Go to Filters -> Add ErrorReport.ErrorType = “FailedMessage” Note : don’t use quotes while filling
7. Start the application


Testing the application
1. Drop the i/p file to receive folder
2. Check all messages
3. if there is an error in any one of the message in the bundle that will be sent to “FailedMessages” folder.

I/p message format : [ All Success ]

<ns0:Orders xmlns:ns0="http://FailRouter.OrderEnvelope">
<ns0:Order xmlns:ns0="http://FailRouter.Order">
<OrderID>OrderID_1</OrderID>
<City>City_0</City>
</ns0:Order>
<ns0:Order xmlns:ns0="http://FailRouter.Order">
<OrderID>OrderID_2</OrderID>
<City>City_0</City>
</ns0:Order>
<ns0:Order xmlns:ns0="http://FailRouter.Order">
<Order>OrderID_3</Order>
<City>City_0</City>
</ns0:Order>
</ns0:Orders>


I/p message format : [ Second One Fails ]

<ns0:Orders xmlns:ns0="http://FailRouter.OrderEnvelope">
<ns0:Order xmlns:ns0="http://FailRouter.Order">
<OrderID>OrderID_1</OrderID>
<City>City_0</City>
</ns0:Order>
<ns0:Ordered xmlns:ns0="http://FailRouter.Order">
<OrderID>OrderID_2</OrderID>
<City>City_0</City>
</ns0:Ordered>
<ns0:Order xmlns:ns0="http://FailRouter.Order">
<Order>OrderID_3</Order>
<City>City_0</City>
</ns0:Order>
</ns0:Orders>

No comments:

Post a Comment