You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by artnaseef <ar...@artnaseef.com> on 2015/10/01 22:05:57 UTC

Re: Activemq-cpp Synchronous Receive from Multiple Consumers

First off, there are no ordering guarantees for messages across more than one
destination.

The closest to a workable solution I believe you'll find for needing to
serialize the work from messages across multiple destinations, without some
form of internal queueing in the application, would involve the use of
composite destinations.  That is, to create a consumer of a composite
destination that consists of all the individual destinations for which the
application needs to consume messages.

Keep in mind composite destinations introduce many complexities, so be
careful to test with all the features of ActiveMQ in-use.

Internal queueing might be the best solution to the problem.  If there's an
issue of messages being held-up for long periods, perhaps it would be
possible to set prefetch to 1 and have the processing push the messages onto
the queue and then wait for processing of that message to complete before
acknowledging it back to the broker.

Hope this helps.




--
View this message in context: http://activemq.2283324.n4.nabble.com/Activemq-cpp-Synchronous-Receive-from-Multiple-Consumers-tp4702375p4702547.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Activemq-cpp Synchronous Receive from Multiple Consumers

Posted by Tim Bain <tb...@alumni.duke.edu>.
Do you have a procedure that will reliably reproduce both problems you
describe (negative consumer counts and non-delivery of messages) each time
you run it?

Have you used a JMX viewer such as JConsole to examine the subscriptions on
each destination both when the broker is in a good state and when you're
seeing incorrect behavior?  Can you please describe for us what you see in
both cases?
On Oct 7, 2015 9:15 AM, "dvstans" <st...@ornl.gov> wrote:

> Thanks for the suggestions. I'm not familiar with composite destinations,
> so
> I may be using them incorrectly (any good C++ examples?). I modified my
> test
> code to subscribe to a single composite destination composed of multiple
> topics and it initially works; however, when the client dynamically changes
> its subscription to a different composite destination, or additional
> clients
> join and subscribe to the testing, the broker seems to get "confused" (it
> shows negative numbers for consumer counts on some topics and clients stop
> receiving messages). When the broker gets in this state, I have to stop all
> my clients and manually delete all topics before it will work again.  Btw,
> I'm testing with ActiveMQ 5.9.0.
>
> Thanks!
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Activemq-cpp-Synchronous-Receive-from-Multiple-Consumers-tp4702375p4702718.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Re: Activemq-cpp Synchronous Receive from Multiple Consumers

Posted by dvstans <st...@ornl.gov>.
Thanks for the suggestions. I'm not familiar with composite destinations, so
I may be using them incorrectly (any good C++ examples?). I modified my test
code to subscribe to a single composite destination composed of multiple
topics and it initially works; however, when the client dynamically changes
its subscription to a different composite destination, or additional clients
join and subscribe to the testing, the broker seems to get "confused" (it
shows negative numbers for consumer counts on some topics and clients stop
receiving messages). When the broker gets in this state, I have to stop all
my clients and manually delete all topics before it will work again.  Btw,
I'm testing with ActiveMQ 5.9.0.

Thanks!



--
View this message in context: http://activemq.2283324.n4.nabble.com/Activemq-cpp-Synchronous-Receive-from-Multiple-Consumers-tp4702375p4702718.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Activemq-cpp Synchronous Receive from Multiple Consumers

Posted by Tim Bain <tb...@alumni.duke.edu>.
You might be able to use Camel routes embedded in the broker to move
messages from each topic into a single new queue.  That would preserve
message ordering even when the consumer is disconnected.

Note that I've never used embedded Camel routes, so I can't say for sure
that the approach would work, but I think it should based on what I know.
On Oct 1, 2015 2:15 PM, "artnaseef" <ar...@artnaseef.com> wrote:

> First off, there are no ordering guarantees for messages across more than
> one
> destination.
>
> The closest to a workable solution I believe you'll find for needing to
> serialize the work from messages across multiple destinations, without some
> form of internal queueing in the application, would involve the use of
> composite destinations.  That is, to create a consumer of a composite
> destination that consists of all the individual destinations for which the
> application needs to consume messages.
>
> Keep in mind composite destinations introduce many complexities, so be
> careful to test with all the features of ActiveMQ in-use.
>
> Internal queueing might be the best solution to the problem.  If there's an
> issue of messages being held-up for long periods, perhaps it would be
> possible to set prefetch to 1 and have the processing push the messages
> onto
> the queue and then wait for processing of that message to complete before
> acknowledging it back to the broker.
>
> Hope this helps.
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Activemq-cpp-Synchronous-Receive-from-Multiple-Consumers-tp4702375p4702547.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>