ActiveMQ 설정
4568 단어 activemq
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
<!-- ------ : ------->
<!-- 1. ActiveMQ Broker JVM ,
spring ,ActiveMQ embedded Broker 。
-->
<amq:broker useJmx="false" persistent="true">
<!-- 2. spring listenerContainer, , -->
<amq:persistenceAdapter>
<amq:amqPersistenceAdapter directory="d:/iteye/amq" />
</amq:persistenceAdapter>
<amq:transportConnectors>
<amq:transportConnector uri="tcp://localhost:0" />
</amq:transportConnectors>
</amq:broker>
<!-- activeMQ
<amq:connectionFactory id="jmsConnectionFactory"
brokerURL="tcp://localhost:61616?wireFormat.maxInactivityDuration=0"
/>
-->
<!--
2. (A)ConnectionFactory
Broker JVM embedded URL :vm://localhost
-->
<amq:connectionFactory id="jmsConnectionFactory"
brokerURL="vm://localhost" />
<!--
3 (B)Queue Queue
-->
<amq:queue name="QUEUE" physicalName="auto_check" />
<!--
4. (C)Converter
-->
<bean id="defaultMessageConverter" class="com.iteye.queue.DefaultMessageConverter" />
<!-- ------- : ---->
<!--
1 JmsTemplate JMS
Spring Template, (A)ConnectionFactory (C)Converter。
-->
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory">
<!-- lets wrap in a pool to avoid creating a connection per send
,
-->
<bean class="org.springframework.jms.connection.SingleConnectionFactory">
<property name="targetConnectionFactory" ref="jmsConnectionFactory" />
</bean>
</property>
<!-- custom MessageConverter
-->
<property name="messageConverter" ref="defaultMessageConverter" />
</bean>
<!-- 2.Producer , JmsTemplate , JmsTemplate ( A、C) (B)Queue。-->
<bean id="queueMessageProducer" class="com.iteye.queue.QueueMessageProducer">
<property name="template" ref="jmsTemplate" />
<property name="destination" ref="QUEUE" />
</bean>
<!------- : ----->
<!-- 1. (MDP) Spring MessageListenerAdapter,
POJO , (C)Converter。
-->
<bean id="queueConsumer" class="com.iteye.queue.QueueConsumer">
<property name="interaction" ref="autoCheckInteraction" />
</bean>
<bean id="queueListener"
class="org.springframework.jms.listener.adapter.MessageListenerAdapter">
<!-- -->
<constructor-arg ref="queueConsumer" />
<!-- -->
<property name="defaultListenerMethod" value="receive" />
<!-- -->
<property name="messageConverter" ref="defaultMessageConverter" />
</bean>
<!-- 2. listenerContainer MDP, (A) connectionFactory, (B)Queue MDP。listener container,MDP -->
<bean id="queueListenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="jmsConnectionFactory" />
<property name="destination" ref="QUEUE" />
<property name="messageListener" ref="queueListener" />
</bean>
</beans>
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
activeMQ의 질문오늘은 mule로 activeMQ와 통합할 때, mule를 시작할 때 항상 activeMQ의 시작에 머물러 있습니다.원본 코드를 보니 active MQ에 사순환이 생겼습니다. 위의 코드에서dolock은 시종일관fal...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.