简体   繁体   English

具有初始上下文的JBOSS 7.1 IBM MQ配置

[英]JBOSS 7.1 IBM MQ Configuration with INITIAL CONTEXT

Here is my resource-adapter, but I have to go by initial context set up without using this resource-adapter. 这是我的资源适配器,但是我必须在不使用此资源适配器的情况下进行初始上下文设置。 Find my initial context set up below: 在下面找到我的初始上下文设置:

<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);

Look up IBM MQ components via JNDI from a remote client (another JVM), is not supported by the IBM MQ JCA. IBM MQ JCA不支持通过JNDI从远程客户端(另一个JVM)查找IBM MQ组件。 The IBM connection factories and destinations can only be accessed from the JVM that loads the IBM MQ JCA. 只能从加载IBM MQ JCA的JVM中访问IBM连接工厂和目的地。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM