ActiveMQ与Tomcat集成
Tomcat提供了两种方式的JNDI Resource配置:
- Local JNDI context:指该resource只可用于部署至该Tomcat容器中的某一个Application;
- Global JNDI context.:指该resource客用于部署至Tomcat容器中的任何Application.
1. Using local JNDI to integrate ActiveMQ with Tomcat
JNDI Resource配置位于META-INF/context.xml文件中:
<Context reloadable="true"> <Resource auth="Container" name="jms/ConnectionFactory" type="org.apache.activemq.ActiveMQConnectionFactory" description="JMS Connection Factory" factory="org.apache.activemq.jndi.JNDIReferenceFactory" brokerURL="vm://localhost?brokerConfig=xbean:activemq.xml" brokerName="MyActiveMQBroker"/> <Resource auth="Container" name="jms/FooQueue" type="org.apache.activemq.command.ActiveMQQueue" description="JMS queue" factory="org.apache.activemq.jndi.JNDIReferenceFactory" physicalName="FOO.QUEUE"/> <Resource auth="Container" name="jms/FooTopic" type="org.apache.activemq.command.ActiveMQTopic" description="JMS topic" factory="org.apache.activemq.jndi.JNDIReferenceFactory" physicalName="FOO.TOPIC"/> </Context>
2. Using global JNDI to integrate ActiveMQ with Tomcat
相关推荐
方新德 2020-04-20
胡献根 2020-02-23
胡献根 2020-02-13
WindyQCF 2014-05-12
胡献根 2020-07-18
胡献根 2020-07-05
jiangtie 2020-06-10
onlylixiaobei 2020-06-09
xinglun 2020-06-02
方新德 2020-05-31
Java高知 2020-05-20
Java高知 2020-05-08
Java高知 2020-05-03
onlylixiaobei 2020-05-02
Java高知 2020-04-22
胡献根 2020-04-22
heweiyabeijing 2020-04-21
胡献根 2020-04-10