org.apache.activemq.artemis.api.core.Message.getDuplicateProperty()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(141)

本文整理了Java中org.apache.activemq.artemis.api.core.Message.getDuplicateProperty()方法的一些代码示例,展示了Message.getDuplicateProperty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.getDuplicateProperty()方法的具体详情如下:
包路径:org.apache.activemq.artemis.api.core.Message
类名称:Message
方法名:getDuplicateProperty

Message.getDuplicateProperty介绍

暂无

代码示例

代码示例来源:origin: wildfly/wildfly

/**
* it will translate a property named HDR_DUPLICATE_DETECTION_ID.
* @return
*/
default byte[] getDuplicateIDBytes() {
 Object duplicateID = getDuplicateProperty();
 if (duplicateID == null) {
   return null;
 } else {
   if (duplicateID instanceof SimpleString) {
    return ((SimpleString) duplicateID).getData();
   } else if (duplicateID instanceof String) {
    return new SimpleString(duplicateID.toString()).getData();
   } else {
    return (byte[]) duplicateID;
   }
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* it will translate a property named HDR_DUPLICATE_DETECTION_ID.
* @return
*/
default byte[] getDuplicateIDBytes() {
 Object duplicateID = getDuplicateProperty();
 if (duplicateID == null) {
   return null;
 } else {
   if (duplicateID instanceof SimpleString) {
    return ((SimpleString) duplicateID).getData();
   } else if (duplicateID instanceof String) {
    return new SimpleString(duplicateID.toString()).getData();
   } else {
    return (byte[]) duplicateID;
   }
 }
}

代码示例来源:origin: org.apache.activemq/artemis-jms-client-all

/**
* it will translate a property named HDR_DUPLICATE_DETECTION_ID.
* @return
*/
default byte[] getDuplicateIDBytes() {
 Object duplicateID = getDuplicateProperty();
 if (duplicateID == null) {
   return null;
 } else {
   if (duplicateID instanceof SimpleString) {
    return ((SimpleString) duplicateID).getData();
   } else if (duplicateID instanceof String) {
    return new SimpleString(duplicateID.toString()).getData();
   } else {
    return (byte[]) duplicateID;
   }
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* it will translate a property named HDR_DUPLICATE_DETECTION_ID.
* @return
*/
default byte[] getDuplicateIDBytes() {
 Object duplicateID = getDuplicateProperty();
 if (duplicateID == null) {
   return null;
 } else {
   if (duplicateID instanceof SimpleString) {
    return ((SimpleString) duplicateID).getData();
   } else if (duplicateID instanceof String) {
    return new SimpleString(duplicateID.toString()).getData();
   } else {
    return (byte[]) duplicateID;
   }
 }
}

代码示例来源:origin: apache/activemq-artemis

/**
* it will translate a property named HDR_DUPLICATE_DETECTION_ID.
* @return
*/
default byte[] getDuplicateIDBytes() {
 Object duplicateID = getDuplicateProperty();
 if (duplicateID == null) {
   return null;
 } else {
   if (duplicateID instanceof SimpleString) {
    return ((SimpleString) duplicateID).getData();
   } else if (duplicateID instanceof String) {
    return new SimpleString(duplicateID.toString()).getData();
   } else {
    return (byte[]) duplicateID;
   }
 }
}

代码示例来源:origin: org.apache.activemq/artemis-core-client

/**
* it will translate a property named HDR_DUPLICATE_DETECTION_ID.
* @return
*/
default byte[] getDuplicateIDBytes() {
 Object duplicateID = getDuplicateProperty();
 if (duplicateID == null) {
   return null;
 } else {
   if (duplicateID instanceof SimpleString) {
    return ((SimpleString) duplicateID).getData();
   } else if (duplicateID instanceof String) {
    return new SimpleString(duplicateID.toString()).getData();
   } else {
    return (byte[]) duplicateID;
   }
 }
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

/**
* it will translate a property named HDR_DUPLICATE_DETECTION_ID.
* @return
*/
default byte[] getDuplicateIDBytes() {
 Object duplicateID = getDuplicateProperty();
 if (duplicateID == null) {
   return null;
 } else {
   if (duplicateID instanceof SimpleString) {
    return ((SimpleString) duplicateID).getData();
   } else if (duplicateID instanceof String) {
    return new SimpleString(duplicateID.toString()).getData();
   } else {
    return (byte[]) duplicateID;
   }
 }
}

代码示例来源:origin: apache/activemq-artemis

@Override
  public void actMessage(Transaction tx, MessageReference ref) throws Exception {
   boolean ignored = false;
   incDelivering(ref);
   if (rejectDuplicates) {
     byte[] duplicateBytes = ref.getMessage().getDuplicateIDBytes();
     if (duplicateBytes != null) {
      if (targetDuplicateCache.contains(duplicateBytes)) {
        ActiveMQServerLogger.LOGGER.messageWithDuplicateID(ref.getMessage().getDuplicateProperty(), toAddress, address, address);
        acknowledge(tx, ref);
        ignored = true;
      }
     }
   }
   if (!ignored) {
     move(null, toAddress, binding, ref, rejectDuplicates, AckReason.NORMAL, null);
     refRemoved(ref);
     //move(toAddress, tx, ref, false, rejectDuplicates);
   }
  }
});

相关文章

微信公众号

最新文章

更多