/** * 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; } } }
/** * 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; } } }
/** * 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; } } }
/** * 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; } } }
/** * 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; } } }
/** * 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; } } }
/** * 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; } } }
@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); } } });