Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/meltmedia/dropwizard-jest
A Dropwizard Bundle for the Jest Elasticsearch client.
https://github.com/meltmedia/dropwizard-jest
dropwizard dropwizard-bundle elasticsearch java jest
Last synced: about 2 months ago
JSON representation
A Dropwizard Bundle for the Jest Elasticsearch client.
- Host: GitHub
- URL: https://github.com/meltmedia/dropwizard-jest
- Owner: meltmedia
- License: apache-2.0
- Created: 2015-03-18T22:33:38.000Z (almost 10 years ago)
- Default Branch: develop
- Last Pushed: 2017-09-26T22:06:10.000Z (over 7 years ago)
- Last Synced: 2024-04-14T14:14:26.638Z (9 months ago)
- Topics: dropwizard, dropwizard-bundle, elasticsearch, java, jest
- Language: Java
- Size: 56.6 KB
- Stars: 4
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dropwizard Jest
A Dropwizard bundle for the Jest Elasticsearch Client.
[![Build Status](https://travis-ci.org/meltmedia/dropwizard-jest.svg)](https://travis-ci.org/meltmedia/dropwizard-jest)
## Usage
### Maven
Releases of this project are available on Maven Central. You can include the project with this dependency:
```
com.meltmedia.dropwizard
dropwizard-jest
0.3.0```
To use SNAPSHOTs of this project, you will need to include the sonatype repository in your POM.
```
true
sonatype-nexus-snapshots
Sonatype Nexus Snapshots
https://oss.sonatype.org/content/repositories/snapshots
```
You will also need to include the project in your dependencies.
```
com.meltmedia.dropwizard
dropwizard-jest
0.4.0-SNAPSHOT```
### Java
Define the JestConfiguraion class somewhere in your applications configuration.
```
import com.meltmedia.dropwizard.jest.JestConfiguration;...
@JsonProperty
protected JestConfiguration elasticsearch;public JestConfiguration getElasticsearch() {
return jest;
}
```Then include the bundle in the `initialize` method of your application.
```
import com.meltmedia.dropwizard.jest.JestBundle;...
protected JestBundle jestBundle;@Override
public void initialize(Bootstrap bootstrap) {
bootstrap.addBundle(jestBundle = JestBundle.builder()
.withConfiguration(ExampleConfiguration::getElasticsearch)
.build());
}
```Finally, use the bundle to access the client supplier.
```
@Override
public void run(ExampleConfiguration config, Environment env) throws Exception {
JestClient client = jestBundle.getClientSupplier().get();
}
```### Configuration
Add the jest configuraiton block to your applications config.
```
elasticsearch:
clusterName: elasticsearch
servers:
- 'http://localhost:9200'
```## Building
This project builds with Java 8 and Maven 3. After cloning the repo, install the bundle from the root of the project.
```
mvn clean install
```### Integration Tests
Run the build with the `integration-tests` profile.
```
mvn clean install -P integration-tests
```## Contributing
This project accepts PRs, so feel free to fork the project and send contributions back.
### Formatting
This project contains formatters to help keep the code base consistent. The formatter will update Java source files and add headers to other files. When running the formatter, I suggest the following procedure:
1. Make sure any outstanding stages are staged. This will prevent the formatter from destroying your code.
2. Run `mvn format`, this will format the source and add any missing license headers.
3. If the changes look good and the project still compiles, add the formatting changes to your staged code.If things go wrong, you can run `git checkout -- .` to drop the formatting changes.