https://github.com/cleydyr/hibernate-search-with-apm-poc
Proof of concept Spring Boot application that uses Hibernate Search version 5.11.1 to index documents to an Elasticsearch 5.x backend
https://github.com/cleydyr/hibernate-search-with-apm-poc
Last synced: 4 months ago
JSON representation
Proof of concept Spring Boot application that uses Hibernate Search version 5.11.1 to index documents to an Elasticsearch 5.x backend
- Host: GitHub
- URL: https://github.com/cleydyr/hibernate-search-with-apm-poc
- Owner: cleydyr
- Created: 2023-01-17T16:49:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-19T13:12:44.000Z (over 2 years ago)
- Last Synced: 2025-01-07T06:32:16.243Z (5 months ago)
- Language: Java
- Size: 13.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hibernate-search-with-apm-poc
Proof of concept Spring Boot application that uses Hibernate Search version 5.11.1 to index documents to an Elasticsearch 5.x backend## Requirements
* JDK 11
* Maven## Configuration
Before running, add the [minimal configuration](https://www.elastic.co/guide/en/apm/agent/java/1.x/configuration.html#configuration-minimal) properties (and a secret token if needed) to the elasticapm.properties located at src/main/resources:```properties
service_name=${APM_SERVICE_NAME}
server_url=${APM_SERVER_URL}
secret_token=${APM_SECRET_TOKEN}
```Also, change the application.properties file, replacingn the placeholder values by the actual values of user name, password and host name of your Elasticsearch instance.
## Running
Run `mvn spring-boot:run` from the command line.
After the server is up, it will listen for HTTP POST requests in the deafult port (8080) and the /indexSomething path. So, for example, using `curl`, you can make a request like this
```bash
curl -XPOST http://localhost:8080/indexSomething
```It's expected that a book with title "De Brevitate Vitae", pageCount = 200 and a random uuid as ISBN will be indexed in your Elasticsearch instance in the `books` index. There's no need to create the index as the application itself will create it on startup. The same book data will be added to the H2 memory database (whose data is deleted when the server is shut down).