-
-
Save viniciusccarvalho/d27aa2b5aaf8dd8eb9d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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