# Rest plugin sending request to master node

**URL:** <https://discuss.elastic.co/t/rest-plugin-sending-request-to-master-node/12505>\
**Category:** Elasticsearch\
**Created:** [June 21, 2013, 8:23am UTC](https://discuss.elastic.co/t/rest-plugin-sending-request-to-master-node/12505 "2013-06-21T08:23:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marc](https://avatars.discourse-cdn.com/v4/letter/m/8dc957/32.png) [@Marc](https://discuss.elastic.co/u/Marc)\
**Post date:** [June 21, 2013, 8:23am UTC](https://discuss.elastic.co/t/rest-plugin-sending-request-to-master-node/12505/1 "2013-06-21T08:23:23Z")

</div>

Hi,  
I would like to know if there is any Java API or code to dispatch/route a  
(REST)request coming on a generic node to the active master node.

I have a REST plugin getting the requests in different cluster nodes, but  
I'd like to dispatch all the requests to the master node if exists and  
having only the master node processing and answering them. Is this feasible  
within an elasticsearch plugin?  
Thanks  
kind regards  
Marc

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [June 24, 2013, 2:41pm UTC](https://discuss.elastic.co/t/rest-plugin-sending-request-to-master-node/12505/2 "2013-06-24T14:41:47Z")

</div>

Hey,

You accept the REST request on any node, and create a subclass of a  
MasterNodeOperationRequest in your rest handler, which is then  
automatically send only to the master.  
Hope this helps for a start.

If this is feasible highly depends on your usecase, if it makes send to  
have this additional roundtrip and overloading on your master node...

--Alex

On Fri, Jun 21, 2013 at 10:23 AM, Marc [ciarcia.marco@gmail.com](mailto:ciarcia.marco@gmail.com) wrote:

> Hi,  
> I would like to know if there is any Java API or code to dispatch/route a  
> (REST)request coming on a generic node to the active master node.
> 
> I have a REST plugin getting the requests in different cluster nodes, but  
> I'd like to dispatch all the requests to the master node if exists and  
> having only the master node processing and answering them. Is this feasible  
> within an elasticsearch plugin?  
> Thanks  
> kind regards  
> Marc
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:29am UTC](https://discuss.elastic.co/t/rest-plugin-sending-request-to-master-node/12505/3 "2017-07-06T02:29:44Z")

</div>


