tomcat+activemq整合
Tomcat与ActiveMQ的整合文档
之前的安装activemq和tomcat以及各自的配置以及具体代码看pdf文件以及参看工程源码 注意,在jsm-test项目中需要在tomcat的lib中导入mons-logging-1.1.jar
一共导入6个包,另外5个是:
activemq-core-5.1.0.jar
activemq-web-5.1.0.jar
geronimo-j2ee-management_1.0_spec-1.0.jar
geronimo-jms_1.1_spec-1.1.1.jar
geronimo-jta_1.0.1B_spec-1.0.1.jar
修改文件:
Tomcat conf下的l
!-- The contents of this file will be loaded for each web application --
Context
!-- Default set of monitored resources --
l/WatchedResource
!-- ment this to disable session persistence across Tomcat restarts --
!--
Manager pathname=“" /
--
!-- ment this to enable Comet connection tacking (provides events
on session expiration as well as webapp lifecycle) --
!--
Valve className="etConnectionManagerValve" / --
Resource
name="jms/FailoverConnectionFactory"
auth="Container"
type="org.apache.activemq.ActiveMQConnectionFactory"
description="JMS Connection Factory"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
Tomcat与ActiveMQ的整合文档
brokerURL="failover:(tcp://localhost:*****)?initialReconnectDelay=100amp;maxReconnectAttempts=5"
brokerName="localhost"
useEmbeddedBroker="false"/
Resource
name="jms/NormalConnectionFactory"
auth="Container"
type="org.apache.activemq.ActiveMQConnectionFactory"
description="JMS Connection Factory"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
brokerURL="tcp://localhost:*****"
brokerName="localhost"
useEmbeddedBroker="false"/
Resource name="jms/topic/MyTopic"
auth="Container"
type="mand.ActiveMQTopic"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
physicalName="MY.TEST.FOO"/
Tomcat与ActiveMQ的整合文档
Resource name="jms/queue/MyQueue"
auth="Container"
type="mand.ActiveMQQueue"
factory="org.apache.activemq.jndi.JNDIReferenceFactory"
physicalName="MY.TEST.FOO.QUEUE"/
/Context
Activemq conf下的l文件
!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in pliance with
the License. You may obtain a copy of the License at
active transport /licenses/*****-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
***** *****IES OR *****ONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and
limitations under the License.
--
!-- START *****: example --
beans
xmlns="/schema/beans"
xmlns:amq="/schema/core"
xmlns:xsi="/2001/XMLSchema-instance"
xsi:schemaLocation="/schema/beans
/schema/beans/spring-beans-2.0.xsd
/schema/core
/schema/core/activemq-core.xsd
/camel/schema/spring
/camel/schema/spring/camel-spring.xsd"
Tomcat与ActiveMQ的整合文档
!-- Allows us to use system properties as variables in this configuration file --
bean class="org.springframework.fig.PropertyPlaceholderConfigurer"/
broker xmlns="/schema/core" brokerName="localhost" persistent="true" useShutdownHook="false"
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论