[jboss-user] [JCA/JBoss] - Re: Messaging with IBM Websphere MQ 7 JCA Adapter - Multiple
igor.beslic
do-not-reply at jboss.com
Wed Aug 12 11:37:43 EDT 2009
Hi. I've solved this myself. Solution was easy:
There is no need to configure topic destination. Once connection factory is obtained use session object to create Topic.
Here is code:
InitialContext ic = new InitialContext();
|
| ConnectionFactory cf = (javax.jms.ConnectionFactory) ic.lookup("java:wmq/myFC");
|
| Connection conn = cf.createConnection();
| conn.start();
|
| Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
| Topic topic = sess.createTopic("CITY/NEWS/City_1");
| MessageProducer mp = sess.createProducer(topic);
| mp.send(sess.createTextMessage("***This is topic message***" ));
| conn.close();//comment this if calling from MDB
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4249254#4249254
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4249254
More information about the jboss-user
mailing list