[jboss-user] [JCA/JBoss] - Messaging with IBM Websphere MQ 7 JCA Adapter
igor.beslic
do-not-reply at jboss.com
Fri Jul 10 05:30:41 EDT 2009
Hi I have followed JBoss and IBM instructions and succeeded to run MQ JCA with JBoss 5.0.1. I use MQ v7. Both JBossAS 5.0.1 and MQ 7 are installed on WinXP. I use AdminObject to publish topic:
connectionFactory:
Code:
<tx-connection-factory>
| <jndi-name>wmq/myFC</jndi-name>
| <xa-transaction />
| <rar-name>wmq.jmsra.rar</rar-name>
| <connection-definition>javax.jms.ConnectionFactory</connection-definition>
| <config-property name="channel" type="java.lang.String">SYSTEM.DEF.SVRCONN</config-property>
| <config-property name="hostName" type="java.lang.String">localhost</config-property>
| <config-property name="port" type="java.lang.String">1414</config-property>
| <config-property name="queueManager" type="java.lang.String">QM_MYQM</config-property>
| <config-property name="transportType" type="java.lang.String">CLIENT</config-property>
| <config-property name="username" type="java.lang.String">me at MYDOMAIN</config-property>
| <security-domain-and-application>JmsXARealm</security-domain-and-application>
| </tx-connection-factory>
admin obj:
Code:
<mbean code="org.jboss.resource.deployment.AdminObject" name="jca.wmq:name=myTopic">
| <!-- Bind this AdminObject with the JNDI name myTopic -->
| <attribute name="JNDIName">myTopic</attribute>
| <!-- this MBean depends on the WebSphere MQ resource adapter -->
| <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='wmq.jmsra.rar'</depends>
| <!-- this admin object is a javax.jms.Topic -->
| <attribute name="Type">javax.jms.Topic</attribute>
| <attribute name="Properties">
| persistence=NON
| baseTopicName=myTopic
| brokerPubQueue=SYSTEM.BROKER.DEFAULT.STREAM
| CCSID=1208
| </attribute>
| </mbean>
This is code in my servlet:
Code:
InitialContext ic = new InitialContext();
|
| ConnectionFactory cf = (javax.jms.ConnectionFactory) ic.lookup("java:wmq/myFC");
| Topic topic = (Topic) ic.lookup("myTopic");
|
| Connection conn = cf.createConnection();
| conn.start();
|
| Session sess = conn.createSession(true, Session.AUTO_ACKNOWLEDGE);
| MessageProducer mp = sess.createProducer(topic);
| mp.send(sess.createTextMessage("This is topic message at: " + (new Date())));
| conn.close();
1. I have trouble that code executes without any exceptions but I still have no any messages in MQ. Does anybody has maybe expirience with topic publishing?
2. What if I have 100 topics in my MQ. Is there way to programaticly create topic destination? When I use WS MQ API directly there is way to do that but I would like avoid including WSMQ libraries in my app because then using JCA wouldn't make sense.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4242799#4242799
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4242799
More information about the jboss-user
mailing list