# Reload configuration settings of river at runtime

**URL:** <https://discuss.elastic.co/t/reload-configuration-settings-of-river-at-runtime/4880>\
**Category:** Elasticsearch\
**Created:** [July 18, 2011, 9:12am UTC](https://discuss.elastic.co/t/reload-configuration-settings-of-river-at-runtime/4880 "2011-07-18T09:12:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander\_Reelsen](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@Alexander\_Reelsen](https://discuss.elastic.co/u/Alexander_Reelsen)\
**Post date:** [July 18, 2011, 9:12am UTC](https://discuss.elastic.co/t/reload-configuration-settings-of-river-at-runtime/4880/1 "2011-07-18T09:12:57Z")

</div>

Hi there,

I am currently implementing a river, which reads product data from a  
remote system via XML export.  
While this river is running, I would like to be able to configure in  
which index the river is indexing in at runtime.

So when changing the "\_river" index settings, they should be reflected  
in my river.

When using a constructor like the one used in couchdb:

@Inject public MyRiver(RiverName riverName, RiverSettings settings,  
@RiverIndexName String riverIndexName, Client client, ScriptService  
scriptService) { }

the settings are not updated, after the configuration is changed on  
runtime?

Should I do this programmatically every time my indexer thread is  
running or is this possible with the help of an annotation?

Thanks for helping!

--Alexander

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [July 18, 2011, 10:07am UTC](https://discuss.elastic.co/t/reload-configuration-settings-of-river-at-runtime/4880/2 "2011-07-18T10:07:22Z")

</div>

Hi Alexander

> I am currently implementing a river, which reads product data from a  
> remote system via XML export.  
> While this river is running, I would like to be able to configure in  
> which index the river is indexing in at runtime.
> 
> So when changing the "\_river" index settings, they should be reflected  
> in my river.

I don't know the answer to your question, but an easier approach would  
be to use aliases.

For example, you set your river to index to 'my\_index'. However  
'my\_index' is actually an alias which points to the real index  
'my\_index\_2011'.

Now, when you want to write to 'my\_index\_2011' instead, all you have to  
do is create the index 'my\_index\_2011' and update the 'my\_index' alias  
to point to that one instead.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

clint

---

<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:** [July 18, 2011, 5:30pm UTC](https://discuss.elastic.co/t/reload-configuration-settings-of-river-at-runtime/4880/3 "2011-07-18T17:30:25Z")

</div>

There is no built in support for refreshing river settings, but at the end,  
they are just documents in the index. You can periodically check for it in  
your river.

On Mon, Jul 18, 2011 at 12:12 PM, Alexander Reelsen \<  
[alexander.reelsen@googlemail.com](mailto:alexander.reelsen@googlemail.com)\> wrote:

> Hi there,
> 
> I am currently implementing a river, which reads product data from a  
> remote system via XML export.  
> While this river is running, I would like to be able to configure in  
> which index the river is indexing in at runtime.
> 
> So when changing the "\_river" index settings, they should be reflected  
> in my river.
> 
> When using a constructor like the one used in couchdb:
> 
> @Inject public MyRiver(RiverName riverName, RiverSettings settings,  
> @RiverIndexName String riverIndexName, Client client, ScriptService  
> scriptService) { }
> 
> the settings are not updated, after the configuration is changed on  
> runtime?
> 
> Should I do this programmatically every time my indexer thread is  
> running or is this possible with the help of an annotation?
> 
> Thanks for helping!
> 
> --Alexander

---

<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:00am UTC](https://discuss.elastic.co/t/reload-configuration-settings-of-river-at-runtime/4880/4 "2017-07-06T04:00:17Z")

</div>


