When is it appropriate to use AMQP?

On my previous job I used benefits of AMQP, but I was not involved in rabbitMQ subproject development. On my current job I want to take charge of integrating one of AMQP implementations (probably rabbitMQ). The issue here that I have to convinced my Boss in using AMQP.

I am reading "RabbitMQ in Action" and Mr. Videla wrote that AMQP could improve any system, but I do not see how I can improve my project. We use only 2 servers making API calls in between, so we do not have scalability problem right now. We deal with real money flows and this means we need success confirmation for any operation, ie I can not put task in queue and "forget" about it. What benefits could AMQP bring in this case?

Could you please provide couple real world examples for relatively small systems when you do not need to scale hardly? Please omit standard "logging" and "broadcast message" situations :)


It sounds like all you need is RPC. Rabbit is not known for RPC but it actually does a really good job because:

  • You can make many messages transactional (ie all in one transaction)
  • Its platform, language and protocol format agnostic (ie you could send binary over)
  • Because of the broker idea you can easily add more servers to handle the procedures.
  • You can easily see the message flow and rate with RabbitMQ's admin UI
  • RabbitMQ is sort of an inversion of control at the architecture level
  • In RabbitMQ the message is the contract... not the procedure. This is the right way to do it.
  • Now lets compare this to say SOAP:

  • SOAP does not give you a broker or routing so all your severs need to know about each other. I can't tell you how annoying it is to have to go plugin IP address for dev, staging, production.
  • SOAP does not provide transactions. You have to do that yourself.
  • SOAP you have to use XML
  • There are more reliable RabbitMQ clients than SOAP clients. SOAP compatibility is a PITA.
  • SOAP you have the message and the endpoint. In some cases this is a pro.
  • You don't have to use RabbitMQ to use the idea of a eventbus/messagebus. I personally would not make any sort of app with out one because going from pure synchronous RPC to a asynchronous eventbus/messagebus require lots of work. Better to do it right from the beginning.

    链接地址: http://www.djcxy.com/p/34198.html

    上一篇: 适用于.NET的AMQP V1.0客户端

    下一篇: 何时适合使用AMQP?