# Proxy either a plugin or Tomcat?

**URL:** <https://discuss.elastic.co/t/proxy-either-a-plugin-or-tomcat/6462>\
**Category:** Elasticsearch\
**Created:** [January 22, 2012, 6:38pm UTC](https://discuss.elastic.co/t/proxy-either-a-plugin-or-tomcat/6462 "2012-01-22T18:38:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Garth](https://avatars.discourse-cdn.com/v4/letter/g/ba9def/32.png) [@Garth](https://discuss.elastic.co/u/Garth)\
**Post date:** [January 22, 2012, 6:38pm UTC](https://discuss.elastic.co/t/proxy-either-a-plugin-or-tomcat/6462/1 "2012-01-22T18:38:39Z")

</div>

I am unable to reply to my original thread with the question below :  
[https://groups.google.com/group/elasticsearch/browse\_thread/thread/f8832b5e715e5ab8/f6d8eb566078272f?lnk=gst&q=Garth#f6d8eb566078272f](https://groups.google.com/group/elasticsearch/browse_thread/thread/f8832b5e715e5ab8/f6d8eb566078272f?lnk=gst&q=Garth#f6d8eb566078272f)

I started down the path of standing up a proxy in Tomcat to intercept  
the query, modify it and pass it off to ES. I am getting direction to  
make an ES plugin instead of using Tomcat. I don't know enough to  
counter  
this as good/bad since my focus is building the support code to do the  
mods to the query. Will an ES plugin support receiving a query, mung  
it  
and pass it to ES via the REST Plugin-API? Any suggestions?

---

<div class="post-metadata">

**Author:** ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)\
**Post date:** [January 22, 2012, 7:41pm UTC](https://discuss.elastic.co/t/proxy-either-a-plugin-or-tomcat/6462/2 "2012-01-22T19:41:36Z")

</div>

Hi,

just out of curiosity, why do you not want to use proxy approach?

May be you can try to elaborate more about your input and what kind of  
transformation you need to process on it prior to sending a query to ES.  
Personally, I implemented proxy in Tomcat that receives some simple input  
(URL parameters) and based on it it construct specific ES query using  
Transport client Java API. Works quite good.

Regards,  
Lukas

On Sun, Jan 22, 2012 at 7:38 PM, Garth [ghershfield.bah@gmail.com](mailto:ghershfield.bah@gmail.com) wrote:

> I am unable to reply to my original thread with the question below :
> 
> [https://groups.google.com/group/elasticsearch/browse\_thread/thread/f8832b5e715e5ab8/f6d8eb566078272f?lnk=gst&q=Garth#f6d8eb566078272f](https://groups.google.com/group/elasticsearch/browse_thread/thread/f8832b5e715e5ab8/f6d8eb566078272f?lnk=gst&q=Garth#f6d8eb566078272f)
> 
> I started down the path of standing up a proxy in Tomcat to intercept  
> the query, modify it and pass it off to ES. I am getting direction to  
> make an ES plugin instead of using Tomcat. I don't know enough to  
> counter  
> this as good/bad since my focus is building the support code to do the  
> mods to the query. Will an ES plugin support receiving a query, mung  
> it  
> and pass it to ES via the REST Plugin-API? Any suggestions?

---

<div class="post-metadata">

**Author:** ![Garth](https://avatars.discourse-cdn.com/v4/letter/g/ba9def/32.png) [@Garth](https://discuss.elastic.co/u/Garth)\
**Post date:** [January 23, 2012, 3:07pm UTC](https://discuss.elastic.co/t/proxy-either-a-plugin-or-tomcat/6462/3 "2012-01-23T15:07:17Z")

</div>

It's not that I do not want to use the proxy approach. Management is  
meddling. The fear being  
that Tomcat is going to slow down the overal performance. The theory  
they have is that if  
it's sitting as a plugin in ES, is that since it's so close to ES the  
latency if any would be less  
than a Tomcat proxy. As well, I have to use the REST API not the Java  
API w/n Tomcat.

On Jan 22, 2:41 pm, Lukáš Vlček [lukas.vl...@gmail.com](mailto:lukas.vl...@gmail.com) wrote:

> Hi,
> 
> just out of curiosity, why do you not want to use proxy approach?
> 
> May be you can try to elaborate more about your input and what kind of  
> transformation you need to process on it prior to sending a query to ES.  
> Personally, I implemented proxy in Tomcat that receives some simple input  
> (URL parameters) and based on it it construct specific ES query using  
> Transport client Java API. Works quite good.
> 
> Regards,  
> Lukas
> 
> On Sun, Jan 22, 2012 at 7:38 PM, Garth [ghershfield....@gmail.com](mailto:ghershfield....@gmail.com) wrote:
> 
> > I am unable to reply to my original thread with the question below :
> 
> > [https://groups.google.com/group/elasticsearch/browse\_thread/thread/f8](https://groups.google.com/group/elasticsearch/browse_thread/thread/f8)...
> 
> > I started down the path of standing up a proxy in Tomcat to intercept  
> > the query, modify it and pass it off to ES. I am getting direction to  
> > make an ES plugin instead of using Tomcat. I don't know enough to  
> > counter  
> > this as good/bad since my focus is building the support code to do the  
> > mods to the query. Will an ES plugin support receiving a query, mung  
> > it  
> > and pass it to ES via the REST Plugin-API? Any suggestions?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [January 23, 2012, 7:08pm UTC](https://discuss.elastic.co/t/proxy-either-a-plugin-or-tomcat/6462/4 "2012-01-23T19:08:45Z")

</div>

You can write a plugin that is actually a REST endpoint that munges the  
request and constructs a search request out of it. The RestSearchAction can  
be a good starting point.

On Mon, Jan 23, 2012 at 5:07 PM, Garth [ghershfield.bah@gmail.com](mailto:ghershfield.bah@gmail.com) wrote:

> It's not that I do not want to use the proxy approach. Management is  
> meddling. The fear being  
> that Tomcat is going to slow down the overal performance. The theory  
> they have is that if  
> it's sitting as a plugin in ES, is that since it's so close to ES the  
> latency if any would be less  
> than a Tomcat proxy. As well, I have to use the REST API not the Java  
> API w/n Tomcat.
> 
> On Jan 22, 2:41 pm, Lukáš Vlček [lukas.vl...@gmail.com](mailto:lukas.vl...@gmail.com) wrote:
> 
> > Hi,
> > 
> > just out of curiosity, why do you not want to use proxy approach?
> > 
> > May be you can try to elaborate more about your input and what kind of  
> > transformation you need to process on it prior to sending a query to ES.  
> > Personally, I implemented proxy in Tomcat that receives some simple input  
> > (URL parameters) and based on it it construct specific ES query using  
> > Transport client Java API. Works quite good.
> > 
> > Regards,  
> > Lukas
> > 
> > On Sun, Jan 22, 2012 at 7:38 PM, Garth [ghershfield....@gmail.com](mailto:ghershfield....@gmail.com)  
> > wrote:
> > 
> > > I am unable to reply to my original thread with the question below :
> > 
> > > [https://groups.google.com/group/elasticsearch/browse\_thread/thread/f8](https://groups.google.com/group/elasticsearch/browse_thread/thread/f8).  
> > > ..
> > 
> > > I started down the path of standing up a proxy in Tomcat to intercept  
> > > the query, modify it and pass it off to ES. I am getting direction to  
> > > make an ES plugin instead of using Tomcat. I don't know enough to  
> > > counter  
> > > this as good/bad since my focus is building the support code to do the  
> > > mods to the query. Will an ES plugin support receiving a query, mung  
> > > it  
> > > and pass it to ES via the REST Plugin-API? Any suggestions?

---

<div class="post-metadata">

**Author:** ![ramk](https://avatars.discourse-cdn.com/v4/letter/r/a87d85/32.png) [@ramk](https://discuss.elastic.co/u/ramk)\
**Post date:** [January 6, 2014, 10:03pm UTC](https://discuss.elastic.co/t/proxy-either-a-plugin-or-tomcat/6462/5 "2014-01-06T22:03:16Z")

</div>

Hi Garth,

I am curious to know if you were able to develop this plugin in? I appreciate any direction in this regard as I am trying to solve similar issue.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:58am UTC](https://discuss.elastic.co/t/proxy-either-a-plugin-or-tomcat/6462/6 "2017-07-06T01:58:10Z")

</div>


