01-17-06 08: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
[ Post a follow-up to this message ]
|