Last active
December 11, 2015 02:38
-
-
Save patelm5/4531624 to your computer and use it in GitHub Desktop.
sample spring rabbit configuration
This file contains 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:rabbit="http://www.springframework.org/schema/rabbit" xmlns:context="http://www.springframework.org/schema/context" | |
xsi:schemaLocation="http://www.springframework.org/schema/rabbit http://www.springframework.org/schema/rabbit/spring-rabbit-1.1.xsd | |
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> | |
<rabbit:connection-factory id="connectionFactory" host="${rabbitmq.host:localhost}" port="${rabbitmq.port:5672}" | |
username="guest" password="guest" connection-factory="rcf" /> | |
<bean id="rcf" class="com.rabbitmq.client.ConnectionFactory"> | |
<property name="host" value="${rabbitmq.host:localhost}"/> | |
<property name="requestedHeartbeat" value="10" /> | |
</bean> | |
<rabbit:template id="amqpTemplate" connection-factory="connectionFactory" reply-timeout="20000" /> | |
<rabbit:admin connection-factory="connectionFactory" /> | |
<rabbit:queue name="BroadcastQueue" > | |
<rabbit:queue-arguments value-type="java.lang.Long"> | |
<entry key="x-message-ttl" value="2400000" /> | |
</rabbit:queue-arguments> | |
</rabbit:queue> | |
<rabbit:listener-container connection-factory="connectionFactory"> | |
<rabbit:listener queues="BroadcastQueue" ref="broadcastQueueConsumer" /> | |
</rabbit:listener-container> | |
</beans> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment