Welcome! Log In Create A New Profile

Advanced

Re: nginx module dev: loadbalancer vs upstream handler options

Maxim Dounin
March 13, 2014 12:24PM
Hello!

On Wed, Mar 12, 2014 at 12:31:42PM -0700, Jayadev C wrote:

>
>
> First time here, was looking at supporting http protocol (using
> nginx) over our custom zeromq server talking protocol buf. Read
> the excelled tutorial by Evan and was also looking at few
> similar plugins to get an idea.
>
> One confusion I have is, I see some plugins like memcache/redis
> ones where the http request and response parsing is done by
> upstream handler modules, while I also see some modules like
> https://github.com/chaoslawful/drizzle-nginx-module where the
> request/response handling is done by peer.init_upstream class of
> functions.  My typical flow would : parse http request ->
> convert to protobuf request object -> send to zmq server ->
> {nginx event notification} -> convert protobuf response back to
> http response -> respond to client.
>
> I can imagine doing all the request/response handling during
> connection send/receive part or by registering
> create_request,process_header , filter hooks. Is there any
> guideline on which is the right approach. (I have seen
> https://github.com/FRiCKLE/ngx_zeromq , not exactly what I want)
>

The peer.init_upstream callback is to initialize balancing
metadata, not to implement any protocol-related details.

Correct approach to implement your own protocol on top of the
upstream module is to use create_request/process_header/etc
callbacks.

--
Maxim Dounin
http://nginx.org/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx module dev: loadbalancer vs upstream handler options

Jayadev C March 12, 2014 03:36PM

Re: nginx module dev: loadbalancer vs upstream handler options

Maxim Dounin March 13, 2014 12:24PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 163
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready