alex-rufous commented on a change in pull request #36: QPID-8361: [Broker-J] 
Create a developer guide for Qpid Broker-J
URL: https://github.com/apache/qpid-broker-j/pull/36#discussion_r325164143
 
 

 ##########
 File path: doc/developer-guide/src/main/markdown/consumer-queue-interactions.md
 ##########
 @@ -0,0 +1,144 @@
+# Consumer-Queue Interactions
+
+This article overviews implementation behind interactions between consumers 
and queue.
+
+The main players are
+
+ * Queue - model object providing the messaging queue functionality.
+    * QueueConsumerManager - queue entity responsible for managing queue 
consumers
+ * Consumers - queue consumers
+
+The `ConsumerTarget` is the broker-side representation of a consuming client. 
Due to multi-queue consumers
+a `ConsumerTarget` has one or more `Consumers` associated with one `Queue` 
each. It is this `Consumer` that
+interacts with the `Queue`.
+
+## Responsibilities
+
+A `Queue` is responsible for notification of at least one interested 
`Consumer` when there is work to be done
+(message to consume).
+
+A `Consumer` is responsible for notification of its `Queue` when it is ready 
to do some work (for example, consume messages).
+When notified by a `Queue` of available work, a `Consumer` MUST try to pull 
messages of said `Queue` until either
+it notifies the `Queue` that it is no longer interested OR there are no more 
messages available on the `Queue`
+(i.e., the Queue does not return a message).
+
+### Simple Example
+
+ 1. `Message` arrives on the `Queue`
+ 2. The `Queue` notifies some interested `Consumers` that there is work to be 
done
 
 Review comment:
   Actually, the message could be delivered to only some of the queue 
consumers, especially,  in situations, where consumers with priorities are 
used. Thus, the message can go to  consumer with the higher priority.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to