org.apache.activemq.command.Message.getRedeliveryCounter()方法的使用及代码示例

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

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

Message.getRedeliveryCounter介绍

暂无

代码示例

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

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

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

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

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

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

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

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;

代码示例来源:origin: org.apache.activemq/activemq-console

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

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

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

代码示例来源:origin: org.apache.activemq/activemq-broker

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;

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

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

代码示例来源:origin: org.apache.activemq/activemq-osgi

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

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

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

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

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

代码示例来源:origin: org.apache.activemq/activemq-osgi

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;

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

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

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

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

代码示例来源:origin: org.apache.activemq/activemq-osgi

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

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

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

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

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;

代码示例来源:origin: pierre/meteo

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()) {

代码示例来源:origin: org.apache.activemq/activemq-kahadb-store

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

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

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

相关文章

微信公众号

最新文章

更多

Message类方法