整合spring,RabbitMQ的使用
相关的jar包3个: rabbitmq-client.jar,spring-amqp.jar,spring-rabbit.jar
spring-rabbitmq.xml的相关配置
<!--连接配置-->
<rabbit:connection-factory id="connectionFactory" host="${mq.host}" port="${mq.port}" username="${mq.username}" password="${mq.password}"/>
<rabbit:admin connection-factory="connectionFactory"/>
<!--定义交换器-->
<rabbit:template id="amqpTemplate" connection-factory="connectionFactory" exchange="cjlHb"/>
<!--定义queue-->
<rabbit:queue name="rabbitMQCjl" durable="true" exclusive="false" auto-delete="false"/>
<!--将queue绑定exchange上-->
<rabbit:topic-exchange na