tags:

views:

132

answers:

3

Hi everyone. I need to set up a protocol for fast command/response interactions. My instinct tells me to just knock together a simple protocol with CRLF separated ascii strings like how SMTP or POP3 works, and tunnel it through SSH/SSL if I need it to be secured.

While I could just do this, I'd prefer to build on an existing technology so people could use a friendly library rather than the socket library interface the OS gives them.

I need...

  • Commands and responses passing structured data back and forth. (XML, S expressions, don't care.)
  • The ability for the server to make unscheduled notifications to the client without being polled.

Any ideas please?

+1  A: 

AMQP sounds promising. Alternatively, I think XMPP supports much of what you want, though with quite a bit of overhead.

That said, depending on what you're trying to accomplish, a simple ad hoc protocol might be easier.

Ben Hughes
I'm accepting this answer because I'm going for "ad hoc protocol" as the various suggestions don't really suit my application.
billpg
+1  A: 

How about something like SNMP? I'm not sure if it fits exactly with the model your app uses, but it supports both async notify and pull (i.e., TRAP and GET).

Adam Lewis
+1  A: 

If you just want request/reply, HTTP is very simple. It's already a request/response protocol. The client and server side are widely implemented in most languages. Scaling it up is well understood.

The easiest way to use it is to send commands to the server as POST requests and for the server to send back the reply in the body of the response. You could also extend HTTP with your own verbs, but that would make it more work to take advantage of caching proxies and other infrastructure that understands HTTP.

If you want async notifications, then look at pub/sub protocols (Spread, XMPP, AMQP, JMS implementations or commercial pub/sub message brokers like TibcoRV, Tibco EMS or Websphere MQ). The protocol or implementation to pick depends on the reliability, latency and throughput needs of the system you're building. For example, is it ok for notifications to be dropped when the network is congested? What happens to notifications when a client is off-line -- do they get discarded or queued up for when the client reconnects.

Nat