Modifying enabled property through config server is not working (HS 6 Beta 11)

I expect that synchronization work no longer after modified true to false through config-server.

When i refresh using actuator refresh api, printed log like below

o.h.s.e.b.o.spi.BatchingExecutor         : HSEARCH000231: Stopping executor 'Elasticsearch indexing orchestrator for index ...

but synchronization still working

I only added @RefreshScope annotation EntityManagerFactory build method.
Should i other object using refresh except EntityManagerFactory ?

Generally speaking, Hibernate Search configuration properties are only taken into account at boot time. I don’t know what your actuator API does exactly, but unless it restarts Hibernate ORM (and Search) completely, changing the value of won’t have any effect.

In short, yes, rebuilding the EntityManagerFactory with a different value for property will disable automatic indexing. But you need to rebuild it.

At the moment, there isn’t any way to disable automatic indexing without restarting Hibernate Search, though we will work on that eventually (HSEARCH-1383).

As to how to use @RefreshScope… I can imagine that restarting the JPA support requires specific handling, but to be honest I really do not know. This is a Spring-specific feature. You may have more luck asking around in Spring-specific forums, or on Stackoverflow with a spring tag?

1 Like