[zeromq-dev] Devices and config files
gonzalo diethelm
gdiethelm at dcv.cl
Sat Aug 21 00:28:03 CEST 2010
> > OK, have parsing of JSON config files working, it's pretty neat.
> > cJSON is not pretty code but the API is clean and it's been easy to
> > use...
>
> And a working device that is fully configurable:
>
> http://github.com/imatix/zfl/tree/develop/examples
>
> The JSON looks kind of like this:
>
> {
> "verbose": true,
> "type": "forwarder",
> "iothreads": 2,
> "frontend": {
> "option": {
> "hwm": 1000,
> "subscribe": [ "coffee", "tea", "juice" ],
> "subscribe": "milk"
> },
> "connect": [ "tcp://eth0:5556", "inproc://mydevice" ],
> },
> "backend": {
> "bind": "tcp://eth0:5556"
> }
> }
This is really nice, and I will use it for sure. Questions / comments:
1. How will one use this from other languages (Python, Java, etc.)?
2. I would love to be able to have a configuration file where I can put
together the whole network architecture of my distributed application.
Say I have three nodes (programs): one PUBlishing messages on an
endpoint; one SUBscribing to those messages and accepting REQuests for
information; and one sending those requests. I would like to be able to
specify this configuration in a file like what you have posted (I am
making the syntax up, I am not familiar enough with JSON):
endpoint panel tcp://192.168.11.5:5432;
endpoint query tcp://192.168.11.5:8765;
node publisher (socket PUB panel);
node subscriber (socket SUB panel; socket REP query);
node trader (socket REQ query);
What I am talking about is specifying endpoints in a single place,
giving them a name, and then specifying the composition of sockets for
each process. Then, when I instantiate a process, I simply say "this is
process 'trader'" and it will read the configuration from this file.
It would be AWESOME if we could accommodate this type of configuration
in a way that's amenable to be used from any 0MQ binding. It would be
even better if I could create standard 0MQ devices using something like
this.
Thanks and regards.
--
Gonzalo Diethelm
More information about the zeromq-dev
mailing list