Obtaining a reference to the ConnectionFactory and Destination through JNDI.
Guarantee Inter-Enterprise Message Delivery Using JMS
Gopalan Suresh Raj
Listing 1. Obtaining a reference to the ConnectionFactory and Destination through JNDI.
- By Gopalan Suresh Raj
// Create the InitialContext Object used for looking up
// JMS administered objects on the Messaging Server
// located on the default host.
javax.naming.Context initialCtx = new javax.naming.InitialContext();
// Lookup Connection Factory
javax.jms.TopicConnectionFactory factory =
// Lookup the Destination Topic
Topic topic = (Topic)initialCtx.lookup ("Nasdaq_Topic");