Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MDB Problem on WebSphere 5.0

 
Subhash Namboodiri
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I am pretty new to WebSphere can someone direct me. I have created an MDB listening on a Topic. The listner us associated with the Topic and also with the MDB. But when a message is published to Topic the MDB does not receive it.
Can anyone guide me or point me to some document
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the IBM/Websphere forum...
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm going to need a lot more information. can you post the code that you're using? Can you tell us about what you did to set up the topic?
Kyle
 
Subhash Namboodiri
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using Admin Console I have created a TopicConnectionFactory under WebSphere JMS. (No authentication is provided - component or container). I have created this under server (not in node or cell).
After that I created a Topic (which is set to Queued and not direct).
After that I created a Message Listener for this Topic giving the jndi names for TCF and Topic.
After restarting the server the Listener was showing status as running.
Now I created an application having an MDB using the Application Assembly Tool. I provided the details in the deployment descriptors.
Now from the Admin console I deployed the ear and started it. It started without any error.
Now if I am publishing a message to the Topic the MDB is not getting the message.
I tried similar test for Queue (except that for Queues I added the Queue name in the list of Queues in JMSServer). It is working fine.
Is there something extra than the steps mentioned by me for creating a Topic and deploying an MDB to listen on it.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like you didn't define a listener port for the MDB. In the admin console, pick you server, and click on "Message Listener Service" in the "Additional Properties" section of the server properties page. Click on "Listener Ports" and make sure you have one defined for your topic and topic connection factory.
Kyle
 
Subhash Namboodiri
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot. I had some problem with Listeners only.
I have one more problem.
There is a code in my application (A1) which creates a Temporary Topic (TT). After that publishes a message to a different Topic (T) and then waits on the Temporary Topic for reply. There is an MDB (M1) which, listens on the Topic (T) and replies back to Temporary Topic (TT). The Temporary Topic (TT) is set on the messages as JMSReplyTo parameter. The application (A1) which is listening on the Temporary Topic (TT) gets the reply message and does some processing.
Now the code is, the Application (A1) calls the receive on Topic subscriber object created for the Temporay Topic, after the publishing the message to Topic (T). This code is working fine with appservers like WebLogic, Borland and Pramati. But it is not working in WebSphere 50.
In WebSphere, it hangs at the point where subscriber.receive() is called. Atleast the message published to Topic (T) before calling receive on Temporary Topic (TT) should reach the MDB which is listening on the Topic (T).
If instead of receive(), I give a timeout receive(3000), then after the time-out the MDB gets the message from Topic (T).
This shows that in WebSphere instead of Asynchronized behaviour, it is showing synchronized behaviour.
Please, can you help me out in this situation.
Thanks in advance,
Subhash
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you telling me that you're trying to both publish to a topic AND listen for a reply in the same transaction? That's EXPLICITLY forbidden by the EJB 2.0 specification (section 17.3.5 -- page 350). Now, on the other hand if you're doing this from within a servlet without a JTA transaction, that should be alright...
Kyle
 
Subhash Namboodiri
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kyle,
Thanks a lot for pointing out to the specifications. But it is really surprising many of the other Application Servers do not go by the standards. Such problems will be a disaster for companies like us who have products supporting multiple Application servers.
Thanks again.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Absolutely -- I pointed this out on another page to another fellow who wanted to do something outside of the spec with JMS and EJB as well. It's best to stick to the spec in ALL cases -- that way you KNOW your code will work regardless of where you run it.
Kyle
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic