This week's book giveaway is in the OCP forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests and have Scott Selikoff and Jeanne Boyarsky on-line!
See this thread for details.
Win a copy of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

My AsynchronousConsumer Won't Listen!

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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.

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

TestConsumer
-- 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
WEB CONSOLE OUTPUT
 
George Berish
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
SORRY! I mistakenly put two copies of TestConsumerView above and left out TestConsumer.

Here is the missing code:
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
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.
 
Uh oh, we're definitely being carded. Here, show him this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic