availability RabbitMQ server pair via WCF

I'm trying to figure out what is the best solution to work with rabbitmq cluster via wcf.

Current setup:

  • 2 IIS web servers (act as message produces and post messages to queue via amqp wcf client).
  • 2 servers with rabbitmq broker (clustered with mirrored queue, rabbit1 and rabbit2)
  • Windows service ( worker) with hosted amqp wcf service that listens to incoming messages.
  • Web role posts messages to rabbit1 node and worker listens to rabbit1 node too. If rabbit1 node fails system(both web and worker) should switch to rabbit2. And that's the question, how to implement this in more elegant way rather than handling connection failures in application code.

    First and the only approach I see now is to use wcf4 routing backup endpoints feature. This way solves problem on client side(web role) only but doesn't solve problem on wcf service side(worker role).


    One way is to create a wrapper around your service host, used for storing a list of connection strings (which can come from config).

    Add a handler to the service faulted event, where you can close and reopen the host with a different connection string.

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

    上一篇: 在PHP中使用进程分叉的Rabbitmq队列

    下一篇: 通过WCF提供RabbitMQ服务器对