0

我已经在 weblogic 中部署了 activemq 资源适配器。我需要限制到 activemq 的连接数。我创建了一个 weblogic-ra.xml 文件并将其保存在资源适配器的 meta-inf 文件夹中。它仍在接受 n 个连接。我究竟做错了什么?。有没有其他方法可以限制连接数。请帮忙

Weblogic-ra.xml 内容

javax.jms.ConnectionFactory eis/activemq-ra_javax_jms_ConnectionFactory 0 0 1 假 900

           </connection-properties> 
        </connection-instance> 

  </connection-definition-group> 
 <connection-definition-group>
     <connection-factory-interface>javax.jms.QueueConnectionFactory</connection-factory-interface> 
     <connection-instance>
        <jndi-name>eis/activemq-ra_javax_jms_QueueConnectionFactory</jndi-name>
        <connection-properties> 
              <pool-params>
                    <initial-capacity>0</initial-capacity>
                    <max-capacity>0</max-capacity>
                    <capacity-increment>1</capacity-increment>
                    <shrinking-enabled>false</shrinking-enabled>
                    <shrink-frequency-seconds>900</shrink-frequency-seconds>
              </pool-params>


           </connection-properties>
     </connection-instance>
 </connection-definition-group>
 <connection-definition-group>
     <connection-factory-interface>javax.jms.TopicConnectionFactory</connection-factory-interface> 
     <connection-instance>
        <jndi-name>eis/activemq-ra_javax_jms_TopicConnectionFactory</jndi-name>
        <connection-properties> 
              <pool-params>
                    <initial-capacity>0</initial-capacity>
                    <max-capacity>0</max-capacity>
                    <capacity-increment>1</capacity-increment>
                    <shrinking-enabled>false</shrinking-enabled>
                    <shrink-frequency-seconds>900</shrink-frequency-seconds>
              </pool-params>


           </connection-properties>
     </connection-instance>
 </connection-definition-group>

4

1 回答 1

0

问题解决了!!!!

我已将 activemq jndi 名称添加到我的代码中

上下文上下文 = new InitialContext(); ConnectionFactory connectionFactory = (ConnectionFactory) context.lookup("eis/activemq-ra_javax_jms_ConnectionFactory"); 连接连接 = connectionFactory.createConnection(); 连接.start();

现在我的应用程序与资源适配器通信并根据上面给出的 weblogic-ra.xml 文件限制连接数

于 2016-11-18T09:27:35.593 回答