Skip to content

Instantly share code, notes, and snippets.

@viniciusccarvalho
Created July 29, 2013 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viniciusccarvalho/d27aa2b5aaf8dd8eb9d0 to your computer and use it in GitHub Desktop.
Save viniciusccarvalho/d27aa2b5aaf8dd8eb9d0 to your computer and use it in GitHub Desktop.
@Inject
public Replicator(IndicesService service, Client client, MessageProducer producer){
this.indicesService = service;
this.client = client;
setupIndex();
registerListener();
}
private void setupIndex() {
try {
if(!client.admin().indices().exists(new IndicesExistsRequest(ReplicationModule.REPLICATION_INDEX)).actionGet().isExists()){
client.admin().indices().create(new CreateIndexRequest(ReplicationModule.REPLICATION_INDEX));
}
} catch (Exception e) {
e.printStackTrace();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment