Messaging Migration Questions
 Technote (troubleshooting)
 
Problem(Abstract)
Unable to create a Java™ Message Service (JMS) object under the WebSphere® MQ JMS provider using the WebSphere® Application Server administrative console. Using the JMSADMIN tool to create the objects under the WebSphere MQ JMS provider is not supported.

Look-up properties are as shown below and this allowed connection to the queue manager

//look-up properties:
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.websphere.naming.WsnInitialContextFactory");
ht.put(Context.PROVIDER_URL, "iiop://devweb1:9814");
InitialContext jndi = new InitialContext(ht);

However, a javax.jms.IllegalStateException is received when trying to call
the method 'setMessageListener' on the QueueReceiver object.
Apparently calling this method violates the J2EE™ 1.3 specification
(Java_Message_Service__JMS_/swg21114239.html), and is only
permitted in a client application. Due to JMS configuration being done outside of the Application Server administrative console this exception was never propagated.

Options:
1) use a MessageDrivenBean
2) configure an object to listen to a queue outside of Web application in a client application
3) leave configuration of queue managers and queues as is - not moving it to the Application Server administrative console

A few questions to consider:
1) Are the above options our only choices?
2) Is this rule specified in the J2EE™ 1.4 specification?
3) What are we gaining by moving the configuration to the Application Server administrative console?
 
Resolving the problem
As you are migrating to WebSphere Application Server 5.1, we would recommend the following,

1) Usage of Message Driven Beans(MDB)

Application Server 5.1 provides extensive features for MDB's for retrieving
messages asynchronously. You can configure multiple sessions of the same MDB running so that multiple messages can be processed parallelly.
Also you can configure "Maximum Retry Count" for handling poison
messages, to ensure that, if a particular message cannot be processed by the MDB, you can limit how many times this message must be retried before moving it to the backout queue. This prevents the listener port for the MDB from shutdown.

Transaction management is controlled by WebSphere on MDB. You can specify
what kind of transaction (either container managed or bean managed) to be enforced on the MDB.
.
2) Configure an object to listen to a queue outside of web application in a client application

If you are not using WebSphere Application Server, for example, if you are writing a stand alone JMS application then you can create your own listener (by implementing the MessageListener interface) to listen on a queue, but if you are using WebSphere Application Server, we recommend to use MDB's.
.
3) Leave configuration of queue managers and queues as is - not moving
it to the Application Server administrative console

You can use the WebSphere administrative console to define the Queue Connection Factory, Queue Destination, Topic Connection Factory and the Topic. These details can be used by any application running under the WebSphere Application Server environment or can be used by the applications to lookup these definitions.

If you are using Embedded Messaging then you can use WebSphere Application Server administrative cnsole to create and configure Queue's.
.
4) Is this rule specified in the J2EE 1.4 specification?

Calling the setMessageListener, is not valid you cannot call this method.
.
5) What are we gaining by moving the configuration to the Application Server administrative
console?

The main advantage gained by moving to Application Server administrative console is that we will achieve JMS application vendor independence. You can define generic connection factories to different messaging systems.
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > Java Message Service (JMS)
Operating system(s): AIX
Software version: 5.1
Software edition:
Reference #: 1210901
IBM Group: Software Group
Modified date: Sep 3, 2007