Skip to content

Instantly share code, notes, and snippets.

@mykidong
Created May 24, 2018 14:18
Show Gist options
  • Save mykidong/463b3d90b179e2d61212f2e2e28d95d0 to your computer and use it in GitHub Desktop.
Save mykidong/463b3d90b179e2d61212f2e2e28d95d0 to your computer and use it in GitHub Desktop.
// init. disruptor event log translator.
BaseTranslator.EventLogTranslator eventLogValidationTranslator = new BaseTranslator.EventLogTranslator();
// handle http or tcp request.
Buffer body = ...
// get body from the request.
String json = new String(body.getBytes());
// set the values to event translator.
eventLogValidationTranslator.setVersion("1.0.0");
eventLogValidationTranslator.setEventType("page-view-event");
eventLogValidationTranslator.setValue(json);
// publish the event to validation disruptor.
validationDisruptor.publishEvent(this.eventLogValidationTranslator);
@mykidong
Copy link
Author

.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment