camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pontus Ullgren <ullg...@gmail.com>
Subject Re: Testing a Route which de-queues message from Topic in CLIENT_ACKNOWLEDGE mode
Date Thu, 05 Jul 2012 16:11:43 GMT
Hi,

You can get the statistics from the BorkerService object.
To be honest I have never tested this with topics but for a queue the
calls are like this.

--------------
ActiveMQDestination queryDest =
                        ActiveMQDestination.createDestination("myQueue",
                                        ActiveMQDestination.QUEUE_TYPE);

Destination dest = broker.getDestination(queryDest);
DestinationStatistics stats = dest.getDestinationStatistics();

assertEquals(0, stats.getMessages().getCount());
assertEquals(1, stats.getEnqueues().getCount());
assertEquals(1, stats.getDequeues().getCount());
--------------
// Pontus


On Thu, Jul 5, 2012 at 4:24 PM, gilboy <josephotoole@gmail.com> wrote:
> Hi Folks
>
> It was also unclear to me how to ensure that the message was de-queued or
> not.
>
> Ideally, after starting up the broker service in my junit test I would like
> to put a message on to the queue and then verify I have successfully
> de-queued the message at the end of my testcase by ensuring the size of the
> queue is *0*.
>
> Again, when testing a flow in my route which should *not *dequeue the
> message I would like to put a message on to the queue and then verify the
> message has not been de-queued by verifying that the size of the queue is
> *1*
>
> However, I cannot figure out how to determine the size of the queue.
>
> Thanks!
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Testing-a-Route-which-de-queues-message-from-Topic-in-CLIENT-ACKNOWLEDGE-mode-tp5715361p5715553.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message