@Override
  protected String extractString(JMSBindingData binding) throws Exception {
    Message content = binding.getMessage();
    if (content instanceof TextMessage) {
      return TextMessage.class.cast(content).getText();

    } else if (content instanceof BytesMessage) {
      BytesMessage sourceBytes = BytesMessage.class.cast(content);
      if (sourceBytes.getBodyLength() > Integer.MAX_VALUE) {
        throw JCAMessages.MESSAGES
            .theSizeOfMessageContentExceedsBytesThatIsNotSupportedByThisOperationSelector(
                "" + Integer.MAX_VALUE);
      }
      byte[] bytearr = new byte[(int) sourceBytes.getBodyLength()];
      sourceBytes.readBytes(bytearr);
      return new String(bytearr);

    } else if (content instanceof ObjectMessage) {
      ObjectMessage sourceObj = ObjectMessage.class.cast(content);
      return String.class.cast(sourceObj.getObject());

    } else if (content instanceof MapMessage) {
      MapMessage sourceMap = MapMessage.class.cast(content);
      return sourceMap.getString(KEY);
    } else {
      return content.getStringProperty(KEY);
    }
  }