On 04/14/2014 03:36 AM, Laurent Alebarde wrote:
If my understanding is correct, Mongrel2 strength reveals in stateless architectures, where many workers are transparently connected to the Mongrel2 server which dispatch the jobs with a 0MQ push/pull.

In my use case, I make use of the CURVE security mechanism, so I need to have a sticky connection between clients and workers because of the security protocol and keys exchanges. In other words, when a new client comes, I have to assign it a worker, and keep sending messages from this client always to this assigned worker, until the connection is finished.

Can I do that with Mongrel2 please ? Or am I obliged to send all the messages to an intermediate broker that perform the client/worker pairing ?

As an alternative, I could put all the connections states, including keys, in a database shared by all the workers, in order to stay stateless, but I would have to redesign everything and I think performances would be worse. So I exclude this solution.

Hi Laurent,

Correct, you cannot choose the handler to receive a request. Requests are always dispatched arbitrarily based on 0MQ PUSH socket behavior. If you want different behavior, you could make an adapter worker that uses PULL to receive requests and then something else (ROUTER?) to send to specific handlers.

Justin

Reply via email to