You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Adrian Tarau <ad...@daxtechnologies.com> on 2006/04/14 21:58:54 UTC

Synchron consume behavior

I'm using ActiveMQ 3.2.2 , embedded with derby for storage, and I have a 
strange behavior when consuming messages.

I know for sure that the queue has more that 100 messages, but if I 
consume with receive() sometime(a lots of times) the result is null, 
like there are no messages. If I put receive(1000) then seems to work 
fine, even if a few times I noticed a null value even if the queue had 
items.

Anybody got some problems like that?

Re: Synchron consume behavior

Posted by Hiram Chirino <hi...@hiramchirino.com>.
Hi,

That's because the broker has not delivered any messages to the client
yet.  The messages are on the broker, but consumer.receive() is only
checking to see if the broker has delivered it any messages.

On 4/14/06, Adrian Tarau <ad...@daxtechnologies.com> wrote:
> I'm using ActiveMQ 3.2.2 , embedded with derby for storage, and I have a
> strange behavior when consuming messages.
>
> I know for sure that the queue has more that 100 messages, but if I
> consume with receive() sometime(a lots of times) the result is null,
> like there are no messages. If I put receive(1000) then seems to work
> fine, even if a few times I noticed a null value even if the queue had
> items.
>
> Anybody got some problems like that?
>


--
Regards,
Hiram