Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info
titleThis Page is Work In Progress

 

Table of Contents
maxLevel1

Introduction

For Qpid for Java version 6.2 we removed the queuerunner which was responsible for assigning messages from the queue to consumers and instead moved to a model where the consumers pull messages from the queue (QPID-7514).

...

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 MUST notify at least one interested Consumer when there is work to be done.

A Consumer MUST notify the Queue when it is ready to do some work. 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 Flow

...

  1. Message arrives on the Queue
  2. The Queue notifies some interested Consumers that there is work to be done
  3. The Consumers notify their ConsumerTarget that they would like to do work
  4. The ConsumerTargets notify their Session that they would like to do work
  5. The Sessions notify their Connections that they would like to do work
  6. The Connections schedule themselves. This is the switch from the incoming Thread to the IO-Thread.
  7. The Scheduler kicks off a IO-Thread to process the work of a Connection
  8. The Connection iterates over its Sessions that want to do work
  9. The Sessions iterate over its ConsumerTargets that want to do work
  10. The ConsumerTargets iterate over its Consumers that want to do work
  11. The Consumer tries to pulls a message from the Queue
  12. If successful the message is put on the IO-buffer to be sent down the wire

...