Activemq Tomcat 配置
Spring web.xml:
<bean id="connectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="${jms.jndi.connectionfactory}"></property> </bean> <!-- Queue --> <bean id="outgingDestination" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="${jms.outgoing.destination}"></property> </bean> <bean id="incomingDestination" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="${jms.incoming.destination}"></property> </bean>
jms.properties:
jms.receive.timeout=5000
jms.jndi.connectionfactory=java:comp/env/jms/NormalConnectionFactory
jms.incoming.destination=java:comp/env/jms/queue/channel0
jms.outgoing.destination=java:comp/env/jms/queue/channel1
tomcat conf/context.xml (Eclipse Servers) :
<Resource name="jms/NormalConnectionFactory" auth="Container" type="org.apache.activemq.ActiveMQConnectionFactory" description="JMS Connection Factory" factory="org.apache.activemq.jndi.JNDIReferenceFactory" brokerURL="tcp://10.135.63.33:61616" brokerName="localhost" userName="system" password="manager" useAsyncSend="true" useEmbeddedBroker="false" /> <Resource name="jms/queue/channel0" auth="Container" type="org.apache.activemq.command.ActiveMQQueue" factory="org.apache.activemq.jndi.JNDIReferenceFactory" physicalName="test.queue" /> <Resource name="jms/queue/channel1" auth="Container" type="org.apache.activemq.command.ActiveMQQueue" factory="org.apache.activemq.jndi.JNDIReferenceFactory" physicalName="test.replyqueue" />
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步