主权项 |
1. In a message delivery system for delivering messages from publishing clients to subscribing clients, comprising a queue containing messages received from the publishing clients for delivery to a plurality of the subscribing clients bound to the queue, wherein a certain number of said subscriber clients bound to the queue are active at any one time and a remainder of said subscriber clients bound to the queue are inactive at any one time, said active subscriber clients being subscriber clients to whom the message delivery system forwards messages from the queue and said inactive subscriber clients being clients to whom the message delivery system does not forward messages from the queue, and wherein the message delivery system selects the subscriber clients as active or inactive, a method of managing the subscriber clients bound to the queue, comprising:
the message delivery system: (i) storing state information determining which of the subscriber clients bound to the queue is/are currently active and which of the subscriber clients bound to the queue is/are currently inactive; (ii) upon a new subscribing client binding to the queue, sending a bind acknowledgement message to said new subscribing client, determining whether said new subscribing client is to be selected as active, and if said new subscribing client is selected as active, sending a flow active indication message generated by the message delivery system to said new subscribing client for the queue indicating that it is currently active to receive messages from the queue originating from publishing client, and if said new subscribing client is selected as inactive, sending a flow inactive indication message generated by the message delivery system to said new subscribing client for the queue indicating that it is currently inactive; (iii) when the message delivery system selects a previously inactive subscribing client bound to the queue to become active, sending a corresponding notification message generated by the message delivery system to the previously inactive subscribing client; and (iv) when the message delivery system selects a previously active subscribing client bound to the queue to become inactive, sending a corresponding notification message generated by the message delivery system to the previously active subscribing client indicating that it is currently inactive; and wherein the message delivery system has a configurable parameter that determines the maximum number of active subscriber clients that can be bound to the queue at any one time; and wherein when a new subscribing client binds to the queue by sending a bind request message to the message delivery system, the message delivery system sends back a bind acknowledgment message and an indication of active/inactive status. |