Created
May 20, 2011 21:52
-
-
Save rponte/983895 to your computer and use it in GitHub Desktop.
Embedded ActiveMQ with JMX on Spring 3.x
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <beans xmlns="http://www.springframework.org/schema/beans" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" | |
| xmlns:jms="http://www.springframework.org/schema/jms" xmlns:p="http://www.springframework.org/schema/p" | |
| xmlns:amq="http://activemq.apache.org/schema/core" | |
| xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd | |
| http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd | |
| http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-3.0.xsd | |
| http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd"> | |
| <!-- ActiveMQ Broker --> | |
| <amq:broker id="test-broker" persistent="false" useJmx="true"> | |
| <amq:managementContext> | |
| <amq:managementContext createConnector="true"/> | |
| </amq:managementContext> | |
| <amq:transportConnectors> | |
| <amq:transportConnector uri="tcp://localhost:0" /> | |
| </amq:transportConnectors> | |
| </amq:broker> | |
| <!-- JMS ConnectionFactory to use --> | |
| <!-- creates an activemq connection factory using the amq namespace --> | |
| <amq:connectionFactory id="connectionFactory" brokerURL="vm://localhost:61616" /> | |
| <amq:queue id="destination" physicalName="myqueue" /> | |
| <!-- ********************************************* --> | |
| <!-- Producers --> | |
| <!-- ********************************************* --> | |
| <!-- producer used only on test env --> | |
| <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate" primary="true"> | |
| <property name="connectionFactory" ref="connectionFactory" /> | |
| <property name="defaultDestination" ref="destination" /> | |
| <property name="receiveTimeout" value="3000"/> <!-- 3s --> | |
| <property name="messageConverter" ref="pontosAContabilizarMessageConverter" /> | |
| </bean> | |
| <!-- ********************************************* --> | |
| <!-- Consumers --> | |
| <!-- ********************************************* --> | |
| <jms:listener-container container-type="default" | |
| connection-factory="connectionFactory" acknowledge="transacted" | |
| message-converter="pontosAContabilizarMessageConverter"> | |
| <jms:listener destination="myqueue" ref="contabilizadorDePontosListener" method="contabiliza" /> | |
| </jms:listener-container> | |
| </beans> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment