code: public static String toHawkularFormat(BasicMessage msg) {
          return String.format("%s=%s", msg.getClass().getSimpleName(), msg.toJSON());
      }
docs: Returns a string that encodes the given object as a JSON message but then
  prefixes that JSON with additional information that a Hawkular client will
  need to be able to deserialize the JSON.
  
  This string can be used to deserialize the object via {@link #deserialize(String)}.
  
  @param msg the message object that will be serialized into JSON
  @return a string that includes the JSON that can be used by other Hawkular endpoints to deserialize the message.