activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: Message announcement and routing
Date Tue, 26 Aug 2008 08:17:09 GMT
2008/8/25 Eugeny N Dzhurinsky <>:
> Hello!
> Can somebody please take a look at my question below and let me know is it
> possible to achieve such behavior with ActiveMQ?
> I need to distribute the system which is doing heavy calculation for clients.
> This means the client sends the initial query to start the calculation task to
> the JMS network. In the JMS network there is several consumer hosts which have
> the consumer application listening to the query. This application has a
> thread pool of workers, which aimed to do the job.
> Now, the flow of typical request processing is as below:
> 1) the client sends the request to allocate the job. One of free consumers
> pick up this request, prepares the environment and then sends back to the
> client's temporary queue the response about it is ready to serve.
> (request-response as described in the ActiveMQ FAQ).
> 2) the client sends the sequence of commands and data to be processed by the
> consumer as a set of messages, the consumer does it's job and provides the
> producer with the set of responses.

How many commands and sets of messages are required? Only normally
with the the worker pattern you send all the required commands to be
executed by a consumer in a single message.

While supporting many messages is possible - its just way more chatty
and complex; requiring dealing with partial failure and so forth.

> 3) the client gets finished and tells the worker it is free, so the worker can
> pick up the job requests from other clients.
> At the first look, allocation of "command channel" can be done with having
> temporary queues: once the worker gets the initial request, it creates the
> temporary queue and sends back to the client the reference to the queue in JMS
> reply-to header.
> The worker does not acknowledge the JMS broker it had processed the message,
> so the broker do not tries to send the initial request to another clients and
> does not relay another requests from clients to this worker. I am not sure is
> it works in this way?

If you want reliability, you should use message acknowledgement or
transactions so the broker can failover to other clients if the
consumer fails to process the message. But if you are sending many
messages in a stateful conversation, you're gonna have to implement
your own failover protocol as you're gonna have to restart the
conversation and reply all the messages to another consumer if you get
a failure.

The easiest solution is to use a single request message and single
response message; then failover and reliability are trivial and
ActiveMQ can do all that for you.


Open Source Integration

View raw message