Is it necessary to configure rabbitmq into spring xml file in a maven project

207 views
Skip to first unread message

Li ZW

unread,
Aug 10, 2016, 6:28:52 AM8/10/16
to rabbitmq-users
Here I have a project that used Rabbitmq, and make a rabbitContext.xml file in project for spring integration.

But when I use Rabbitmq to do something like get message counts and get other information about my queue and connection, 

I find that configure file help little.

below is my rabbitContext.xml

    <rabbit:connection-factory id="connectionFactory" host="127.0.0.1" username="guest" password="guest" port="5672" />
   
<!--<rabbit:connection-factory id="connectionFactory"/>-->
   
<rabbit:admin connection-factory="connectionFactory"/>


   
<rabbit:queue id="test_queue" name="test_queue" durable="true" auto-delete="false" exclusive="false" />
   
<rabbit:direct-exchange name="test-mq-exchange" durable="true" auto-delete="false" id="test-mq-exchange">
       
<rabbit:bindings>
           
<rabbit:binding queue="test_queue" key="test_queue"/>
       
</rabbit:bindings>
   
</rabbit:direct-exchange>


   
<!--<rabbit:listener-container connection-factory="connectionFactory" acknowledge="auto">-->
       
<!--<rabbit:listener queues="test_queue" ref="messageListenerImpl"/>-->
   
<!--</rabbit:listener-container>-->


    <rabbit:template exchange="test-mq-exchange" id="amqpTemplate"  connection-factory="connectionFactory"  message-converter="jsonMessageConverter" />

    <bean id="jsonMessageConverter" class="org.springframework.amqp.support.converter.Jackson2JsonMessageConverter" />

the beans are ConnectionFactory, Queue and AmqpTemplate. And method amounts of those bean is too small.

Michael Klishin

unread,
Aug 10, 2016, 6:30:46 AM8/10/16
to rabbitm...@googlegroups.com
Is your goal monitoring? If so, it might be easier to use https://github.com/rabbitmq/hop directly
instead of spring-amqp. spring-amqp has a very different value proposition and assumes your application
will do a lot of actual messaging.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ
Reply all
Reply to author
Forward
0 new messages