Win a copy of Fixing your Scrum this week in the Agile 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

jms pub sub

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, I have developed and JMS EJB with a publisher and subscriber.
My question is when i send a message to the message driven bean which is deployed in jboss app/server through the publisher, is it important which client starts first, that is subscriber or producer?
Any references to jms and mdbs will be highly appreciated.
Thank you in advance.
pinda
 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It doesn't matter what "starts first" - since you are not sending a message directly from one MDB to another, you send a message to a topic. A message consumer subscribes to a topic, and listens for messages to arrive on it. Its a completely asynchronous process, so nothing is required of the consuming MDB by the producing MDB. Depending on your persistance strategy you could ever stop the server and the message will still reach your consumer.
 
Pinda Ros
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello and thank you for your answer,
Do you know if it is necessary to have a message listener?
pinda
 
eammon bannon
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, nothing inthe publisher requires this. But it would be silly not to - otherwise your just gradually filling a topic up with useless messages.
 
Pinda Ros
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So what exactly is the usage of the message listener?
Is the subscriber using the message listener, when a message is published, to receive the message and remove it from the topic.
Will the subscriber be able to receive another message from a publisher on the same topic.
At the moment i have developed an mdb,publisher and subscriber and i receive only the first message without any listener whatsoever.
However if i add the following line: subscriber.setMessageListener(this); i get the following exception: javax.jms.JMSException: A message listener is already registered. My class implements MessageListener and onMessage method.
Any ideas?
Thank you in advance.
pinda
 
Pinda Ros
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Problem solved, i attach the files for future reference to others...
mdb for non-durable messages
subscriber

publisher
 
money grubbing section goes here:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic