Ejemplo n.º 1
0
  public static Set<String> getPropertyNames(Message message) {
    HashSet<String> set = new HashSet<String>();

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

    set.add(JMSXDELIVERYCOUNT);

    return set;
  }
Ejemplo n.º 2
0
  public static void clearProperties(Message message) {

    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);
    }
  }