Why messages are immutable inside Biztalk?

Posted at: 8/24/2006 at 7:12 AM by saravana
Most of us know that messages received inside biztalk are immutable, meaning they cannot be modified. If we need to modify the message say for example, if you want to change the price of the product inside the message, then a new message needs to be constructed (Inside orchestration you use Construct, Transform shape etc, inside pipeline you create a temporary stream). So, whats the reason for this immutable message behaviour. Reasons:

1. A received message might have multiple subscribers (orchestration, sendports etc) means each subscriber of a particular message references the same, single copy of that message. So, it make sense the message is not modified by any single service like Orchestration or pipelines.

2. Since single copy is referenced by multiple subscribers, it minimize storage. ( A ref counter is maintained for each message and messages with ref count of 0 are periodically removed.)

3. The concept of messages being immutable also allows for detailed tracking of message state as messages flow through the system.
Tags:  Categories: BizTalk General
Actions: Email this article Email | Kick it! | DZone it! | Save to del.icio.us | Technorati Links
Post Information: Permanent LinkPermalink | CommentsComments(13) | Comments RSS

Comments

Thursday, January 11, 2007 6:37 AM
Saravanan
Saravanan
Hi saravana,
good explanation...but i have one doubt. We say messages are immutable but
1) we are able to promote the nodes and modify (set) their values...
2) We can access their nodes using Xpath and set the values to them...

Is my understanding correct? or iam going wrong...

please clarify.
Thursday, January 11, 2007 7:46 AM
Saravana Kumar
1. When you are promoting the nodes and modifying their values: You are actually changing the message context, but not the messags. you are reading from the message, (note, not writing) and writing it to the context.

2. For your second question, you didn't explain where you are doing using. If you are referning to Orchestration, then when you do a Contruct shape, the message will automatically be copied, you won't be modifying the original message.
Thursday, January 11, 2007 9:58 AM
Saravanan
Saravanan
Saravana,
Thanks for your reply. If we are change something in message context means, indirectly we are changing some properties associated to the message. Each and every message will be having a seperate message context rite.
Thursday, January 11, 2007 10:20 AM
Saravana Kumar
Only messages are immutable inside Biztalk not Message context. Message and Message context are two different things, changing the message context doesn't mean you are altering the message itself. I'll shown an example if you routing a message like this

<Person>
<Name>Gates</Name>
</Person>

Biztalk will have a message context associated for this message with extra properties like adapter data, url data, receive location data etc,etc as system properties. You are also allowed to add some data to the context like

PersonId = "007"

So, in the example you can see, the message remains the same, which is  

<Person>
<Name>Gates</Name>
</Person>

but, the context might be changed by various factors like system properties, your properties etc.

So, we are not altering the message in anyway

HTH
Saravana
Friday, January 12, 2007 4:18 AM
Saravanan
Saravanan
Hi Saravana,
I got it finally. Thanks for clarifying..
Sunday, August 01, 2010 11:47 PM
lenen
BKR problemen? Nu Geld lenen zonder BKR toetsing? Op zoek naar betrouwbare aanbieders? Wij vergelijken banken die u toch kunnen helpen aan een betrouwbare
Wednesday, August 04, 2010 3:23 PM
chef jobs
thanks for the info
Wednesday, August 04, 2010 3:31 PM
restauracion de fotos
Really i appreciate the effort you made to share the knowledge.The topic here i found was really effective to the topic which i was researching for a long time.
Thursday, August 05, 2010 1:56 PM
Plastic surgery in cancun
I wanted to thank you for this excellent read!! I definitely loved every little bit of it.Cheers for the info!!!! & This is the perfect blog for anyone who wants to know about this topic. You know so much its almost hard to argue with you .........
thanks                      

Tuesday, August 10, 2010 12:13 AM
hypotheek
Hypotheek informatie, hypotheek aanvragen of afsluiten? Hypotheekrentes bekijken. Hypotheek aanbieders vergelijken, hypotheek vormen, bijkomende kosten,
Saturday, August 14, 2010 12:49 PM
easy loans
I like what I see. keep it going
Thursday, August 26, 2010 4:45 AM
flowers delivery
I suggest this site to my friends so it could be useful & informative for them also. Great effort.I love flowers...I am also interested to send flowers all over the world....
Wednesday, September 01, 2010 5:11 AM
Plastic Surgery in Fort Lauderdale
I think I like what you got going on here check back in a few. thanks.

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading