Hello,
I using the change apis to get couchdb document update as follow:
// feed type continuous
changes = dbClient.changes().includeDocs(true) .since('546').heartBeat(30000).continuousChanges();
// live access to continuous feeds
while (changes.hasNext()) {
ChangesResult.Row feed = changes.next();
String docId = feed.getId()
com.google.gson.JsonObject doc = feed.getDoc()
String seq = feed.getSeq()
Gson gson = new Gson()
String json = gson.toJson(doc);
System.out.println(json);
System.out.println("Event docId : " + docId + " - Sequence: " + seq)
System.out.println("Event Json doc: " + json)
// Send event to the Vertx event bus....
}
I would like to send an event to the eventbus from the while loop above upon new documents changes and have a consumer verticle handle events from the event bus and respond.
Where should I create the Vertx instance? Is there any sample code to get me started?
Any help is appreciated.
Thanks