Hi All,
I'm wondering if it is possible to tie two Mongrel2 servers together
and pass data between their handlers using 0MQ. To do this, I thought
that the front-end server should use a handler which sent messages to
the port that the back-end server's handler was receiving on.
Basically like this:
front_end = Server(
...
hosts = [
Host(name = "...",
routes = {
"/" : Handler(
...,
send_spec = "tcp://127.0.0.1:9997",
recv_ident = "tcp://127.0.0.1:9996")
}
)
]
)
back_end = Server(
...
hosts = [
Host(name = "...",
routes = {
"/" : Handler(
...,
send_spec = "tcp://127.0.0.1:9996",
recv_spec = "tcp://127.0.0.1:9997")
}
)
]
)
This would result in a flow like this, I had hoped:
<-> [Front-end Mongrel2 server] <-> 0MQ <-> [Back-end Mongrel2 server] <->
However, when I start the second server, it can't bind to its
send_spec because the first server already grabbed it as it's
recv_spec.
So, my question are these:
1. Is there a better way to do this, in general?
2. If this is the way to do it, what details am I missing to be able
to send data between these two servers?
TIA!
--
Regards,
Travis Spencer