[英]JBOSS 7.1 IBM MQ Configuration with INITIAL CONTEXT
這是我的資源適配器,但是我必須在不使用此資源適配器的情況下進行初始上下文設置。 在下面找到我的初始上下文設置:
<resource-adapter>
<archive>
wmq.jmsra.rar
</archive>
<transaction-support>NoTransaction</transaction-support>
<connection-definitions>
<connection-definition class-name="com.ibm.mq.connector.outbound.ManagedQueueConnectionFactoryImpl" jndi-name="java:jboss/CONFACTORY1" pool-name="CONFACTORY1">
<config-property name="port">
1234
</config-property>
<config-property name="hostName">
172.16.70.2
</config-property>
<config-property name="channel">
SYSTEM.DEF.SVRCONN
</config-property>
<config-property name="transportType">
CLIENT
</config-property>
<config-property name="queueManager">
QUEUEMGR
</config-property>
</connection-definition>
</connection-definitions>
<admin-objects>
<admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:jboss/JMSQUEUE" pool-name="MQ.QUEUE.NAME">
<config-property name="baseQueueName">
JMSQUEUE
</config-property>
<config-property name="baseQueueManagerName">
QUEUEMGR
</config-property>
</admin-object>
</admin-objects>
</resource-adapter>
final Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.mq.connector.outbound.ManagedQueueConnectionFactoryImpl");
env.put(Context.PROVIDER_URL, "remote://172.16.70.2:1234");
// env.put(Context.SECURITY_PRINCIPAL, "admin");
// env.put(Context.SECURITY_CREDENTIALS, "sn@12345");
InitialContext context = new InitialContext(env);
IBM MQ JCA不支持通過JNDI從遠程客戶端(另一個JVM)查找IBM MQ組件。 只能從加載IBM MQ JCA的JVM中訪問IBM連接工廠和目的地。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.