class MessageHeaders {

  @Nullable static String getHeaderIfString(Message message, String name) {
    MessageProperties properties = message.getMessageProperties();
    if (properties == null) return null;
    Object o = properties.getHeader(name);
    if (o instanceof String) return o.toString();
    return null;
  }

}