Hi,  I did something similar during work (we are using Clojure)

   1. Use HTTP as the transport:  browser ajax call,  mobile API call, 
   intertal use
   2. JSON as encoding.  Javascript support it natively, mobile can decode 
   it easily,  Clojure has very good support for it

Clojure can decode and encode json*[1]* very efficiently.  Nginx can be 
configured to zip the data to save bandwidth.  http-kit*[2]* to do http 
very efficiently.
Compojure[3] can be used to define the mapping cleanly.  

One API, used everywhere.

I am currently writing a lein new template plugin, to setup the config 
automatically, kills boilerplate, I expect it to be ready in the next few 
days.

[1]  https://github.com/clojure/data.json
[2]  http://http-kit.org
[3]  https://github.com/weavejester/compojure





On Saturday, February 9, 2013 9:54:54 AM UTC+8, Mikera wrote:
>
> Hi All,
>
> I'm looking for a library (or set of libraries that can easily be 
> composed) that lets me do the following:
>
>  - Define an API in terms of messages 
>  - Maintain a mapping between these messages and specific data types (some 
> Java classes, Clojure data structures etc.)
>  - Also maintain a mapping between the API and handler functions that get 
> called in response to receiving a message
>  - Expose the API as a general purpose REST API for the web
>  - Also expose the same API using some form of efficient binary 
> serialisation for RPC usage
>
> FWIW, the objective is make the same API available to both external users 
> and internally within a cluster, without duplicating code but also without 
> adding substantial messaging overhead to internal cluster usage.
>
> What would be the best tools / approach in the Clojure ecosystem at the 
> moment for doing something like this?
>
>   Mike.
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to