开发者

Messaging system design

开发者 https://www.devze.com 2023-03-16 18:59 出处:网络
I am looking for a way to send requests and receive call backs from another party. The only gotcha i开发者_JS百科s that we do not now how it will be designed/deployed on the receiver side.

I am looking for a way to send requests and receive call backs from another party.

The only gotcha i开发者_JS百科s that we do not now how it will be designed/deployed on the receiver side.

We do have the text/JSON based messages defined and agreed upon.

Looked at RabbitMQ and others, but each requires a server that would need to be maintained.

Thanks,


RabbitMQ is pretty easy to maintain. You would use two queues, one for requests and the other for replies. Use the AMQP correlation_id header to tag requests and replies so that when a reply message is received it can be matched with the orginal request.

However, if a broker is not for you, then use ZeroMQ. It is a client library available for a dozen or more languages and it enforces messaging patterns over top of sockets. This means that your app does not have to do all the low level socket management. Instead you declare the socket as REQ/REP and ZeroMQ handles all the rest. You just send messages in any format you desire, and you get messages back.

I've used ZeroMQ to implement a memcache style application in Python using REQ/REP.


@user821692: You have to agree not only message format but also destination/transport protocol. For e.g. if both communicating parties has access to same queue physically located anywhere, then they can communicate pre-defined messages. You may also look of sending messages over HTTP..

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号