spring-message-sdk-rabbitmq.xml
1.24 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="${rabbit_message_center:rabbitmq-common-aws.yohoops.org:5672}" username="${rabbit_message_center_user:yoho}"
password="${rabbit_message_center_password:yoho}" virtual-host="${rabbit_message_center_vhost: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>