Hi Alex,
that set of requirements is very similar to what we in our team (Windows Azure/Server Service Bus) got when the Workflow team for SharePoint came to us asking for a messaging foundation. I’m not going to try to sell you anything, but rather capture some of the issues you have below and explain how we approached those. You can solve some of this with extra scaffolding around the messaging system, but having the features integrated is more comfy
· Your model of having one thread per queue and relying on that for ordered processing couples your consumers to decision made by the senders in terms of how far you can scale out. That’s not particularly healthy.
· That model also gets you into hot water once your receiver crashes for any reason, assuming you use a peek/lock (receive/ack) model. In that case, the next incarnation of your receiver (which is a competing consumer from the queue’s perspective) will skip that message while it’s locked.
· You also have issues with associating processors with jobs that span messages (isolation as you call it) and keeping track of processing state in case of failures as you speak of potential for orphaned messages.
We’re addressing that hairball of problems with two related features in our broker:
· We have the notion of sessions. A session is effectively a job-id that you choose and set on a message submitted into the broker. Those sessions are unbounded in the broker. Sessions are a multiplexing mechanism that enforce order. Instead of calling Receive, you call (nod to Berkeley Sockets) ‘AcceptMessageSession’ which gives you a receiver object that will exclusively deliver messages with the same session-id. You can also ask for a receiver for a specific session-id. The system provides an assurance that nobody else can get at messages with the same session-id except that receiver, but you can have competing consumers for sessions. Furthermore, the locks on sessions and messages are synchronized, so that if you drop the ball, you won’t regain control of the session before the lock on the last fumbled message expires, which provides in-order delivery assurance on that session.
· Sessions can have session state. We have a utility function on the session receiver that allows you to make an message-sized binary annotation on the session. That can be done in a transaction with completing/acknowledging messages. This means that you can track progress of work on a state machine (workflow) as you process messages and the next receiver that picks up after failover or that picks up after the processor goes to sleep (some workflows last for months) will know what the state is. Turns out that SharePoint Online’s many million of concurrent workflow instances track their core progress state that way. The game Halo 4 manages the flow of stats from the Infinity Spartan Ops and Multiplayer games that way.
As a result of these two features you get to scale out the backend independent of how the jobs are submitted since you get competing consumers across multiplexed sessions. You also get in-order assurance and job isolation.
I don’t know whether there are other brokers doing this. I don’t think Rabbit does. Our caveat for the time being is that sessions don’t yet work over AMQP (which is a scheduling issue more than anything else, I expect that this year), but only over our SBMP protocol that is tied to the CLR (hence the AMQP push)
Cheers
Clemens
--
You received this message because you are subscribed to the Google Groups "Distributed Systems" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
distsys-discu...@googlegroups.com.
To post to this group, send email to
distsys...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/distsys-discuss/f08eea1d-c81f-4faf-a9e9-4e8065c69a34%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to a topic in the Google Groups "Distributed Systems" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/distsys-discuss/ehznRCNiQew/unsubscribe.
To unsubscribe from this group and all its topics, send an email to distsys-discu...@googlegroups.com.
To post to this group, send email to distsys...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/distsys-discuss/0a9e8fad4154447f9db0040e4c0f6b06%40BY2PR03MB269.namprd03.prod.outlook.com.