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

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

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

Message.getDeliveryAnnotations介绍

暂无

代码示例

代码示例来源:origin: eclipse/hono

private DeliveryAnnotations getDeliveryAnnotations() {
    return Optional.ofNullable(message.getDeliveryAnnotations())
        .orElse(new DeliveryAnnotations(new HashMap<>()));
  }
}

代码示例来源:origin: org.eclipse.hono/hono-core

private DeliveryAnnotations getDeliveryAnnotations() {
    return Optional.ofNullable(message.getDeliveryAnnotations())
        .orElse(new DeliveryAnnotations(new HashMap<>()));
  }
}

代码示例来源:origin: eclipse/hono

private DeliveryAnnotations getDeliveryAnnotations() {
    return Optional.ofNullable(message.getDeliveryAnnotations()).orElseGet(() -> {
      final DeliveryAnnotations annotations = new DeliveryAnnotations(new HashMap<>());
      message.setDeliveryAnnotations(annotations);
      return annotations;
    });
  }
}

代码示例来源:origin: org.eclipse.hono/hono-core

private DeliveryAnnotations getDeliveryAnnotations() {
    return Optional.ofNullable(message.getDeliveryAnnotations()).orElseGet(() -> {
      final DeliveryAnnotations annotations = new DeliveryAnnotations(new HashMap<>());
      message.setDeliveryAnnotations(annotations);
      return annotations;
    });
  }
}

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

/**
* Creates a new AmqpMessage that wraps the information necessary to handle
* an incoming delivery.
*
* @param receiver the AmqpReceiver that received this message.
* @param message  the Proton message that was received.
* @param delivery the Delivery instance that produced this message.
*/
@SuppressWarnings("unchecked")
public AmqpMessage(AmqpReceiver receiver, Message message, Delivery delivery) {
 this.receiver = receiver;
 this.message = message;
 this.delivery = delivery;
 if (message.getMessageAnnotations() != null) {
   messageAnnotationsMap = message.getMessageAnnotations().getValue();
 }
 if (message.getApplicationProperties() != null) {
   applicationPropertiesMap = message.getApplicationProperties().getValue();
 }
 if (message.getDeliveryAnnotations() != null) {
   deliveryAnnotationsMap = message.getDeliveryAnnotations().getValue();
 }
}

代码示例来源:origin: Azure/azure-event-hubs-java

@Override
  public Iterable<EventData> apply(Collection<Message> amqpMessages) {
    PassByRef<MessageWrapper> lastMessageRef = null;
    if (PartitionReceiverImpl.this.receiverOptions != null && PartitionReceiverImpl.this.receiverOptions.getReceiverRuntimeMetricEnabled())
      lastMessageRef = new PassByRef<>();
    final Iterable<EventData> events = EventDataUtil.toEventDataCollection(amqpMessages, lastMessageRef);
    if (lastMessageRef != null && lastMessageRef.get() != null) {
      final DeliveryAnnotations deliveryAnnotations = lastMessageRef.get().getMessage().getDeliveryAnnotations();
      if (deliveryAnnotations != null && deliveryAnnotations.getValue() != null) {
        final Map<Symbol, Object> deliveryAnnotationsMap = deliveryAnnotations.getValue();
        PartitionReceiverImpl.this.runtimeInformation.setRuntimeInformation(
            (long) deliveryAnnotationsMap.get(ClientConstants.LAST_ENQUEUED_SEQUENCE_NUMBER),
            ((Date) deliveryAnnotationsMap.get(ClientConstants.LAST_ENQUEUED_TIME_UTC)).toInstant(),
            (String) deliveryAnnotationsMap.get(ClientConstants.LAST_ENQUEUED_OFFSET));
      }
      PartitionReceiverImpl.this.currentEventPosition = lastMessageRef.get().getEventPosition();
    }
    return events;
  }
}, this.executor);

代码示例来源:origin: com.ibm.mqlight/mqlight-api

ttl = msg.getTtl();
if (msg.getDeliveryAnnotations() != null) {
  Map<Symbol, Object> annotations = msg.getDeliveryAnnotations().getValue();
  if (annotations.containsKey(malformedConditionSymbol) &&
    annotations.get(malformedConditionSymbol) instanceof Symbol) {

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

final DeliveryAnnotations da = amqp.getDeliveryAnnotations();
if( da!=null ) {
  for (Map.Entry<?,?> entry : da.getValue().entrySet()) {

相关文章