我已经在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>
答案 0 :(得分:0)
问题已解决!!!!
我已将activemq jndi名称添加到我的代码中
Context context = new InitialContext(); ConnectionFactory connectionFactory =(ConnectionFactory)context.lookup(&#34; eis / activemq-ra_javax_jms_ConnectionFactory&#34;); 连接连接= connectionFactory.createConnection(); connection.start();
现在我的应用程序与资源适配器通信,并根据上面给出的weblogic-ra.xml文件限制连接数