BizTalk Server Orchestration - Resequencing Messages

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server Orchestration > January 2006 > Resequencing Messages





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Resequencing Messages
CranCran77

2006-01-16, 7:49 am

I found an example of a resequencer EAI pattern on a website recently
and noticed that it included a C-sharp class called MessageStore.cs as
follows:

[Serializable]
public class MessageStore {
private HashTable m_MessageTable;
public MessageStore() {
m_MessageTable = new HashTable();
}
public void AddMessage(int sequenceID, XLANGMessage message) {
m_MessageTable.Add(sequenceID, message);
}
public XLANGMessage GetMessage(int sequenceID) {
XLANGMessage msg = (XLANGMessage) m_MessageTable[sequenceID];
m_MessageTable.Remove(sequenceID);
return(msg);
}
public bool MessageInStore(int sequenceID) {
return(m_MessageTable[sequenceID] != null);
}
}

If I were to implement such an orchestration where this object is used,
what would happen if the host running the orchestration was stopped and
restarted? Since the object is noted as Serializable, I would assume
it is persisted and will be maintained during host restarts, correct?

I just want to make sure that I won't see any implications or
single-points of failure type conditions using such logic.

I saw another approach using a guard-like notification. I'm not sure
which is more reliable. I would appreciate any feedback ASAP so I can
conclude my design.

Thanks,
Chris

Yossi Dahan

2006-01-17, 3:02 am

CranCran77 wrote:
> I found an example of a resequencer EAI pattern on a website recently
> and noticed that it included a C-sharp class called MessageStore.cs as
> follows:
>
> [Serializable]
> public class MessageStore {
> private HashTable m_MessageTable;
> public MessageStore() {
> m_MessageTable = new HashTable();
> }
> public void AddMessage(int sequenceID, XLANGMessage message) {
> m_MessageTable.Add(sequenceID, message);
> }
> public XLANGMessage GetMessage(int sequenceID) {
> XLANGMessage msg = (XLANGMessage) m_MessageTable[sequenceID];
> m_MessageTable.Remove(sequenceID);
> return(msg);
> }
> public bool MessageInStore(int sequenceID) {
> return(m_MessageTable[sequenceID] != null);
> }
> }
>
> If I were to implement such an orchestration where this object is used,
> what would happen if the host running the orchestration was stopped and
> restarted? Since the object is noted as Serializable, I would assume
> it is persisted and will be maintained during host restarts, correct?
>
> I just want to make sure that I won't see any implications or
> single-points of failure type conditions using such logic.
>
> I saw another approach using a guard-like notification. I'm not sure
> which is more reliable. I would appreciate any feedback ASAP so I can
> conclude my design.
>
> Thanks,
> Chris
>


Reading the code it seems the class is intended to be used in an
orchestration (as it accepts an XLANG message)
where in the orchestration it is hard to say. I guess there is some sort
of convoy that accepts all messages, then a loop until all messages are
delivered with an if to check if the current message should be sent or
stored.

You were right about the serializable - the class is marked as such so
that if the orchestration needs to be persisted - for instance when
biztalk is stopped, or even if the machine crashes (the orchestration is
actually persisted pretty regularly during its execution at several
points) the class instance can be persisted with it.

--
Yossi Dahan
www.sabratech.co.uk
CranCran77

2006-01-17, 5:58 pm

Great, that is exactly what I wanted to understand.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com