public static void consumeWebcamMotionEvent ( WebcamMotionEvent motionEvent , Processor processor , WebcamEndpoint endpoint , ExceptionHandler exceptionHandler ) { Validate . notNull ( motionEvent ) ; Validate . notNull ( processor ) ; Validate . notNull ( endpoint ) ; try { Exchange exchange = createOutOnlyExchangeWithBodyAndHeaders ( endpoint , motionEvent . getCurrentImage ( ) ) ; exchange . getIn ( ) . setHeader ( WebcamConstants . WEBCAM_MOTION_EVENT_HEADER , motionEvent ) ; processor . process ( exchange ) ; } catch ( Exception e ) { exceptionHandler . handleException ( e ) ; } }
Consume the motion event from the webcam all params required . The event is stored in the header while the latest image is available as the body .