How To Promote MQ Services Context Properties in BizTalk
January 9, 2011 2 Comments
Recently there was a requirement in my BizTalk solution to Promote “MQSeries.MQMD_Expiry” message context property to a outgoing message. At the starting I thought it is quite easy because BizTalk support and promotes most of the system properties of MQ Services in MQ adapter.
I was able to view this property at send port but I was not sure how will I set a value to this property in orchestration.
If I list all the filter properties on send port I can see this property.
In The Orchestration
When I tried to get the same property in orchestration I could not find it.That is really strange!!.
It was quite strange for me to see that this context property is available on send port while not in orchestration. Then I figured out from admin console the assembly which contains the property schema for MQ Series.
I added the reference of this dll to my orchestration and yes now I could see this property in orchestration
At this I was able to set the value of this property. Now the next step was to promote this property .
Correlation Set and Correlation Value
Yes I have to create a correlation set and a correlation value so that it can be initialized at send port. This is the trick here, other wise this context property will be written but not promoted.
Created a correlated type and selected MQSeries.MQMD_Expiry property
Created a Correlation Set and set the correlation type to above created correlation type variable.
Click on Send Port and open properties and select the Correlation Set in the “Initialize Correlation Set ” property box.
With this the exercise gets completed. I tested a sample message and yes I could see it promoted.
I know this is quite simple but Ii found it interesting.