Note that there are some explanatory texts on larger screens.

plurals
  1. POJMS Producer-Consumer-Observer (PCO)
    primarykey
    data
    text
    <p>In JMS there are Queues and Topics. As I understand it so far queues are best used for producer/consumer scenarios, where as topics can be used for publish/subscribe. However in my scenario I need a way to combine both approaches and create a producer-consumer-observer architecture.</p> <p>Particularly I have producers which write to some queues and workers, which read from these queues and process the messages in those queues, then write it to a different queue (or topic). Whenever a worker has done a job my GUI should be notified and update its representation of the current system state. Since workers and GUI are different processes I cannot apply a simple observer pattern or notify the GUI directly.</p> <p>What is the best way to realize this using a combination of queues and/or topics? The GUI should always be notified, but it should never consume anything from a queue?</p> <p>I would like to solve this with JMS directly and not use any additional technology such as RMI to implement the observer part.</p> <p>To give a more concrete example:</p> <ol> <li>I have a queue with packages (<code>PACKAGEQUEUE</code>), produced by machine (<code>PackageProducer</code>)</li> <li>I have a worker which takes a package from the <code>PACKAGEQUEUE</code> adds an address and then writes it to a <code>MAILQUEUE</code> (<code>AddressWorker</code>)</li> <li>Another worker processes the <code>MAILQUEUE</code> and sends the packages out by mail (<code>MailWorker</code>).</li> <li>After step 2. when a message is written to the <code>MAILQUEUE</code>, I want to notify the GUI and update the status of the package. Of course the GUI should not consume the messages in the <code>MAILQUEUE</code>, only the <code>MailWorker</code> must consume them.</li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload