@Override public void updateMessage(Message message) throws IOException { if (LOG.isTraceEnabled()) { LOG.trace("updating: " + message.getMessageId() + " with deliveryCount: " + message.getRedeliveryCounter()); } KahaUpdateMessageCommand updateMessageCommand = new KahaUpdateMessageCommand(); KahaAddMessageCommand command = new KahaAddMessageCommand(); command.setDestination(dest); command.setMessageId(message.getMessageId().toProducerKey()); command.setPriority(message.getPriority()); command.setPrioritySupported(prioritizedMessages); org.apache.activemq.util.ByteSequence packet = wireFormat.marshal(message); command.setMessage(new Buffer(packet.getData(), packet.getOffset(), packet.getLength())); updateMessageCommand.setMessage(command); store(updateMessageCommand, isEnableJournalDiskSyncs(), null, null); }
final int currentRedeliveryCount = lastMd.getMessage().getRedeliveryCounter(); if (currentRedeliveryCount > 0) { redeliveryDelay = redeliveryPolicy.getNextRedeliveryDelay(redeliveryDelay); redeliveryDelay = redeliveryPolicy.getInitialRedeliveryDelay(); MessageId firstMsgId = deliveredMessages.getLast().getMessage().getMessageId(); && lastMd.getMessage().getRedeliveryCounter() > redeliveryPolicy.getMaximumRedeliveries()) { ack.setPoisonCause(new Throwable("Delivery[" + lastMd.getMessage().getRedeliveryCounter() + "] exceeds redelivery policy limit:" + redeliveryPolicy + ", cause:" + lastMd.getRollbackCause(), lastMd.getRollbackCause())); session.sendAck(ack,true);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getOriginalDestination(), dataOut); looseMarshalNestedObject(wireFormat, (DataStructure)info.getMessageId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getOriginalTransactionId(), dataOut); looseMarshalString(info.getGroupID(), dataOut); looseMarshalString(info.getCorrelationId(), dataOut); dataOut.writeBoolean(info.isPersistent()); looseMarshalLong(wireFormat, info.getExpiration(), dataOut); dataOut.writeByte(info.getPriority()); looseMarshalNestedObject(wireFormat, (DataStructure)info.getReplyTo(), dataOut); looseMarshalLong(wireFormat, info.getTimestamp(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getTargetConsumerId(), dataOut); dataOut.writeBoolean(info.isCompressed()); dataOut.writeInt(info.getRedeliveryCounter()); looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut); looseMarshalLong(wireFormat, info.getArrival(), dataOut);
final int originalValue = message.getRedeliveryCounter(); message.incrementRedeliveryCounter(); try { RuntimeException runtimeException = new RuntimeException("Failed to persist JMSRedeliveryFlag on " + message.getMessageId() + " in " + message.getDestination(), error); LOG.warn(runtimeException.getLocalizedMessage(), runtimeException); throw runtimeException;
private QueueEntryPB.Bean createQueueEntryPB(Message message, long queueKey, long queueSeq, long messageKey) { QueueEntryPB.Bean entryRecord = new QueueEntryPB.Bean(); entryRecord.setQueueKey(queueKey); entryRecord.setQueueSeq(queueSeq); entryRecord.setMessageKey(messageKey); entryRecord.setSize(message.getSize()); if (message.getExpiration() != 0) { entryRecord.setExpiration(message.getExpiration()); } if (message.getRedeliveryCounter() != 0) { entryRecord.setRedeliveries(message.getRedeliveryCounter()); } return entryRecord; }
looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getOriginalDestination(), dataOut); looseMarshalNestedObject(wireFormat, (DataStructure)info.getMessageId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getOriginalTransactionId(), dataOut); looseMarshalString(info.getGroupID(), dataOut); looseMarshalString(info.getCorrelationId(), dataOut); dataOut.writeBoolean(info.isPersistent()); looseMarshalLong(wireFormat, info.getExpiration(), dataOut); dataOut.writeByte(info.getPriority()); looseMarshalNestedObject(wireFormat, (DataStructure)info.getReplyTo(), dataOut); looseMarshalLong(wireFormat, info.getTimestamp(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getTargetConsumerId(), dataOut); dataOut.writeBoolean(info.isCompressed()); dataOut.writeInt(info.getRedeliveryCounter()); looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut); looseMarshalLong(wireFormat, info.getArrival(), dataOut);
final int originalValue = message.getRedeliveryCounter(); message.incrementRedeliveryCounter(); try { RuntimeException runtimeException = new RuntimeException("Failed to persist JMSRedeliveryFlag on " + message.getMessageId() + " in " + message.getDestination(), error); LOG.warn(runtimeException.getLocalizedMessage(), runtimeException); throw runtimeException;
int redeliveryCounter = md.getMessage().getRedeliveryCounter(); if (redeliveryPolicy.getMaximumRedeliveries() != RedeliveryPolicy.NO_MAXIMUM_REDELIVERIES && redeliveryCounter >= redeliveryPolicy.getMaximumRedeliveries()) { ack.setFirstMessageId(md.getMessage().getMessageId()); ack.setPoisonCause(new Throwable("Exceeded ra redelivery policy limit:" + redeliveryPolicy)); asyncSendPacket(ack); ack.setFirstMessageId(md.getMessage().getMessageId()); asyncSendPacket(ack);
@Override public void updateMessage(Message message) throws IOException { if (LOG.isTraceEnabled()) { LOG.trace("updating: " + message.getMessageId() + " with deliveryCount: " + message.getRedeliveryCounter()); } KahaUpdateMessageCommand updateMessageCommand = new KahaUpdateMessageCommand(); KahaAddMessageCommand command = new KahaAddMessageCommand(); command.setDestination(dest); command.setMessageId(message.getMessageId().toProducerKey()); command.setPriority(message.getPriority()); command.setPrioritySupported(prioritizedMessages); org.apache.activemq.util.ByteSequence packet = wireFormat.marshal(message); command.setMessage(new Buffer(packet.getData(), packet.getOffset(), packet.getLength())); updateMessageCommand.setMessage(command); store(updateMessageCommand, isEnableJournalDiskSyncs(), null, null); }
private QueueEntryPB.Bean createQueueEntryPB(Message message, long queueKey, long queueSeq, long messageKey) { QueueEntryPB.Bean entryRecord = new QueueEntryPB.Bean(); entryRecord.setQueueKey(queueKey); entryRecord.setQueueSeq(queueSeq); entryRecord.setMessageKey(messageKey); entryRecord.setSize(message.getSize()); if (message.getExpiration() != 0) { entryRecord.setExpiration(message.getExpiration()); } if (message.getRedeliveryCounter() != 0) { entryRecord.setRedeliveries(message.getRedeliveryCounter()); } return entryRecord; }
looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getOriginalDestination(), dataOut); looseMarshalNestedObject(wireFormat, (DataStructure)info.getMessageId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getOriginalTransactionId(), dataOut); looseMarshalString(info.getGroupID(), dataOut); looseMarshalString(info.getCorrelationId(), dataOut); dataOut.writeBoolean(info.isPersistent()); looseMarshalLong(wireFormat, info.getExpiration(), dataOut); dataOut.writeByte(info.getPriority()); looseMarshalNestedObject(wireFormat, (DataStructure)info.getReplyTo(), dataOut); looseMarshalLong(wireFormat, info.getTimestamp(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getTargetConsumerId(), dataOut); dataOut.writeBoolean(info.isCompressed()); dataOut.writeInt(info.getRedeliveryCounter()); looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut); looseMarshalLong(wireFormat, info.getArrival(), dataOut);
final int originalValue = message.getRedeliveryCounter(); message.incrementRedeliveryCounter(); try { RuntimeException runtimeException = new RuntimeException("Failed to persist JMSRedeliveryFlag on " + message.getMessageId() + " in " + message.getDestination(), error); LOG.warn(runtimeException.getLocalizedMessage(), runtimeException); throw runtimeException;
final int currentRedeliveryCount = lastMd.getMessage().getRedeliveryCounter(); if (currentRedeliveryCount > 0) { redeliveryDelay = redeliveryPolicy.getNextRedeliveryDelay(redeliveryDelay); redeliveryDelay = redeliveryPolicy.getInitialRedeliveryDelay(); MessageId firstMsgId = deliveredMessages.getLast().getMessage().getMessageId(); && lastMd.getMessage().getRedeliveryCounter() > redeliveryPolicy.getMaximumRedeliveries()) { ack.setPoisonCause(new Throwable("Delivery[" + lastMd.getMessage().getRedeliveryCounter() + "] exceeds redelivery policy limit:" + redeliveryPolicy + ", cause:" + lastMd.getRollbackCause(), lastMd.getRollbackCause())); session.sendAck(ack,true);
@Override public void updateMessage(Message message) throws IOException { if (LOG.isTraceEnabled()) { LOG.trace("updating: " + message.getMessageId() + " with deliveryCount: " + message.getRedeliveryCounter()); } KahaUpdateMessageCommand updateMessageCommand = new KahaUpdateMessageCommand(); KahaAddMessageCommand command = new KahaAddMessageCommand(); command.setDestination(dest); command.setMessageId(message.getMessageId().toProducerKey()); command.setPriority(message.getPriority()); command.setPrioritySupported(prioritizedMessages); org.apache.activemq.util.ByteSequence packet = wireFormat.marshal(message); command.setMessage(new Buffer(packet.getData(), packet.getOffset(), packet.getLength())); updateMessageCommand.setMessage(command); store(updateMessageCommand, isEnableJournalDiskSyncs(), null, null); }
private QueueEntryPB.Bean createQueueEntryPB(Message message, long queueKey, long queueSeq, long messageKey) { QueueEntryPB.Bean entryRecord = new QueueEntryPB.Bean(); entryRecord.setQueueKey(queueKey); entryRecord.setQueueSeq(queueSeq); entryRecord.setMessageKey(messageKey); entryRecord.setSize(message.getSize()); if (message.getExpiration() != 0) { entryRecord.setExpiration(message.getExpiration()); } if (message.getRedeliveryCounter() != 0) { entryRecord.setRedeliveries(message.getRedeliveryCounter()); } return entryRecord; }
looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getOriginalDestination(), dataOut); looseMarshalNestedObject(wireFormat, (DataStructure)info.getMessageId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getOriginalTransactionId(), dataOut); looseMarshalString(info.getGroupID(), dataOut); looseMarshalString(info.getCorrelationId(), dataOut); dataOut.writeBoolean(info.isPersistent()); looseMarshalLong(wireFormat, info.getExpiration(), dataOut); dataOut.writeByte(info.getPriority()); looseMarshalNestedObject(wireFormat, (DataStructure)info.getReplyTo(), dataOut); looseMarshalLong(wireFormat, info.getTimestamp(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getTargetConsumerId(), dataOut); dataOut.writeBoolean(info.isCompressed()); dataOut.writeInt(info.getRedeliveryCounter()); looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut); looseMarshalLong(wireFormat, info.getArrival(), dataOut);
final int originalValue = message.getRedeliveryCounter(); message.incrementRedeliveryCounter(); try { RuntimeException runtimeException = new RuntimeException("Failed to persist JMSRedeliveryFlag on " + message.getMessageId() + " in " + message.getDestination(), error); LOG.warn(runtimeException.getLocalizedMessage(), runtimeException); throw runtimeException;
final int currentRedeliveryCount = lastMd.getMessage().getRedeliveryCounter(); if (currentRedeliveryCount > 0) { redeliveryDelay = redeliveryPolicy.getNextRedeliveryDelay(redeliveryDelay); redeliveryDelay = redeliveryPolicy.getInitialRedeliveryDelay(); MessageId firstMsgId = deliveredMessages.getLast().getMessage().getMessageId(); && lastMd.getMessage().getRedeliveryCounter() > redeliveryPolicy.getMaximumRedeliveries()) {
@Override public void updateMessage(Message message) throws IOException { if (LOG.isTraceEnabled()) { LOG.trace("updating: " + message.getMessageId() + " with deliveryCount: " + message.getRedeliveryCounter()); } KahaUpdateMessageCommand updateMessageCommand = new KahaUpdateMessageCommand(); KahaAddMessageCommand command = new KahaAddMessageCommand(); command.setDestination(dest); command.setMessageId(message.getMessageId().toProducerKey()); command.setPriority(message.getPriority()); command.setPrioritySupported(prioritizedMessages); org.apache.activemq.util.ByteSequence packet = wireFormat.marshal(message); command.setMessage(new Buffer(packet.getData(), packet.getOffset(), packet.getLength())); updateMessageCommand.setMessage(command); store(updateMessageCommand, isEnableJournalDiskSyncs(), null, null); }
looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getOriginalDestination(), dataOut); looseMarshalNestedObject(wireFormat, (DataStructure)info.getMessageId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getOriginalTransactionId(), dataOut); looseMarshalString(info.getGroupID(), dataOut); looseMarshalString(info.getCorrelationId(), dataOut); dataOut.writeBoolean(info.isPersistent()); looseMarshalLong(wireFormat, info.getExpiration(), dataOut); dataOut.writeByte(info.getPriority()); looseMarshalNestedObject(wireFormat, (DataStructure)info.getReplyTo(), dataOut); looseMarshalLong(wireFormat, info.getTimestamp(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getTargetConsumerId(), dataOut); dataOut.writeBoolean(info.isCompressed()); dataOut.writeInt(info.getRedeliveryCounter()); looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut); looseMarshalLong(wireFormat, info.getArrival(), dataOut);