Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

read message from Topic

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello...
How to read message from Topic without the use of MessageListener...
I try with MessageConsumer receive() method, but.... nothing...

When I try to work with Queue, and when I use receive method, all works fine.

Thanks
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please post the code you are using, including the code that establishes the connection to the topic.

Topics are different than queues - only listeners who are registered at the time that a message is posted to a topic will received the message. You can change this by registering a durable listener, in which case the server will ensure that the durable listener gets all messages, even those posted while the listener was not listening.
 
Vlade Maksimovic
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Producer:


Customer:



Test class:


I known to do this example to work with MessageListener, but my task is that make to work without Listener. I forget to tell, I work with Jboss 5.0.1GA.
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please read this sentence again:

Topics are different than queues - only listeners who are registered at the time that a message is posted to a topic will received the message.



Then look at your test code and tell me why it does not work.

Your consumer is a little trickier - you will have to read the javadocs for the MessageConsumer.receive() method before you can tell me why it doesn't work.
 
The longest recorded flight time of a chicken is 13 seconds. But that was done without this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic