# Is it possible to change Rabbitmq River Default configuration?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-change-rabbitmq-river-default-configuration/6065>\
**Category:** Elasticsearch\
**Created:** [December 5, 2011, 7:53am UTC](https://discuss.elastic.co/t/is-it-possible-to-change-rabbitmq-river-default-configuration/6065 "2011-12-05T07:53:20Z")\
**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 5, 2011, 7:53am UTC](https://discuss.elastic.co/t/is-it-possible-to-change-rabbitmq-river-default-configuration/6065/1 "2011-12-05T07:53:20Z")

</div>

Hi

For creating the rabbitmq river is as simple as (all configuration  
parameters are provided, with default values)  
[http://www.elasticsearch.org/guide/reference/river/rabbitmq.html](http://www.elasticsearch.org/guide/reference/river/rabbitmq.html) but  
in my case, I want to use Rabbitmq server which is running on another  
machine,so using default configuration it is not possible,i need to  
change the host in provided configuration.if it possible then please  
help me how to convert curl configuration in form of java code and  
which place put this configuration.

curl -XPUT 'localhost:9200/\_river/my\_river/\_meta' -d '{  
"type" : "rabbitmq",  
"rabbitmq" : {  
"host" : "localhost",  
"port" : 5672,  
"user" : "guest",  
"pass" : "guest",  
"vhost" : "/",  
"queue" : "elasticsearch",  
"exchange" : "elasticsearch",  
"routing\_key" : "elasticsearch",  
"exchange\_type" : "direct",  
"exchange\_durable" : true,  
"queue\_durable" : true,  
"queue\_auto\_delete" : false  
},  
"index" : {  
"bulk\_size" : 100,  
"bulk\_timeout" : "10ms",  
"ordered" : false  
}  
}'

---

<div class="post-metadata">

**Author:** ![Damien\_Hardy](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@Damien\_Hardy](https://discuss.elastic.co/u/Damien_Hardy)\
**Post date:** [December 5, 2011, 9:11am UTC](https://discuss.elastic.co/t/is-it-possible-to-change-rabbitmq-river-default-configuration/6065/2 "2011-12-05T09:11:53Z")

</div>

Hello,

If I understand well, you just have to change the "host" fields to set the  
name or IP of the host where is running RabbitMQ  
And exchange and queue fields have to be the same than the producer(s) ones  
(i.e. : same conf for creation from the both side of the message queue).

Cheers,

--  
Damien

2011/12/5 sam [mishra.sameek@gmail.com](mailto:mishra.sameek@gmail.com)

> Hi
> 
> For creating the rabbitmq river is as simple as (all configuration  
> parameters are provided, with default values)  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/river/rabbitmq.html) but  
> in my case, I want to use Rabbitmq server which is running on another  
> machine,so using default configuration it is not possible,i need to  
> change the host in provided configuration.if it possible then please  
> help me how to convert curl configuration in form of java code and  
> which place put this configuration.
> 
> curl -XPUT 'localhost:9200/\_river/my\_river/\_meta' -d '{  
> "type" : "rabbitmq",  
> "rabbitmq" : {  
> "host" : "localhost",  
> "port" : 5672,  
> "user" : "guest",  
> "pass" : "guest",  
> "vhost" : "/",  
> "queue" : "elasticsearch",  
> "exchange" : "elasticsearch",  
> "routing\_key" : "elasticsearch",  
> "exchange\_type" : "direct",  
> "exchange\_durable" : true,  
> "queue\_durable" : true,  
> "queue\_auto\_delete" : false  
> },  
> "index" : {  
> "bulk\_size" : 100,  
> "bulk\_timeout" : "10ms",  
> "ordered" : false  
> }  
> }'

---

<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 5, 2011, 9:57am UTC](https://discuss.elastic.co/t/is-it-possible-to-change-rabbitmq-river-default-configuration/6065/3 "2011-12-05T09:57:00Z")

</div>

Thanks for reply.I have used following settings:

Map rabbitmqSettings = new HashMap();  
rabbitmqSettings.put("host", "192.168.1.47");  
rabbitmqSettings.put("port", 5672);  
rabbitmqSettings.put("user", "guest");  
rabbitmqSettings.put("pass", "guest");  
rabbitmqSettings.put("vhost", "/");  
rabbitmqSettings.put("queue", "river");  
rabbitmqSettings.put("exchange", "river");  
rabbitmqSettings.put("routing\_key", "river");  
rabbitmqSettings.put("exchange\_type", "direct");  
rabbitmqSettings.put("exchange\_durable", true);  
rabbitmqSettings.put("queue\_durable", true);  
rabbitmqSettings.put("queue\_auto\_delete", false);

```
    Map indexSettings = new HashMap();
    indexSettings.put("bulk_size", 100);
    indexSettings.put("bulk_timeout", "10ms");
    indexSettings.put("ordered", "false");

    client.prepareIndex("_river", "test1",

```

"\_meta").setSource(jsonBuilder().startObject().field("type",  
"rabbitmq").field("rabbitmq", rabbitmqSettings).field("index",  
indexSettings).endObject()).execute().actionGet();

Is it is correct.here i have assign the host IP address and also  
change the queue,exchange and routing key where message publish and ES  
read messages and index it.

On Dec 5, 2:11 pm, Damien Hardy [damienhardy....@gmail.com](mailto:damienhardy....@gmail.com) wrote:

> Hello,
> 
> If I understand well, you just have to change the "host" fields to set the  
> name or IP of the host where is running RabbitMQ  
> And exchange and queue fields have to be the same than the producer(s) ones  
> (i.e. : same conf for creation from the both side of the message queue).
> 
> Cheers,
> 
> --  
> Damien
> 
> 2011/12/5 sam [mishra.sam...@gmail.com](mailto:mishra.sam...@gmail.com)
> 
> > Hi
> 
> > For creating the rabbitmq river is as simple as (all configuration  
> > parameters are provided, with default values)  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/river/rabbitmq.html) but  
> > in my case, I want to use Rabbitmq server which is running on another  
> > machine,so using default configuration it is not possible,i need to  
> > change the host in provided configuration.if it possible then please  
> > help me how to convert curl configuration in form of java code and  
> > which place put this configuration.
> 
> > curl -XPUT 'localhost:9200/\_river/my\_river/\_meta' -d '{  
> > "type" : "rabbitmq",  
> > "rabbitmq" : {  
> > "host" : "localhost",  
> > "port" : 5672,  
> > "user" : "guest",  
> > "pass" : "guest",  
> > "vhost" : "/",  
> > "queue" : "elasticsearch",  
> > "exchange" : "elasticsearch",  
> > "routing\_key" : "elasticsearch",  
> > "exchange\_type" : "direct",  
> > "exchange\_durable" : true,  
> > "queue\_durable" : true,  
> > "queue\_auto\_delete" : false  
> > },  
> > "index" : {  
> > "bulk\_size" : 100,  
> > "bulk\_timeout" : "10ms",  
> > "ordered" : false  
> > }  
> > }'

---

<div class="post-metadata">

**Author:** ![Damien\_Hardy](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@Damien\_Hardy](https://discuss.elastic.co/u/Damien_Hardy)\
**Post date:** [December 5, 2011, 1:25pm UTC](https://discuss.elastic.co/t/is-it-possible-to-change-rabbitmq-river-default-configuration/6065/4 "2011-12-05T13:25:34Z")

</div>

Just try it and look at the logs (in elasticsearch) and on the rabbitmq web  
interface to see if it conplains :

By analogy with mine the queue should be visible at :  
[http://guest:guest@192.168.1.47:55672/#/queues/%2F/river](http://guest:guest@192.168.1.47:55672/#/queues/%2F/river)

You then should see if it's consumed or not. 🙂

Cheers,

--  
Damien

---

<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 9, 2011, 7:25am UTC](https://discuss.elastic.co/t/is-it-possible-to-change-rabbitmq-river-default-configuration/6065/5 "2011-12-09T07:25:16Z")

</div>

it's wroking and creates index.

On Mon, Dec 5, 2011 at 6:55 PM, Damien Hardy [damienhardy.bal@gmail.com](mailto:damienhardy.bal@gmail.com)wrote:

> Just try it and look at the logs (in elasticsearch) and on the rabbitmq  
> web interface to see if it conplains :
> 
> By analogy with mine the queue should be visible at :  
> [http://guest:guest@192.168.1.47:55672/#/queues/%2F/river](http://guest:guest@192.168.1.47:55672/#/queues/%2F/river)
> 
> You then should see if it's consumed or not. 🙂
> 
> Cheers,
> 
> --  
> Damien

---

<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, 3:45am UTC](https://discuss.elastic.co/t/is-it-possible-to-change-rabbitmq-river-default-configuration/6065/6 "2017-07-06T03:45:59Z")

</div>


