Basic Setting required for running simple JMS class

Advertisement
please tell me all setting required for running JMS class.
I have installed IBM MQSeries.
Especially about how to lookup for Topic and TopicConnectionFactory and where should i specify.
it is very urgent please help me fast. Also send any files for doing setting to me at [email protected]
Advertisement

Replay

Context ctx = null;
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY," "); //put yor init. context
ht.put(Context.PROVIDER_URL, " "); //put your server url
ctx = new InitialContext(ht);
TopicConnectionFactory topicConnectionFactory = (TopicConnectionFactory) ctx.lookup(" "); // your connection factory
TopicConnection tcon = topicConnectionFactory.createTopicConnection();
TopicSession tsession = tcon.createTopicSession(false,Session.AUTO_ACKNOWLEDGE);
Topic topic = (Topic) ctx.lookup(" "); // This is your topic
TopicSender tsender = tsession.createSender(topic);
TextMessage message = tsession.createTextMessage();
message.setText("Topic Message");