Message extractMessageFromColumn ( Column < MessageQueueEntry > column ) { // Next, parse the message metadata and add a timeout entry Message message = null ; try { ByteArrayInputStream bais = new ByteArrayInputStream ( column . getByteArrayValue ( ) ) ; message = mapper . readValue ( bais , Message . class ) ; } catch ( Exception e ) { LOG . warn ( "Error processing message " , e ) ; try { message = invalidMessageHandler . apply ( column . getStringValue ( ) ) ; } catch ( Exception e2 ) { LOG . warn ( "Error processing invalid message" , e2 ) ; } } return message ; }
Extract a message body from a column