@Override public void process(Event event) { Record record = new Record(); for (Entry<String, String> entry : event.getHeaders().entrySet()) { record.put(entry.getKey(), entry.getValue()); } byte[] bytes = event.getBody(); if (bytes != null && bytes.length > 0) { record.put(Fields.ATTACHMENT_BODY, bytes); } try { Notifications.notifyStartSession(morphline); if (!morphline.process(record)) { LOG.warn("Morphline {} failed to process record: {}", morphlineFileAndId, record); } } catch (RuntimeException t) { morphlineContext.getExceptionHandler().handleException(t, record); } }
@Override public void stop() { Notifications.notifyShutdown(morphline); }
@Override public void commitTransaction() { Notifications.notifyCommitTransaction(morphline); }
@Override public void rollbackTransaction() { Notifications.notifyRollbackTransaction(morphline); }
@Override public void beginTransaction() { Notifications.notifyBeginTransaction(morphline); }