Google Groups

Re: Advanced Configuration for es-jetty


Pulkit Singhal Apr 27, 2012 5:34 AM
Posted in group: elasticsearch-jetty
Thank you for the awesome explanation. Its a lot clearer to me now.

I suppose that sicne FilterHttpTransportModule wraps JettyHttpServerTransportModule by default, I didn't see a configuration setting for it anywhere that would setup this relationship. If I had seen a commented out version of it, I might have caught on sooner ... though I doubt it :p

On Thu, Apr 26, 2012 at 11:58 AM, imotov <imo...@gmail.com> wrote:
The http.type parameter in elasticsearch.yml defines which http transport should be used to process http requests. The default transport that comes with elasticsearch is netty. The elasticsearch-jetty plugin adds two additional options: JettyHttpServerTransportModule and FilterHttpTransportModule. 

JettyHttpServerTransportModule wraps jetty server and allows elasticsearch to use it as HttpServerTransport. As you know, the jetty server by itself doesn't know how to process any requests - it needs to be configured. By default, JettyHttpServerTransportModule configures jetty using the jetty.xml file. The supplied jetty.xml file contains the following stack of handlers:

GzipHandler (from jetty - handles gzip compression)
  RestConstraintSecurityHandler (from elasticsearch-jetty - handles authorization)
    JettyHttpServerTransportHandler (from elasticsearch-jetty - dispatches http requests to elasticsearch)

Jetty handles http requests and passes them to the top handler in the stack. Each handler processes requests and then passes them to the underlying handler. When requests reach JettyHttpServerTransportHandler, it dispatches them to elasticsearch. 

FilterHttpTransportModule wraps another HttpServerTransport. It can wrap JettyHttpServerTransportModule (that's used by default) or NettyHttpServerTransportModule. Wrapping underlying HttpServerTransport allows us to intercept http requests after they are parsed but before they are dispatched to elaticsearch, and pass them through a series of filters. FilterHttpTransportModule accepts a stack of filters defined in the sonian.elasticsearch.http.filter parameter in elasticsearch.yml file. We are using several filters in our deployment including logging filter (LoggingFilterHttpServerAdapter) that logs all http requests sent to elasticsearch.


On Thursday, April 26, 2012 8:56:37 AM UTC-4, Pulkit Singhal wrote:
@imotov - BCC'ed you since you aren't on the list yet :)

Question:
It may just be my ignorance of Jetty (though I have tried to fill the gap) but based on the REAME on github, it seems that the JettyHttpServerTransportModule is supposed to go hand in hand with JettyHttpServerTransportHandler.

But in the files provided for the advanced configuration:
config/elasticsearch.yml
config/jetty.xml
... it is the FilterHttpTransportModule (yml file)which is being configured with the JettyHttpServerTransportHandler (xml file).

Is this intended? I suppose I simply don't understand the similarities and differences between JettyHttpServerTransport and FilterHttpTransportModule ... could you elaborate? Which of these two is a subset of the other? And which one is the superset in terms of functionality and features? Is there any thing that only one of them does and the other doesn't?

Thanks!

--
You received this message because you are subscribed to the Google Groups "elasticsearch-jetty" group.
To view this discussion on the web visit https://groups.google.com/d/msg/elasticsearch-jetty/-/ZRd5ezxHYPAJ.
To post to this group, send email to elasticse...@googlegroups.com.
To unsubscribe from this group, send email to elasticsearch-jetty+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/elasticsearch-jetty?hl=en.