File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes My AsynchronousConsumer Won't Listen! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "My AsynchronousConsumer Won Watch "My AsynchronousConsumer Won New topic

My AsynchronousConsumer Won't Listen!

George Berish

Joined: Oct 28, 2004
Posts: 21

I have a WebStart downloaded Java SWING client that I want to have listen continuously to a server side Queue.

I am using a JBoss local server that has a Queue configured and bound to a JNDI name of "queue/goAdminOut".

I know that the queue exists and has a message waiting, because I can see it on the JBoss JMX web-console (see console screen print below).

Here is the relevant code.

1. Two classes that mimic my client.

-- A JFrame that stays alive till it is closed.

-- An object that is instantiated as a field in TestConsumerView
-- It establishes the connection, session and message consumer with a selector. It also sets a Listener on the consumer.

2. The command screen print when I run TestConsumerView

3. A screen print from the JBoss JMX web console confirming that the message is in the queue.

TestConsumerView Code
TestConsumer Code
Screen Output

George Berish

Joined: Oct 28, 2004
Posts: 21
SORRY! I mistakenly put two copies of TestConsumerView above and left out TestConsumer.

Here is the missing code:
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10441

Are your send and receive operations in the same transactions? If yes, then the send and receive operations need to be separated out into 2 different transactions.

If they are already in different transaction, then try sending/receiving the message without the message selector, so that you can narrow down on the problem.

[My Blog] [JavaRanch Journal]
I agree. Here's the link:
subject: My AsynchronousConsumer Won't Listen!
It's not a secret anymore!