public static HCatEventMessage getMessage(Message message) {
    try {
      String messageBody = ((TextMessage)message).getText();
      String eventType   = message.getStringProperty(HCatConstants.HCAT_EVENT);
      String messageVersion = message.getStringProperty(HCatConstants.HCAT_MESSAGE_VERSION);
      String messageFormat = message.getStringProperty(HCatConstants.HCAT_MESSAGE_FORMAT);

      if (StringUtils.isEmpty(messageBody) || StringUtils.isEmpty(eventType))
        throw new IllegalArgumentException("Could not extract HCatEventMessage. " +
                           "EventType and/or MessageBody is null/empty.");

      return MessageFactory.getDeserializer(messageFormat, messageVersion).getHCatEventMessage(eventType, messageBody);
    }
    catch (JMSException exception) {
      throw new IllegalArgumentException("Could not extract HCatEventMessage. ", exception);
    }
  }
Method to return HCatEventMessage contained in the JMS message.
@param message The JMS Message instance
@return The contained HCatEventMessage
hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/messaging/jms/MessagingUtils.java