Resequencing Messages
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server Orchestration > Resequencing Messages




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Resequencing Messages  
CranCran77


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-16-06 12:49 PM

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






[ Post a follow-up to this message ]



    Re: Resequencing Messages  
Yossi Dahan


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
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 ]



    Re: Resequencing Messages  
CranCran77


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-17-06 10:58 PM

Great, that is exactly what I wanted to understand.






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:04 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register