Interesting tech stuff I come across day-to-day. Mainly around Biztalk and .NET 3.0

Interesting problem with Adapter Resubmit() method.

Tuesday, May 10, 2005

Recently we encountered an interesting problem while building an ebMS 2.0 ebxml messaging protocal for reliable messaging.

We decided to make use of the Resubmit() method from ITransportProxy batch in order to say biztalk messaging engine, "Please give us the message back to the transmit adapter after certain time".

We have to make two changes to the context property,

1. RetryCount: Update this system property (ebMS specific logic).
2. SomeCustomProp: Add few more custom properties to the context.

When we did the batch.Resubmit(msg,DateTime.Now.AddSeconds(60)), everything is fine. After 60 seconds we received the message from Biztalk messaging engine to our adapter successfully.

But we encountered these problems:

1. RetryCount: This value was decremented by 1 from the default value in the port configuration, it ignored the value what we have set before Resubmitting the message.
2. Custom property is lost.

In order to solve this issue, Kartik and Kevin from Microsoft came out with an undocument API call, but it's really spot on.

This is how you force to update the context manually.

SystemMessageContext sysContext = new SystemMessageContext(messageContext);

UpdateProperty []updates = new UpdateProperty[2];

//Set the retry count
BTS.RetryCount RetryCountProp = new BTS.RetryCount();
updates[0] = new UpdateProperty();
updates[0].Name = RetryCountProp.Name.Name;
updates[0].NameSpace = RetryCountProp.Name.Namespace;
updates[0].Value = 5;

//Add a custom property to tell, we are adding this only during first submit operation, not during resubmit operation
updates[1] = new UpdateProperty();
updates[1].Name = "IsEbXmlMsgTransmitted";
updates[1].NameSpace = "http://abc.com";
updates[1].Value = true;

sysContext.UpdateProperties (updates);

DateTime dt = DateTime.Now.AddSeconds(60);
batch.Resubmit(msg,dt);


HTH for some one out there.

Labels:




Effective Biztalk Server Adapters

For those of you who spend most of their time developing adapter in Biztalk world, Microsoft has released one more white paper explaining how you can write effective adpaters.

Must read article for adapter developers.

http://www.gotdotnet.com/team/wsservers/

Labels:




Biztalk Server and Indigo

Thursday, May 05, 2005

It's clear indication from MS, BTS 2006 will have support for Indigo.

Watch this web cast from Scott on MSDN TV.

link

Indigo adapter uses .NET framework 2.0 supporting WS-RM, Transaction and Security.

Labels: