public void setJMSCorrelationID(final String correlationID) throws JMSException {
    if (correlationID == null) {
      message.removeProperty(CORRELATIONID_HEADER_NAME);

      jmsCorrelationID = null;
    } else {
      message.putStringProperty(CORRELATIONID_HEADER_NAME, new SimpleString(correlationID));

      jmsCorrelationID = correlationID;
    }
  }
 public void setJMSMessageID(final String jmsMessageID) throws JMSException {
   if (jmsMessageID != null && !jmsMessageID.startsWith("ID:")) {
     throw new JMSException("JMSMessageID must start with ID:");
   }
   if (jmsMessageID == null) {
     message.removeProperty(JBM_MESSAGE_ID);
   } else {
     message.putStringProperty(JBM_MESSAGE_ID, new SimpleString(jmsMessageID));
   }
   msgID = jmsMessageID;
 }
  public void clearProperties() throws JMSException {
    List<SimpleString> toRemove = new ArrayList<SimpleString>();

    for (SimpleString propName : message.getPropertyNames()) {
      if (!propName.startsWith(JMS) || propName.startsWith(JMSX) || propName.startsWith(JMS_)) {
        toRemove.add(propName);
      }
    }

    for (SimpleString propName : toRemove) {
      message.removeProperty(propName);
    }
  }
  public void setJMSReplyTo(final Destination dest) throws JMSException {
    if (dest == null) {
      message.removeProperty(REPLYTO_HEADER_NAME);

      replyTo = null;
    } else {
      if (dest instanceof JBossDestination == false) {
        throw new InvalidDestinationException("Not a JBoss destination " + dest);
      }

      JBossDestination jbd = (JBossDestination) dest;

      message.putStringProperty(REPLYTO_HEADER_NAME, jbd.getSimpleAddress());

      replyTo = jbd;
    }
  }