org.apache.activemq.artemis.api.core.Message.getPersistentSize()方法的使用及代码示例

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

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

Message.getPersistentSize介绍

[英]This is the size of the message when persisted on disk which is used for metrics tracking Note that even if the message itself is not persisted on disk (ie non-durable) this value is still used for metrics tracking If a normal message it will be the encoded message size If a large message it will be encoded message size + large message body size
[中]这是保留在磁盘上的消息的大小,用于度量跟踪注意,即使消息本身未保留在磁盘上(即不持久),此值仍用于度量跟踪如果是正常消息,则为编码消息大小如果是大消息,则为编码消息大小+大消息正文大小

代码示例

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

@Override
  public long getPersistentSize() throws ActiveMQException {
   return message.getPersistentSize();
  }
}

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

@Override
  public long getPersistentSize() throws ActiveMQException {
   return this.getMessage().getPersistentSize();
  }
}

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

private static String toString(Object obj, boolean safe) {
 if (obj == null) {
   return "** null **";
 }
 if (safe && !isSafe(obj)) {
   if (obj instanceof MessageDescribe) {
    MessageDescribe describe = (MessageDescribe)obj;
    try {
      return describe.getMsg().getClass().getSimpleName() + "(safe data, size=" + describe.getMsg().getPersistentSize() + ")";
    } catch (Throwable e) {
      e.printStackTrace();
      return describe.getMsg().getClass().getSimpleName() + "(safe data)";
    }
   } else {
    return obj.getClass().getSimpleName() + "(safe data)";
   }
 } else {
   return obj.toString();
 }
}

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

if (safe) {
  try {
   out.print("pg=" + pgid + ", msg=" + msgID + ",pgTX=" + msg.getTransactionID() + ", msg=" + msg.getMessage().getClass().getSimpleName() + "(safe data, size=" + msg.getMessage().getPersistentSize() + ")");
  } catch (Exception e) {
   out.print("pg=" + pgid + ", msg=" + msgID + ",pgTX=" + msg.getTransactionID() + ", msg=" + msg.getMessage().getClass().getSimpleName() + "(safe data)");

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

if (safe) {
 try {
   out.print("pg=" + pgid + ", msg=" + msgID + ",pgTX=" + msg.getTransactionID() + ", msg=" + msg.getMessage().getClass().getSimpleName() + "(safe data, size=" + msg.getMessage().getPersistentSize() + ")");
 } catch (Exception e) {
   out.print("pg=" + pgid + ", msg=" + msgID + ",pgTX=" + msg.getTransactionID() + ", msg=" + msg.getMessage().getClass().getSimpleName() + "(safe data)");

相关文章