aspose file tools*
The moose likes Websphere and the fly likes MDB Problem on WebSphere 5.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "MDB Problem on WebSphere 5.0" Watch "MDB Problem on WebSphere 5.0" New topic
Author

MDB Problem on WebSphere 5.0

Subhash Namboodiri
Ranch Hand

Joined: Jan 02, 2003
Posts: 30
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

Joined: May 10, 2000
Posts: 1913
    
    6
Moving to the IBM/Websphere forum...
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3879
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


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
Subhash Namboodiri
Ranch Hand

Joined: Jan 02, 2003
Posts: 30
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

Joined: Aug 10, 2001
Posts: 3879
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

Joined: Jan 02, 2003
Posts: 30
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

Joined: Aug 10, 2001
Posts: 3879
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

Joined: Jan 02, 2003
Posts: 30
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

Joined: Aug 10, 2001
Posts: 3879
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MDB Problem on WebSphere 5.0
 
Similar Threads
Message Driven Beans
MDB listening to topics
MDB + Entity Bean / MDB + SB + EB
JMS Server
about websphere MQ