BizTalk "Get Last Message" pattern

Hello,
There is a case:
One part of the solution periodically publishes the data. This part is out of this article.
There are two kind of subscribers.
One kind of subscribers want to get the messages while they are published.
Second kind of subscribers pool this messages randomly:
  • undefined quantity of the subscribers request the undefined number times the LAST message in random interval.
  • they want to get the last input message only.
The usual publish-subscribe pattern doesn't work, because
  1. the usual subscriber MUST receive ALL published messages. It cannot omit several and receive only others. (It can but it have to implement this logic by itself, it is not the case.)
  2. After subscriber received the message, it cannot receive this message one more time. The message pops out of the query.
  3. After one subscriber received the message, the other subscriber cannot receive the same message if it is not subscribed to the message. It is not a "random" , "one time", "randomly appeared/disappeared" subscriber.
The question is: How can I do this in "BizTalk style"?
There is one of the implementation of this pattern:
BizTalk "Get Last Message" patternhttp://geekswithblogs.net/LeonidGaneline/archive/2007/08/05/114426.aspx
I'm interested in critique and comments!
Thanks!
[2119 byte] By [LeonidGaneline-MVP] at [2008-1-7]
# 1

Hi Ganeline,

I hope I have expalined how to solve this issue in one of the posts before. For each subcriber you should have a different pooling location. You can't have same location. Because after the subscriber subscribes the message it will be deleted from that location. If you want to consume the latest message, write the message in same file name.

Thanks,

Saravana Kumar

SaravanaKumar_1977 at 2007-10-2 > top of Msdn Tech,BizTalk Server,BizTalk R2 General...
# 2

Hi Saravana,

Thanks for help!

Yeah, but your proposal does not solve the requirement:

"undefined quantity of the subscribers request the undefined number times the LAST message in random interval."

The subscriber cannot get the last message more then one time, but this is a requirement.

Regards,

Leonid Ganeline
http://geekswithblogs.net/leonidganeline/

LeonidGaneline-MVP at 2007-10-2 > top of Msdn Tech,BizTalk Server,BizTalk R2 General...
# 3

Hi Ganeline,

In that case we shouldn't allow the subscriber to directly poll in the message delivered location. We have to receive request from the subscriber and using .net code in the orchestration need to read the message and send to the subscriber via senport. Whenever the message is the changes it will be updated in the specified location. But their is an catch, Let us say when the message change and the message request came almost same time (only millisecond differes) the file might be in use, we have to use delay shape for waiting sometime and proceed further.

Thanks,

Saravana Kumar

SaravanaKumar_1977 at 2007-10-2 > top of Msdn Tech,BizTalk Server,BizTalk R2 General...