# How to implement RabbitMQ River using java?

**URL:** <https://discuss.elastic.co/t/how-to-implement-rabbitmq-river-using-java/3683>\
**Category:** Elasticsearch\
**Created:** [December 21, 2010, 6:53am UTC](https://discuss.elastic.co/t/how-to-implement-rabbitmq-river-using-java/3683 "2010-12-21T06:53:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_4](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@Sam\_4](https://discuss.elastic.co/u/Sam_4)\
**Post date:** [December 21, 2010, 6:53am UTC](https://discuss.elastic.co/t/how-to-implement-rabbitmq-river-using-java/3683/1 "2010-12-21T06:53:47Z")

</div>

Hi

How to implement RabbitMQ River using Java?please provide detail  
information ,what are the configuration required to use Rabbitmq in  
elastic search.

Thanks

---

<div class="post-metadata">

**Author:** ![Rich\_Kroll](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rich_kroll/32/3229_2.png) [@Rich\_Kroll](https://discuss.elastic.co/u/Rich_Kroll)\
**Post date:** [December 21, 2010, 3:04pm UTC](https://discuss.elastic.co/t/how-to-implement-rabbitmq-river-using-java/3683/2 "2010-12-21T15:04:08Z")

</div>

Start the most recent version of rabbitmq, then follow the ES docs at  
[http://www.elasticsearch.com/docs/elasticsearch/river/rabbitmq/](http://www.elasticsearch.com/docs/elasticsearch/river/rabbitmq/) to create  
the river. The queue/exchange will be created by rabbit automatically when  
you start ES.

Regards,  
Rich

On Tue, Dec 21, 2010 at 1:53 AM, sam [mishra.sameek@gmail.com](mailto:mishra.sameek@gmail.com) wrote:

> Hi
> 
> How to implement RabbitMQ River using Java?please provide detail  
> information ,what are the configuration required to use Rabbitmq in  
> Elasticsearch.
> 
> Thanks

--  
“We can't solve problems by using the same kind of thinking we used when we  
created them.” ~ Albert Einstein

---

<div class="post-metadata">

**Author:** ![Sam\_4](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@Sam\_4](https://discuss.elastic.co/u/Sam_4)\
**Post date:** [December 22, 2010, 10:15am UTC](https://discuss.elastic.co/t/how-to-implement-rabbitmq-river-using-java/3683/3 "2010-12-22T10:15:00Z")

</div>

thanks for reply.

I am putting message on queue and also install Rabbitmq river  
plugin .if i am correct this plugin is used to read queue and index.  
my question is how i am able to used this plugin in my code and what  
are the configuration is require to read queue and index using Java.

Thanks

On Dec 21, 8:04 pm, Rich Kroll [kroll.r...@gmail.com](mailto:kroll.r...@gmail.com) wrote:

> Start the most recent version of rabbitmq, then follow the ES docs athttp://www.elasticsearch.com/docs/elasticsearch/river/rabbitmq/to create  
> the river. The queue/exchange will be created by rabbit automatically when  
> you start ES.
> 
> Regards,  
> Rich
> 
> On Tue, Dec 21, 2010 at 1:53 AM, sam [mishra.sam...@gmail.com](mailto:mishra.sam...@gmail.com) wrote:
> 
> > Hi
> 
> > How to implement RabbitMQ River using Java?please provide detail  
> > information ,what are the configuration required to use Rabbitmq in  
> > Elasticsearch.
> 
> > Thanks
> 
> --  
> “We can't solve problems by using the same kind of thinking we used when we  
> created them.” ~ Albert Einstein

---

<div class="post-metadata">

**Author:** ![Rich\_Kroll](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rich_kroll/32/3229_2.png) [@Rich\_Kroll](https://discuss.elastic.co/u/Rich_Kroll)\
**Post date:** [December 22, 2010, 12:27pm UTC](https://discuss.elastic.co/t/how-to-implement-rabbitmq-river-using-java/3683/4 "2010-12-22T12:27:50Z")

</div>

Please see the RabbitMQ river documentation for the configuration of the  
river: [http://www.elasticsearch.com/docs/elasticsearch/river/rabbitmq/](http://www.elasticsearch.com/docs/elasticsearch/river/rabbitmq/)

To "use" the plugin, you need to place a bulk index formatted message onto  
the configured queue, then ES will read the message off the queue and index  
it.

On Wed, Dec 22, 2010 at 5:15 AM, sam [mishra.sameek@gmail.com](mailto:mishra.sameek@gmail.com) wrote:

> thanks for reply.
> 
> I am putting message on queue and also install Rabbitmq river  
> plugin .if i am correct this plugin is used to read queue and index.  
> my question is how i am able to used this plugin in my code and what  
> are the configuration is require to read queue and index using Java.
> 
> Thanks
> 
> On Dec 21, 8:04 pm, Rich Kroll [kroll.r...@gmail.com](mailto:kroll.r...@gmail.com) wrote:
> 
> > Start the most recent version of rabbitmq, then follow the ES docs  
> > athttp://www.elasticsearch.com/docs/elasticsearch/river/rabbitmq/to create  
> > the river. The queue/exchange will be created by rabbit automatically  
> > when  
> > you start ES.
> > 
> > Regards,  
> > Rich
> > 
> > On Tue, Dec 21, 2010 at 1:53 AM, sam [mishra.sam...@gmail.com](mailto:mishra.sam...@gmail.com) wrote:
> > 
> > > Hi
> > 
> > > How to implement RabbitMQ River using Java?please provide detail  
> > > information ,what are the configuration required to use Rabbitmq in  
> > > Elasticsearch.
> > 
> > > Thanks
> > 
> > --  
> > “We can't solve problems by using the same kind of thinking we used when  
> > we  
> > created them.” ~ Albert Einstein

--  
“We can't solve problems by using the same kind of thinking we used when we  
created them.” ~ Albert Einstein

---

<div class="post-metadata">

**Author:** ![Sam\_4](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@Sam\_4](https://discuss.elastic.co/u/Sam_4)\
**Post date:** [December 24, 2010, 7:31am UTC](https://discuss.elastic.co/t/how-to-implement-rabbitmq-river-using-java/3683/5 "2010-12-24T07:31:08Z")

</div>

I am putting the message in the queue in has following format:

{"id":"first","keyword":"pointing"}  
{"id":"second","keyword":"michael"}

Is the above format is correct?

I am instantiating the object of RabbitmqRiver,that required three  
arguments:

RabbitmqRiver(RiverName riverName, RiverSettings settings, Client  
client)

Code snippet for the object creation is as follows:

org.elasticsearch.common.settings.Settings settings =  
ImmutableSettings.settingsBuilder().build();  
java.util.Map \<String,Object\>map=new HashMap();

org.elasticsearch.river.RiverSettings setting=new  
org.elasticsearch.river.RiverSettings (settings ,map);  
setting.settings();  
org.elasticsearch.river.RiverName riverName= new  
RiverName("\_rivertype","rabbitmqriver");

RabbitmqRiver rabbitmqRiver = new  
RabbitmqRiver(riverName,setting,client);  
rabbitmqRiver.start();

But its not working.  
Am i following the correct approach?

On Dec 22, 5:27 pm, Rich Kroll [kroll.r...@gmail.com](mailto:kroll.r...@gmail.com) wrote:

> Please see the RabbitMQ river documentation for the configuration of the  
> river:[http://www.elasticsearch.com/docs/elasticsearch/river/rabbitmq/](http://www.elasticsearch.com/docs/elasticsearch/river/rabbitmq/)
> 
> To "use" the plugin, you need to place a bulk index formatted message onto  
> the configured queue, then ES will read the message off the queue and index  
> it.
> 
> On Wed, Dec 22, 2010 at 5:15 AM, sam [mishra.sam...@gmail.com](mailto:mishra.sam...@gmail.com) wrote:
> 
> > thanks for reply.
> 
> > I am putting message on queue and also install Rabbitmq river  
> > plugin .if i am correct this plugin is used to read queue and index.  
> > my question is how i am able to used this plugin in my code and what  
> > are the configuration is require to read queue and index using Java.
> 
> > Thanks
> 
> > On Dec 21, 8:04 pm, Rich Kroll [kroll.r...@gmail.com](mailto:kroll.r...@gmail.com) wrote:
> > 
> > > Start the most recent version of rabbitmq, then follow the ES docs  
> > > athttp://www.elasticsearch.com/docs/elasticsearch/river/rabbitmq/tocreate  
> > > the river. The queue/exchange will be created by rabbit automatically  
> > > when  
> > > you start ES.
> 
> > > Regards,  
> > > Rich
> 
> > > On Tue, Dec 21, 2010 at 1:53 AM, sam [mishra.sam...@gmail.com](mailto:mishra.sam...@gmail.com) wrote:
> > > 
> > > > Hi
> 
> > > > How to implement RabbitMQ River using Java?please provide detail  
> > > > information ,what are the configuration required to use Rabbitmq in  
> > > > Elasticsearch.
> 
> > > > Thanks
> 
> > > --  
> > > “We can't solve problems by using the same kind of thinking we used when  
> > > we  
> > > created them.” ~ Albert Einstein
> 
> --  
> “We can't solve problems by using the same kind of thinking we used when we  
> created them.” ~ Albert Einstein

---

<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, 4:14am UTC](https://discuss.elastic.co/t/how-to-implement-rabbitmq-river-using-java/3683/6 "2017-07-06T04:14:49Z")

</div>


