Red Hat AMQ 6
As of February 2025, Red Hat is no longer supporting Red Hat AMQ 6. If you are using AMQ 6, please upgrade: Migrating to AMQ 7.Questo contenuto non è disponibile nella lingua selezionata.
2.3. Concurrent Store and Dispatch
Abstract
Overview Copia collegamentoCollegamento copiato negli appunti!
Enabling concurrent store and dispatch Copia collegamentoCollegamento copiato negli appunti!
kahaDB
element's concurrentStoreAndDispatchTopics
attribute to true
.
Concurrent with slow consumers Copia collegamentoCollegamento copiato negli appunti!
Figure 2.2. Concurrent Store and Dispatch—Slow Consumers
- The producer sends a message,
M
, to a destination on the broker. - The broker sends the message,
M
, to the persistence layer. Because concurrency is enabled, the message is initially held in a task queue, which is serviced by a pool of threads that are responsible for writing to the journal. - Storing and dispatching are now performed concurrently. The message is dispatched either to one consumer (queue destination) or possibly to multiple destinations (topic consumer). In the meantime, because the attached consumers are slow, we can be sure that the thread pool has already pulled the message off the task queue and written it to the journal.
- The consumer(s) acknowledge receipt of the message.
- The broker asks the persistence layer to remove the message from persistent storage, because delivery is now complete.NoteIn practice, because the KahaDB persistence layer is not able to remove the message from the rolling log files, KahaDB simply logs the fact that delivery of this message is complete. (At some point in the future, when all of the messages in the log file are marked as complete, the entire log file will be deleted.)
Concurrent with fast consumers Copia collegamentoCollegamento copiato negli appunti!
Figure 2.3. Concurrent Store and Dispatch—Fast Consumers
- The producer sends a message,
M
, to a destination on the broker. - The broker sends the message,
M
, to the persistence layer. Because concurrency is enabled, the message is initially held in a queue, which is serviced by a pool of threads. - Storing and dispatching are now performed concurrently. The message is dispatched to one or more consumers.In the meantime, assuming that the broker is fairly heavily loaded, it is probable that the message has not yet been written to the journal.
- Because the consumers are fast, they rapidly acknowledge receipt of the message.
- When all of the consumer acknowledgments are received, the broker asks the persistence layer to remove the message from persistent storage. But in the current example, the message is still pending and has not been written to the journal. The persistence layer can therefore remove the message just by deleting it from the in-memory task queue.
Disabling concurrent store and dispatch Copia collegamentoCollegamento copiato negli appunti!
Example 2.2. KahaDB Configured with Serialized Store and Dispatch
Serialized store and dispatch Copia collegamentoCollegamento copiato negli appunti!
Figure 2.4. Serialized Store and Dispatch
- The producer sends a message,
M
, to a destination on the broker. - The broker sends the message,
M
, to the persistence layer. Because concurrency is disabled, the message is immediately written to the journal (assumingenableJournalDiskSyncs
istrue
). - The message is dispatched to one or more consumers.
- The consumers acknowledge receipt of the message.
- When all of the consumer acknowledgments are received, the broker asks the persistence layer to remove the message from persistent storage (in the case of the KahaDB, this means that the persistence layer records in the journal that delivery of this message is now complete).
JMS durability requirements Copia collegamentoCollegamento copiato negli appunti!
kahaDB
element's enableJournalDiskSyncs
attribute to true
.
true
is the default value for the enableJournalDiskSyncs
attribute.