[Spread-users] Novice question about Distributed Queues

Ned Konz ned at bike-nomad.com
Mon Mar 29 14:10:26 EST 2004

On Monday 29 March 2004 9:17 am, Ranjan Bagchi wrote:
> Hi --
> I've come across Spread and am very impressed with what it offers.  I've
> spent a lot of time doing pub/sub development (specifically using Tib/RV).
> One architecture I was able to do in Tib uses what Tib calls Distributed
> Queues:  where instances of a service were started on different machines,
> and became members of a "distributed queue" group.  A message sent to this
> group would be sent to only one member of this group.  Doing this allowed
> easy scalability, since you could get more capacity by just starting more
> instances of the service.
> Is this something which can be done in Spread?  Is there a workaround to
> get this kind of scalability?

You could do this (I think):

* service instances join a request group
* requests are sent to this group by a client
* service instances which heard the request respond to the group (unless they 
also heard that another service instance had been chosen)
* the client picks one (perhaps the first one) of the service instances that 
replied to its request
* and then the client sends an acknowledgement to the group
* which will keep any service instances that hadn't heard the request yet from 
responding unnecessarily to the first request (assuming that they get all the 
pending messages before responding to the incoming requests).

clientA requests: "I'd like service (my request ID is 123)"
server1 offers: "I can do it!"
server2 offers: "I can do it!"
clientA acknowledges: "I picked server1"
<server1 goes off and does the service>
<server3 now checks its messages and finds both the request and the 
acknowledgement, so does not offer>
server1: "I'm done with request #123 for clientA"

Ned Konz

More information about the Spread-users mailing list