test-message-sdk-rabbitmq.xml 1.11 KB
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:rabbit="http://www.springframework.org/schema/rabbit" xmlns="http://www.springframework.org/schema/beans"
	xsi:schemaLocation="http://www.springframework.org/schema/rabbit
           http://www.springframework.org/schema/rabbit/spring-rabbit.xsd
           http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans.xsd">

	<bean id="messageSimpleMessageConverter"
		class="org.springframework.amqp.support.converter.SimpleMessageConverter" />

	<rabbit:connection-factory id="message-rabbitmq-connectionFactory"
		addresses="192.168.102.45:5672" username="yoho"
		password="yoho" virtual-host="yoho" />

	<rabbit:template id="messageAmqpTemplate"
		connection-factory="message-rabbitmq-connectionFactory"
		message-converter="messageSimpleMessageConverter" />

	<!--消息中心发送消息的 producerTemplate -->
	<bean id="messageProducerTemplate" class="com.yoho.message.sdk.common.mq.MessageProducerTemplate"
		primary="false">
		<property name="amqpTemplate" ref="messageAmqpTemplate" />
	</bean>

</beans>