What is RAJNDI?

RAJNDI is a generic connector for JMS servers of which the connection factories are obtained through JNDI

Packaging, shipping and versions

This connector is shipped as rajndi.rar

New in 5.1.3U1: destination lookup semantics of createQueue() and createTopic().

Usage notes

JNDI names

The jndi names of the connection factories need to be specified. This can be done either as separate values in the deployment descriptor or by properties in the URL or the options field in the deployment descriptor.
NameMeaning
JMSJCA.QueueCFJNDI name of queue connection factory (javax.jms.QueueConnectionFactory)
JMSJCA.TopicCFJNDI name of topic connection factory (javax.jms.TopicConnectionFactory)
JMSJCA.UnifiedCFJNDI name of connection factory (javax.jms.ConnectionFactory)

If the property java.naming.factory.initial is specified, the InitialContext is created using the complete set of properties specified in the URL and or the options field. If the property java.naming.factory.initial is not specified, the InitialContext is created using its default constructor.

Example:

If the following properties are specified, the RAJNDI adapter will try to use STCMS connectionfactories bound in the STCMS JNDI provider.
java.naming.factory.initial=com.stc.jms.jndispi.InitialContextFactory
java.naming.provider.url=stcms://localhost:18007
java.naming.security.principal=Administrator
java.naming.security.credentials=STC
JMSJCA.TopicCF=connectionfactories/xatopicconnectionfactory
JMSJCA.QueueCF=connectionfactories/xaqueueconnectionfactory
JMSJCA.UnifiedCF=connectionfactories/xaconnectionfactory
com.stc.jms.autocommitxa=true
com.stc.jms.jndispi.disconnected=true

These properties can be specified in the Options field or be encoded in the ConnectionURL. Note that if the Options field needs to be limited to one single line, e.g. because of limitation in administrative consoles, the JMSJCA.sep option can be used. Example:

JMSJCA.sep=,java.naming.factory.initial=com.stc.jms.jndispi.InitialContextFactory,java.naming.provider.url=stcms://localhost:18007,java.naming.security. principal=Administrator,java.naming.security.credentials=STC,JMSJCA.TopicCF=connectionfactories/xatopicconnectionfactory,JMSJCA.QueueCF= connectionfactories/xaqueueconnectionfactory,JMSJCA.UnifiedCF=connectionfactories/xaconnectionfactory,com.stc.jms.autocommitxa=true,com.stc.jms. jndispi.disconnected=true

Destinations

When a destination name is prefixed with jndi:// the destination is looked up in the jndi-provider specified as described above. If this prefix is missing, the destination is created using createQueue() or createTopic(). This works for activation specs as well as calls to Session.createQueue() or Session.createTopic().

Example 1

Extending the previous example, when the destination in the activation spec is jndi://queues/Queue1, the queue Queue1 is looked up in the context queues in the JNDI provider with java.naming.provider.url=stcms://localhost:18007.

The same thing will happen if the destination is specified as lookup://q and q is an administrative object with name jndi://queues/Queue1.

Example 2

Extending the first example, when the executing this statement: Session.createQueue("jndi://queues/Queue1"), this will lookup the name queues/Queue1 in the JNDI provider with java.naming.provider.url=stcms://localhost:18007.

Example 3

In the previous example, if an administrative object had been bound in the container's jndi under the name jms/q1, and if the name attribute of this object had been jndi://queues/Queue1, then the statement Session.createQueue("lookup://jms/q1") would have resulted in a lookup of the name queues/Queue1 in the JNDI provider with java.naming.provider.url=stcms://localhost:18007.

Example 4

The statement Session.createQueue("Queue1") would result in calling Session.createQueue("Queue1") on the underlying JMS provider.