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

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

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

Message.getHeader介绍

暂无

代码示例

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

/**
* Checks the durable value in the Message Headers to determine if
* the message was sent as a durable Message.
*
* @return true if the message is marked as being durable.
*/
public boolean isDurable() {
 if (message.getHeader() == null || message.getHeader().getDurable() == null) {
   return false;
 }
 return message.getHeader().getDurable();
}

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

private void lazyCreateHeader() {
 if (message.getHeader() == null) {
   message.setHeader(new Header());
 }
}

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

} else {
  if (message.getHeader() != null) {
    qos = ((message.getHeader().getDurable() == null) || !message.getHeader().getDurable())
        ? MqttQoS.AT_MOST_ONCE : MqttQoS.AT_LEAST_ONCE;
  } else {

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

} else {
  if (message.getHeader() != null) {
    qos = ((message.getHeader().getDurable() == null) || !message.getHeader().getDurable())
        ? MqttQoS.AT_MOST_ONCE : MqttQoS.AT_LEAST_ONCE;
  } else {

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

if (messageAnnotations == null) {
  if (message.getHeader() != null) {
    qos = ((message.getHeader().getDurable() == null) || !message.getHeader().getDurable())
        ? MqttQoS.AT_MOST_ONCE : MqttQoS.AT_LEAST_ONCE;
  } else {
    if (message.getHeader() != null) {
      qos = ((message.getHeader().getDurable() == null) || !message.getHeader().getDurable())
          ? MqttQoS.AT_MOST_ONCE : MqttQoS.AT_LEAST_ONCE;

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

if (messageAnnotations == null) {
  if (message.getHeader() != null) {
    qos = ((message.getHeader().getDurable() == null) || !message.getHeader().getDurable())
        ? MqttQoS.AT_MOST_ONCE : MqttQoS.AT_LEAST_ONCE;
  } else {
    if (message.getHeader() != null) {
      qos = ((message.getHeader().getDurable() == null) || !message.getHeader().getDurable())
          ? MqttQoS.AT_MOST_ONCE : MqttQoS.AT_LEAST_ONCE;

代码示例来源:origin: io.vertx/vertx-amqp-bridge

@Test
public void testJSON_to_AMQP_WithNoHeaderSection() {
 JsonObject jsonObject = new JsonObject();
 Message protonMsg = translator.convertToAmqpMessage(jsonObject);
 assertNotNull("Expected converted msg", protonMsg);
 assertNull("expected converted msg to have no header section", protonMsg.getHeader());
}

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

protected void populateMessage(Message jms, org.apache.qpid.proton.message.Message amqp) throws Exception {
  Header header = amqp.getHeader();
  if( header==null ) {
    header = new Header();

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

@SuppressWarnings("unchecked")
protected void populateMessage(ActiveMQMessage jms, org.apache.qpid.proton.message.Message amqp) throws Exception {
  Header header = amqp.getHeader();
  if (header != null) {
    jms.setBooleanProperty(JMS_AMQP_HEADER, true);

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

@SuppressWarnings("unchecked")
protected void populateMessage(ActiveMQMessage jms, org.apache.qpid.proton.message.Message amqp) throws Exception {
  Header header = amqp.getHeader();
  if (header != null) {
    jms.setBooleanProperty(JMS_AMQP_HEADER, true);

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

message.setMessageId("MessageID:" + 0);
  message.getWrappedMessage().setHeader(new Header());
  message.getWrappedMessage().getHeader().setDeliveryCount(new UnsignedInteger(2));
  sender.send(message);
} finally {

代码示例来源:origin: io.vertx/vertx-amqp-bridge

@Test
public void testJSON_to_AMQP_VerifyMessageHeader() {
 boolean testDurable = true;
 byte testPriority = 8;
 long testTtl = 2345;
 boolean testFirstAcquirer = true;
 long testDeliveryCount = 3;
 JsonObject jsonHeader = new JsonObject();
 jsonHeader.put(AmqpConstants.HEADER_DURABLE, testDurable);
 jsonHeader.put(AmqpConstants.HEADER_PRIORITY, testPriority);
 jsonHeader.put(AmqpConstants.HEADER_TTL, testTtl);
 jsonHeader.put(AmqpConstants.HEADER_FIRST_ACQUIRER, testFirstAcquirer);
 jsonHeader.put(AmqpConstants.HEADER_DELIVERY_COUNT, testDeliveryCount);
 JsonObject jsonObject = new JsonObject();
 jsonObject.put(AmqpConstants.HEADER, jsonHeader);
 Message protonMsg = translator.convertToAmqpMessage(jsonObject);
 assertNotNull("Expected converted msg", protonMsg);
 Header header = protonMsg.getHeader();
 assertNotNull("Header section not present", header);
 assertEquals("expected durable value to be present", testDurable, header.getDurable());
 assertEquals("expected priority value to be present", UnsignedByte.valueOf(testPriority), header.getPriority());
 assertEquals("expected ttl value to be present", UnsignedInteger.valueOf(testTtl), header.getTtl());
 assertEquals("expected first acquirer value to be present", testFirstAcquirer, header.getFirstAcquirer());
 assertEquals("expected delivery count value to be present", UnsignedInteger.valueOf(testDeliveryCount),
   header.getDeliveryCount());
}

代码示例来源:origin: org.apache.activemq/artemis-amqp-protocol

@SuppressWarnings("unchecked")
protected static ServerJMSMessage populateMessage(ServerJMSMessage jms, org.apache.qpid.proton.message.Message amqp) throws Exception {
 Header header = amqp.getHeader();
 if (header != null) {
   jms.setBooleanProperty(JMS_AMQP_HEADER, true);

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

message.getWrappedMessage().getHeader().setDeliveryCount(new UnsignedInteger(2));
  sender.send(message);
} finally {

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

if (enforceHeader) {
 message.setDurable(false);
 assertNotNull(message.getWrappedMessage().getHeader());
} else {
 assertNull(message.getWrappedMessage().getHeader());

相关文章