Skip to content

Instantly share code, notes, and snippets.

@skylerto
Created October 2, 2016 00:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skylerto/03eab3394e367431245d111abaa84798 to your computer and use it in GitHub Desktop.
Save skylerto/03eab3394e367431245d111abaa84798 to your computer and use it in GitHub Desktop.
public class KafkaOutputBean {
public void printKafkaBody(String body) {
try {
Notification message = new ObjectMapper().readValue(body, Notification.class);
System.out.println("KafkaBody result >>>>> " + message.toString());
} catch (JsonParseException e) {
System.out.println(body + " cannot be marshalled to a Notification.class");
} catch (JsonMappingException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment