示例#1
0
  private void convertMessageProperties(
      final javax.jms.Message message, final MessageImpl replacementMessage) throws JMSException {
    Enumeration propertyNames = message.getPropertyNames();
    while (propertyNames.hasMoreElements()) {
      String propertyName = String.valueOf(propertyNames.nextElement());
      // TODO: Shouldn't need to check for JMS properties here as don't think getPropertyNames()
      // should return them
      if (!propertyName.startsWith("JMSX_")) {
        Object value = message.getObjectProperty(propertyName);
        replacementMessage.setObjectProperty(propertyName, value);
      }
    }

    replacementMessage.setJMSDeliveryMode(message.getJMSDeliveryMode());

    if (message.getJMSReplyTo() != null) {
      replacementMessage.setJMSReplyTo(message.getJMSReplyTo());
    }

    replacementMessage.setJMSType(message.getJMSType());

    replacementMessage.setJMSCorrelationID(message.getJMSCorrelationID());
  }