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

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

本文整理了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

  1. /**
  2. * it will translate a property named HDR_DUPLICATE_DETECTION_ID.
  3. * @return
  4. */
  5. default byte[] getDuplicateIDBytes() {
  6. Object duplicateID = getDuplicateProperty();
  7. if (duplicateID == null) {
  8. return null;
  9. } else {
  10. if (duplicateID instanceof SimpleString) {
  11. return ((SimpleString) duplicateID).getData();
  12. } else if (duplicateID instanceof String) {
  13. return new SimpleString(duplicateID.toString()).getData();
  14. } else {
  15. return (byte[]) duplicateID;
  16. }
  17. }
  18. }

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

  1. /**
  2. * it will translate a property named HDR_DUPLICATE_DETECTION_ID.
  3. * @return
  4. */
  5. default byte[] getDuplicateIDBytes() {
  6. Object duplicateID = getDuplicateProperty();
  7. if (duplicateID == null) {
  8. return null;
  9. } else {
  10. if (duplicateID instanceof SimpleString) {
  11. return ((SimpleString) duplicateID).getData();
  12. } else if (duplicateID instanceof String) {
  13. return new SimpleString(duplicateID.toString()).getData();
  14. } else {
  15. return (byte[]) duplicateID;
  16. }
  17. }
  18. }

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

  1. /**
  2. * it will translate a property named HDR_DUPLICATE_DETECTION_ID.
  3. * @return
  4. */
  5. default byte[] getDuplicateIDBytes() {
  6. Object duplicateID = getDuplicateProperty();
  7. if (duplicateID == null) {
  8. return null;
  9. } else {
  10. if (duplicateID instanceof SimpleString) {
  11. return ((SimpleString) duplicateID).getData();
  12. } else if (duplicateID instanceof String) {
  13. return new SimpleString(duplicateID.toString()).getData();
  14. } else {
  15. return (byte[]) duplicateID;
  16. }
  17. }
  18. }

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

  1. /**
  2. * it will translate a property named HDR_DUPLICATE_DETECTION_ID.
  3. * @return
  4. */
  5. default byte[] getDuplicateIDBytes() {
  6. Object duplicateID = getDuplicateProperty();
  7. if (duplicateID == null) {
  8. return null;
  9. } else {
  10. if (duplicateID instanceof SimpleString) {
  11. return ((SimpleString) duplicateID).getData();
  12. } else if (duplicateID instanceof String) {
  13. return new SimpleString(duplicateID.toString()).getData();
  14. } else {
  15. return (byte[]) duplicateID;
  16. }
  17. }
  18. }

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

  1. /**
  2. * it will translate a property named HDR_DUPLICATE_DETECTION_ID.
  3. * @return
  4. */
  5. default byte[] getDuplicateIDBytes() {
  6. Object duplicateID = getDuplicateProperty();
  7. if (duplicateID == null) {
  8. return null;
  9. } else {
  10. if (duplicateID instanceof SimpleString) {
  11. return ((SimpleString) duplicateID).getData();
  12. } else if (duplicateID instanceof String) {
  13. return new SimpleString(duplicateID.toString()).getData();
  14. } else {
  15. return (byte[]) duplicateID;
  16. }
  17. }
  18. }

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

  1. /**
  2. * it will translate a property named HDR_DUPLICATE_DETECTION_ID.
  3. * @return
  4. */
  5. default byte[] getDuplicateIDBytes() {
  6. Object duplicateID = getDuplicateProperty();
  7. if (duplicateID == null) {
  8. return null;
  9. } else {
  10. if (duplicateID instanceof SimpleString) {
  11. return ((SimpleString) duplicateID).getData();
  12. } else if (duplicateID instanceof String) {
  13. return new SimpleString(duplicateID.toString()).getData();
  14. } else {
  15. return (byte[]) duplicateID;
  16. }
  17. }
  18. }

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

  1. /**
  2. * it will translate a property named HDR_DUPLICATE_DETECTION_ID.
  3. * @return
  4. */
  5. default byte[] getDuplicateIDBytes() {
  6. Object duplicateID = getDuplicateProperty();
  7. if (duplicateID == null) {
  8. return null;
  9. } else {
  10. if (duplicateID instanceof SimpleString) {
  11. return ((SimpleString) duplicateID).getData();
  12. } else if (duplicateID instanceof String) {
  13. return new SimpleString(duplicateID.toString()).getData();
  14. } else {
  15. return (byte[]) duplicateID;
  16. }
  17. }
  18. }

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

  1. @Override
  2. public void actMessage(Transaction tx, MessageReference ref) throws Exception {
  3. boolean ignored = false;
  4. incDelivering(ref);
  5. if (rejectDuplicates) {
  6. byte[] duplicateBytes = ref.getMessage().getDuplicateIDBytes();
  7. if (duplicateBytes != null) {
  8. if (targetDuplicateCache.contains(duplicateBytes)) {
  9. ActiveMQServerLogger.LOGGER.messageWithDuplicateID(ref.getMessage().getDuplicateProperty(), toAddress, address, address);
  10. acknowledge(tx, ref);
  11. ignored = true;
  12. }
  13. }
  14. }
  15. if (!ignored) {
  16. move(null, toAddress, binding, ref, rejectDuplicates, AckReason.NORMAL, null);
  17. refRemoved(ref);
  18. //move(toAddress, tx, ref, false, rejectDuplicates);
  19. }
  20. }
  21. });

相关文章