This week's book giveaway is in the Programmer Certification forum. We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer (Exam 1Z0-830) Java SE 17 Developer (Exam 1Z0-829) Programmer’s Guide and have Khalid Mughal and Vasily Strelnikov on-line! See this thread for details.
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
NanoAgent is an Artificial intelligence RoBot of microscopic proportions built by means of nanotechnology
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.
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
NanoAgent is an Artificial intelligence RoBot of microscopic proportions built by means of nanotechnology