vavrtom 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_r324621162
########## 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: I suggest to skip word 'some' as it looks like that all interested consumers will not be notified (if notifying only subset of consumers is not intentional) ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org