org.apache.qpid.proton.message.Message.getDeliveryCount()方法的使用及代码示例

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

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

Message.getDeliveryCount介绍

暂无

代码示例

代码示例来源:origin: org.apache.qpid/proton-hawtdispatch

void incrementDeliveryCount() {
  Message msg = getMessage();
  msg.setDeliveryCount(msg.getDeliveryCount()+1);
  encoded = null;
}

代码示例来源:origin: EnMasseProject/enmasse

boolean isDup = (message.getDeliveryCount() > 0);

代码示例来源:origin: EnMasseProject/enmasse

boolean isDup = (message.getDeliveryCount() > 0);

代码示例来源:origin: Azure/azure-service-bus-java

brokeredMessage.setDeliveryCount(amqpMessage.getDeliveryCount());

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

assertEquals(0, message.getWrappedMessage().getDeliveryCount());
  assertEquals(1, message.getWrappedMessage().getDeliveryCount());
  assertEquals(2, message.getWrappedMessage().getDeliveryCount());
  assertEquals(3, message.getWrappedMessage().getDeliveryCount());
} finally {
  connection.close();

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

assertEquals("Unexpected initial value for AMQP delivery-count", 0, protonMessage.getDeliveryCount());
assertEquals("Unexpected updated value for AMQP delivery-count", expectedDeliveryCount, protonMessage2.getDeliveryCount());

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

@Test(timeout = 30000)
public void testReleasedDisposition() throws Exception {
 sendMessages(getQueueName(), 1);
 AmqpClient client = createAmqpClient();
 AmqpConnection connection = addConnection(client.connect());
 AmqpSession session = connection.createSession();
 AmqpReceiver receiver1 = session.createReceiver(getQueueName());
 receiver1.flow(1);
 AmqpMessage message = receiver1.receive(5, TimeUnit.SECONDS);
 AmqpReceiver receiver2 = session.createReceiver(getQueueName());
 assertNotNull("did not receive message first time", message);
 assertEquals("MessageID:0", message.getMessageId());
 Message protonMessage = message.getWrappedMessage();
 assertNotNull(protonMessage);
 assertEquals("Unexpected initial value for AMQP delivery-count", 0, protonMessage.getDeliveryCount());
 receiver2.flow(1);
 message.release();
 // Read the message again and validate its state
 message = receiver2.receive(10, TimeUnit.SECONDS);
 assertNotNull("did not receive message again", message);
 assertEquals("MessageID:0", message.getMessageId());
 message.accept();
 protonMessage = message.getWrappedMessage();
 assertNotNull(protonMessage);
 assertEquals("Unexpected updated value for AMQP delivery-count", 0, protonMessage.getDeliveryCount());
 connection.close();
}

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

@Test(timeout = 30000)
public void testRejectedDisposition() throws Exception {
 sendMessages(getQueueName(), 1);
 AmqpClient client = createAmqpClient();
 AmqpConnection connection = addConnection(client.connect());
 AmqpSession session = connection.createSession();
 AmqpReceiver receiver1 = session.createReceiver(getQueueName());
 receiver1.flow(1);
 AmqpMessage message = receiver1.receive(5, TimeUnit.SECONDS);
 assertNotNull("did not receive message first time", message);
 assertEquals("MessageID:0", message.getMessageId());
 Message protonMessage = message.getWrappedMessage();
 assertNotNull(protonMessage);
 assertEquals("Unexpected initial value for AMQP delivery-count", 0, protonMessage.getDeliveryCount());
 message.reject();
 // Reject is a terminal outcome and should not be redelivered to the rejecting receiver
 // or any other as it should move to the archived state.
 receiver1.flow(1);
 message = receiver1.receiveNoWait();
 assertNull("Should not receive message again", message);
 // Attempt to Read the message again with another receiver to validate it is archived.
 AmqpReceiver receiver2 = session.createReceiver(getQueueName());
 receiver2.flow(1);
 assertNull(receiver2.receiveNoWait());
 connection.close();
}

相关文章

微信公众号

最新文章

更多