public static void consumeTPVObject(TPVObject tpv, Processor processor, GpsdEndpoint endpoint, ExceptionHandler exceptionHandler) {
LOG.debug("About to consume TPV object {},{} from {}", tpv.getLatitude(), tpv.getLongitude(), endpoint);
Validate.notNull(tpv);
Validate.notNull(processor);
Validate.notNull(endpoint);
GpsCoordinates coordinates = gpsCoordinates(new Date(new Double(tpv.getTimestamp()).longValue()), tpv.getLatitude(), tpv.getLongitude());
Exchange exchange = anExchange(endpoint.getCamelContext()).withPattern(OutOnly).
withHeader(TPV_HEADER, tpv).withBody(coordinates).build();
try {
processor.process(exchange);
} catch (Exception e) {
exceptionHandler.handleException(e);
}
}
}