activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Consumer not consuming messages
Date Mon, 11 Feb 2008 14:12:29 GMT
On 11/02/2008, Jeroen van Bergen <vanbergen.jeroen@gmail.com> wrote:
>
> I'm running a very basic instance of AMQ 5.0.0: just the supplied sample
> configuration, starting the broker with bin\activemq. My client application
> (Java SE) produces and consumes messages on a single queue. Both the
> producer and the consumer use the
> session.createXXX(session.createQueue(queueName), null) call to create a
> producer and a consumer, respectively.
>
> The producer is happily producing messages. I can browse them using the web
> front end supplied with ActiveMQ. When I add a QueueBrowser to the consuming
> class it can see the messages in the queue. The consumer is not picking up
> any message at all. Relevant code:
>
> QueueBrowser browser =
> session.createBrowser(session.createQueue(queueName));
> Enumeration enumeration = browser.getEnumeration();
> while (enumeration.hasMoreElements()) {
>     Message message = (Message) enumeration.nextElement();
>     logger.debug("Saw message " + message.getJMSMessageID());
> }
> logger.debug(getName() +  " is requesting messages from " + queueName);
> Message message = consumer.receiveNoWait();
> if (message != null) {
>     logger.debug("Retrieved message " + message.getJMSMessageID());
> }
>
> The consumer is started before the producer and they run in seperate threads
> on a 1.6.0_03 Sun JVM on Windows XP Pro SP2.
>
> What might be causing this behaviour? Do I have to supply credentials before
> a consumer is allowed to actually consume messages?
>
> Thanks in advance for any response.

Have you hit this FAQ entry?
http://activemq.apache.org/i-am-not-receiving-any-messages-what-is-wrong.html

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Mime
View raw message