spring boot - Hibernate search backend elastic search with multiple data bases - Stack Overflow
I’m working on a microservice architecture that utilizes Hibernate Search with an Elasticsearch backend. Only the local entity is indexed.
Here’s the relevant configuration from my application YAML file:
spring:
autoconfigure:
exclude: org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration
application:
name: virtualDealRoom-service
jpa:
open-in-view: false
generate-ddl: true
properties:
hibernate:
dialect: org.hibernate.dialect.PostgreSQLDialect
search:
backend:
analysis:
configurer: com.afreximbank.canex.virtualDealRoom.service.config.search.AnalysisConfigurer
uris:
username: ${ELASTIC_USERNAME:elastic}
password: ${ELASTIC_PASSWORD:elastic}
type: elasticsearch
I’m encountering an error when running the application. It seems to be trying to connect to Elasticsearch at “http://localhost:9200” and failing with a connection refused error. Here’s the error message:
2025-01-04 09:03:41 2025-01-04T06:03:41.414Z DEBUG 1 --- [virtualDealRoom-service] [port thread - 0] [ ] org.elasticsearch.client.RestClient : request [GET http://localhost:9200/] failed
2025-01-04 09:03:41
2025-01-04 09:03:41 java.ConnectException: Connection refused
2025-01-04 09:03:41 at java.base/sun.nio.ch.Net.pollConnect(Native Method) ~[na:na]
2025-01-04 09:03:41 at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:682) ~[na:na]
2025-01-04 09:03:41 at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:973) ~[na:na]
2025-01-04 09:03:41 at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:174) ~[httpcore-nio-4.4.16.jar:4.4.16]
2025-01-04 09:03:41 at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:148) ~[httpcore-nio-4.4.16.jar:4.4.16]
2025-01-04 09:03:41 at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:351) ~[httpcore-nio-4.4.16.jar:4.4.16]
2025-01-04 09:03:41 at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:221) ~[httpasyncclient-4.1.5.jar:4.1.5]
2025-01-04 09:03:41 at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64) ~[httpasyncclient-4.1.5.jar:4.1.5]
2025-01-04 09:03:41 at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na]
2025-01-04 09:03:41
2025-01-04 09:03:41 2025-01-04T06:03:41.419Z DEBUG 1 --- [virtualDealRoom-service] [port thread - 0] [ ] org.elasticsearch.client.RestClient : added [[host=http://localhost:9200]] to blacklist
Key Points:
The Elasticsearch host isn’t explicitly specified in my application YAML configuration, yet it’s attempting to connect to “localhost:9200”. Indexing works smoothly with a single data source but fails with multiple data sources. The application functions perfectly when deployed in an environment where Elasticsearch is available at “http://localhost:9200”. I’d appreciate some assistance in resolving this issue.
I have tried having a custom rest configuration for elstic search but it did not work
- 《福布斯》:缺乏硬软件支持 NFC已成鸡肋
- c# - Having problems with a unity learn tutorial regarding Top-Level Statements - Stack Overflow
- kubernetes - How can I use kubectl debug with a locally generated docker image? - Stack Overflow
- laravel - PHP Filament header action button label not toggling correctly - Stack Overflow
- starknet - How to generate and verify a STARK proof from a Cairo program locally? - Stack Overflow
- reactjs - Does React reconciliation have an internal timer? - Stack Overflow
- Flutter GoRouter: ShellRoute with Subroutes - Stack Overflow
- android - Unity Ads fail to initialize - Stack Overflow
- java - JAR works in Command Prompt but not in PHP - Stack Overflow
- How to programmatically trigger "Next desktop background" in Windows using C#? - Stack Overflow
- kotlin - How to deal with Compose Desktop MenuBar - Stack Overflow
- augmented reality - Applying 2d image to a 3d object in xcode tutorials? - Stack Overflow
- c++ - Incremental compilation using Makefile - Stack Overflow
- typescript - angular signal is not recomputing - Stack Overflow
- Angular mfe with @module-federationenhanced having issue to use ngx-translate with remote apps - Stack Overflow
- Swift Predicate: Fatal Error Keypaths With Multiple Components - Stack Overflow
- Can't swap camera with AVCaptureMultiCamSession with SwiftAVKit for iOS - Stack Overflow