com.alibaba.rocketmq.common.message
类 MessageDecoder

java.lang.Object
  继承者 com.alibaba.rocketmq.common.message.MessageDecoder

public class MessageDecoder
extends Object

消息解码

作者:
shijia.wxr

字段摘要
static int MessageFlagPostion
           
static int MessageMagicCode
           
static int MessageMagicCodePostion
          存储记录各个字段位置
static int MessagePhysicOffsetPostion
           
static int MessageStoreTimestampPostion
           
static int MSG_ID_LENGTH
          消息ID定长
static char NAME_VALUE_SEPARATOR
          序列化消息属性
static char PROPERTY_SEPARATOR
           
 
构造方法摘要
MessageDecoder()
           
 
方法摘要
static String createMessageId(ByteBuffer input, ByteBuffer addr, long offset)
           
static String createMessageId(SocketAddress socketAddress, long transactionIdhashCode)
           
static MessageExt decode(ByteBuffer byteBuffer)
           
static MessageExt decode(ByteBuffer byteBuffer, boolean readBody)
          客户端使用,SLAVE也会使用
static MessageExt decode(ByteBuffer byteBuffer, boolean readBody, boolean deCompressBody)
           
static MessageId decodeMessageId(String msgId)
           
static List<MessageExt> decodes(ByteBuffer byteBuffer)
           
static List<MessageExt> decodes(ByteBuffer byteBuffer, boolean readBody)
          客户端使用
static byte[] encode(MessageExt messageExt)
           
static String messageProperties2String(Map<String,String> properties)
           
static Map<String,String> string2messageProperties(String properties)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

MSG_ID_LENGTH

public static final int MSG_ID_LENGTH
消息ID定长

另请参见:
常量字段值

MessageMagicCodePostion

public static final int MessageMagicCodePostion
存储记录各个字段位置

另请参见:
常量字段值

MessageFlagPostion

public static final int MessageFlagPostion
另请参见:
常量字段值

MessagePhysicOffsetPostion

public static final int MessagePhysicOffsetPostion
另请参见:
常量字段值

MessageStoreTimestampPostion

public static final int MessageStoreTimestampPostion
另请参见:
常量字段值

MessageMagicCode

public static final int MessageMagicCode
另请参见:
常量字段值

NAME_VALUE_SEPARATOR

public static final char NAME_VALUE_SEPARATOR
序列化消息属性

另请参见:
常量字段值

PROPERTY_SEPARATOR

public static final char PROPERTY_SEPARATOR
另请参见:
常量字段值
构造方法详细信息

MessageDecoder

public MessageDecoder()
方法详细信息

createMessageId

public static String createMessageId(ByteBuffer input,
                                     ByteBuffer addr,
                                     long offset)

createMessageId

public static String createMessageId(SocketAddress socketAddress,
                                     long transactionIdhashCode)

decodeMessageId

public static MessageId decodeMessageId(String msgId)
                                 throws UnknownHostException
抛出:
UnknownHostException

decode

public static MessageExt decode(ByteBuffer byteBuffer)

decode

public static MessageExt decode(ByteBuffer byteBuffer,
                                boolean readBody)
客户端使用,SLAVE也会使用


encode

public static byte[] encode(MessageExt messageExt)
                     throws Exception
抛出:
Exception

decode

public static MessageExt decode(ByteBuffer byteBuffer,
                                boolean readBody,
                                boolean deCompressBody)

decodes

public static List<MessageExt> decodes(ByteBuffer byteBuffer)

decodes

public static List<MessageExt> decodes(ByteBuffer byteBuffer,
                                       boolean readBody)
客户端使用


messageProperties2String

public static String messageProperties2String(Map<String,String> properties)

string2messageProperties

public static Map<String,String> string2messageProperties(String properties)


Copyright © 2012-2015. All Rights Reserved.