You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by mcarter <mc...@funnelback.com> on 2009/02/05 07:28:17 UTC

Messages being consumed but not delivered to the application

Hi all,
I have a strange problem where it seems I have a message consumer consuming
a message from a queue when I call receive(), but returning null rather than
the message.

I have a simple system where a client sends a message to a queue on a
different machine, another process reads that message and creates a response
in a different queue. The client is then supposed to consume the return
message.

In my setup the call to receive() always times out and returns null.
Originally I thought this might be some kind of network problem (despite the
broker connection remaining active) but checking the network traffic flow
with wireshark shows that the return message is in fact sent to my client
(and the return message is removed from the broker), but the receive call
still returns null.

And I'm afraid I haven't the slightest idea why. Does anyone have any
insight into what may be occurring here?
-- 
View this message in context: http://www.nabble.com/Messages-being-consumed-but-not-delivered-to-the-application-tp21845959p21845959.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Messages being consumed but not delivered to the application

Posted by mcarter <mc...@funnelback.com>.
I'm so unbelievably happy that I worked out what was causing this issue!

It seems that the two servers I was using had different times set on them.
So the receiving machine thought the message was expired, and so rejected
it, while the broker itself thought the message was fine, and so hung onto
it.

Incidentally I needed to hack on the source code to reveal this and noticed
that had I been able to enable debug logging on the broker it would have
told me what the problem was right away. But I found I couldn't actually get
any debugging output from activeMQ, even after setting up a log4j.properties
file as recommended by the activeMQ website. Has anyone else had trouble
getting activeMQ to output debugging information?



mcarter wrote:
> 
> That would certainly produce the described behaviour. I've checked very
> carefully though and I'm 100% certain that I don't have another consumer.
> 
> I've discovered a few more things though.
> I only have two machines involved in this transaction but it seems to only
> be triggered when I"m using a particular two machines, which suggests to
> me that the network layout has something to do with. (I have to stress
> here the the network connection really does work though since I can send
> messages one way and I'm sure I receive the data back)
> 
> Out of curiosity I tries starting the comsumer on the machine which I knew
> would fail, and a short time later starting an identical consumer on a
> different machine (which doesn't exhibit this problem) and discovered that
> the second consumer received the message, but only after the first
> consumers receive() call had timed out and returned null. It's almost like
> the first consumer is receiving the message but not acknowledging it
> properly, so after it fails, the broker sends the message to someone else.
> Any ideas on what could trigger this kind of behaviour?
> 
> 

-- 
View this message in context: http://www.nabble.com/Messages-being-consumed-but-not-delivered-to-the-application-tp21845959p21989389.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Messages being consumed but not delivered to the application

Posted by mcarter <mc...@funnelback.com>.
That would certainly produce the described behaviour. I've checked very
carefully though and I'm 100% certain that I don't have another consumer.

I've discovered a few more things though.
I only have two machines involved in this transaction but it seems to only
be triggered when I"m using a particular two machines, which suggests to me
that the network layout has something to do with. (I have to stress here the
the network connection really does work though since I can send messages one
way and I'm sure I receive the data back)

Out of curiosity I tries starting the comsumer on the machine which I knew
would fail, and a short time later starting an identical consumer on a
different machine (which doesn't exhibit this problem) and discovered that
the second consumer received the message, but only after the first consumers
receive() call had timed out and returned null. It's almost like the first
consumer is receiving the message but not acknowledging it properly, so
after it fails, the broker sends the message to someone else. Any ideas on
what could trigger this kind of behaviour?





Maybe you have another consumer that consumes that message?

Cheers
--
Dejan Bosanac

-- 
View this message in context: http://www.nabble.com/Messages-being-consumed-but-not-delivered-to-the-application-tp21845959p21862411.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Messages being consumed but not delivered to the application

Posted by Dejan Bosanac <de...@nighttale.net>.
Maybe you have another consumer that consumes that message?

Cheers
--
Dejan Bosanac

Open Source Integration - http://fusesource.com/
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net


On Thu, Feb 5, 2009 at 7:28 AM, mcarter <mc...@funnelback.com> wrote:

>
> Hi all,
> I have a strange problem where it seems I have a message consumer consuming
> a message from a queue when I call receive(), but returning null rather
> than
> the message.
>
> I have a simple system where a client sends a message to a queue on a
> different machine, another process reads that message and creates a
> response
> in a different queue. The client is then supposed to consume the return
> message.
>
> In my setup the call to receive() always times out and returns null.
> Originally I thought this might be some kind of network problem (despite
> the
> broker connection remaining active) but checking the network traffic flow
> with wireshark shows that the return message is in fact sent to my client
> (and the return message is removed from the broker), but the receive call
> still returns null.
>
> And I'm afraid I haven't the slightest idea why. Does anyone have any
> insight into what may be occurring here?
> --
> View this message in context:
> http://www.nabble.com/Messages-being-consumed-but-not-delivered-to-the-application-tp21845959p21845959.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>