Looking up destinations

JMS destinations are message queues and topics. Use the Management Console to create and configure JMS destinations—see “Message queues and topics”. However, you need not preconfigure message queues or topics, unless you want to set their properties to non-default values.

A JMS client can use the JMS initial context factory com.sybase.jms.client.InitialContectFactory to look up preconfigured message queues and topics by name. For example, if you create a message queue called “myMessageQueue” using the Management Console, you can look up the queue as follows, where ctx is the initial naming context:

Queue myQueue = (Queue) ctx.lookup(“myMessageQueue”);

To look up a message queue that has not been preconfigured, you can use either:

When you look up a message queue or topic that has not been preconfigured, the message service initializes an instance of the message queue or topic using default property values.

To look up message topics that have not been preconfigured, clients can use either a JNDI name ending with “Topic,” or use the javax.jms.Session.createTopic API. You can also use this API to look up preconfigured topics.