org.apache.qpid.proton.amqp.messaging.Header.setTtl()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(107)

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

Header.setTtl介绍

暂无

代码示例

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

@Override
public void setTtl(long ttl)
{
  if (_header == null)
  {
    if (ttl != 0l)
    {
      _header = new Header();
    }
    else
    {
      return;
    }
  }
  _header.setTtl(UnsignedInteger.valueOf(ttl));
}

代码示例来源:origin: com.microsoft.azure.iot/proton-j-azure-iot

@Override
public void setTtl(long ttl)
{
  if (_header == null)
  {
    if (ttl != 0l)
    {
      _header = new Header();
    }
    else
    {
      return;
    }
  }
  _header.setTtl(UnsignedInteger.valueOf(ttl));
}

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

@Override
public void setTtl(long ttl)
{
  if (_header == null)
  {
    if (ttl != 0l)
    {
      _header = new Header();
    }
    else
    {
      return;
    }
  }
  _header.setTtl(UnsignedInteger.valueOf(ttl));
}

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

@Override
public void setTtl(long ttl)
{
  if (_header == null)
  {
    if (ttl != 0l)
    {
      _header = new Header();
    }
    else
    {
      return;
    }
  }
  _header.setTtl(UnsignedInteger.valueOf(ttl));
}

代码示例来源:origin: com.microsoft.azure.iot/proton-j-azure-iot

public Header newInstance(Object described)
{
  List l = (List) described;
  Header o = new Header();
  switch(5 - l.size())
  {
    case 0:
      o.setDeliveryCount( (UnsignedInteger) l.get( 4 ) );
    case 1:
      o.setFirstAcquirer( (Boolean) l.get( 3 ) );
    case 2:
      o.setTtl( (UnsignedInteger) l.get( 2 ) );
    case 3:
      o.setPriority( (UnsignedByte) l.get( 1 ) );
    case 4:
      o.setDurable( (Boolean) l.get( 0 ) );
  }
  return o;
}

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

public Header newInstance(Object described)
{
  List l = (List) described;
  Header o = new Header();
  switch(5 - l.size())
  {
    case 0:
      o.setDeliveryCount( (UnsignedInteger) l.get( 4 ) );
    case 1:
      o.setFirstAcquirer( (Boolean) l.get( 3 ) );
    case 2:
      o.setTtl( (UnsignedInteger) l.get( 2 ) );
    case 3:
      o.setPriority( (UnsignedByte) l.get( 1 ) );
    case 4:
      o.setDurable( (Boolean) l.get( 0 ) );
  }
  return o;
}

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

public Header newInstance(Object described)
{
  List l = (List) described;
  Header o = new Header();
  switch(5 - l.size())
  {
    case 0:
      o.setDeliveryCount( (UnsignedInteger) l.get( 4 ) );
    case 1:
      o.setFirstAcquirer( (Boolean) l.get( 3 ) );
    case 2:
      o.setTtl( (UnsignedInteger) l.get( 2 ) );
    case 3:
      o.setPriority( (UnsignedByte) l.get( 1 ) );
    case 4:
      o.setDurable( (Boolean) l.get( 0 ) );
  }
  return o;
}

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

public Header newInstance(Object described)
{
  List l = (List) described;
  Header o = new Header();
  switch(5 - l.size())
  {
    case 0:
      o.setDeliveryCount( (UnsignedInteger) l.get( 4 ) );
    case 1:
      o.setFirstAcquirer( (Boolean) l.get( 3 ) );
    case 2:
      o.setTtl( (UnsignedInteger) l.get( 2 ) );
    case 3:
      o.setPriority( (UnsignedByte) l.get( 1 ) );
    case 4:
      o.setDurable( (Boolean) l.get( 0 ) );
  }
  return o;
}

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

@Override
public AMQPMessage setExpiration(long expiration) {
 if (properties != null) {
   if (expiration <= 0) {
    properties.setAbsoluteExpiryTime(null);
   } else {
    properties.setAbsoluteExpiryTime(new Date(expiration));
   }
 } else if (expiration > 0) {
   properties = new Properties();
   properties.setAbsoluteExpiryTime(new Date(expiration));
 }
 // We are overriding expiration with an Absolute expiration time so any
 // previous Header based TTL also needs to be removed.
 if (header != null) {
   header.setTtl(null);
 }
 this.expiration = Math.max(0, expiration);
 return this;
}

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

public Header getHeader() {
  Header result = null;
  if (!isDefault()) {
    result = new Header();
    result.setDurable(durable);
    result.setPriority(priority);
    result.setFirstAcquirer(firstAcquirer);
    result.setTtl(timeToLive);
    result.setDeliveryCount(deliveryCount);
  }
  return result;
}

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

public Header getHeader() {
  Header result = null;
  if (!isDefault()) {
    result = new Header();
    result.setDurable(durable);
    result.setPriority(priority);
    result.setFirstAcquirer(firstAcquirer);
    result.setTtl(timeToLive);
    result.setDeliveryCount(deliveryCount);
  }
  return result;
}

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

ttl = 1;
header.setTtl(new UnsignedInteger((int)ttl));

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

header = new Header();
header.setTtl(new UnsignedInteger((int) ttl));

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

header = new Header();
header.setTtl(new UnsignedInteger((int) ttl));

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

header = new Header();
header.setTtl(new UnsignedInteger((int) ttl));

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

header = new Header();
header.setTtl(new UnsignedInteger((int) ttl));

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

break;
case 2:
  header.setTtl(decoder.readUnsignedInteger(null));
  break;
case 3:

相关文章