Documentation ¶
Index ¶
- Constants
- func CreateMessageID(storeHost *Addr, commitOffset int64) string
- func CreateUniqID() string
- func GetUniqID(properties map[string]string) string
- func IsMessageID(id string) bool
- func Properties2Bytes(properties map[string]string) []byte
- func Properties2String(properties map[string]string) string
- func SortQueue(queues []*Queue)
- func String2Properties(properties string) map[string]string
- type Addr
- type Batch
- type Data
- type Ext
- type GUID
- type Message
- func (m *Message) ClearProperty(k string)
- func (m *Message) GetConsumeStartTimestamp() (timestamp int64, ok bool)
- func (m *Message) GetDelayTimeLevel() int
- func (m *Message) GetProperty(k string) string
- func (m *Message) GetTags() string
- func (m *Message) GetUniqID() string
- func (m *Message) GetWaitStoreMsgOK() bool
- func (m *Message) PutProperty(k, v string)
- func (m *Message) SetConsumeStartTimestamp(timestamp int64)
- func (m *Message) SetDelayTimeLevel(l int)
- func (m *Message) SetKey(keys string)
- func (m *Message) SetKeys(ks []string)
- func (m *Message) SetTags(tags string)
- func (m *Message) SetUniqID(uniqID string)
- func (m *Message) SetWaitStoreMsgOK(ok bool)
- func (m *Message) String() string
- type Queue
Constants ¶
const ( Compress = 1 MultiTags = 1 << 1 TransactionNotType = 0 TransactionPreparedType = 0x1 << 2 TransactionCommitType = 0x2 << 2 TransactionRollbackType = 0x3 << 2 )
predefined tags
const ( PropertyKeys = "KEYS" PropertyTags = "TAGS" PropertyWaitStoreMsgOK = "WAIT" PropertyDelayTimeLevel = "DELAY" PropertyRetryTopic = "RETRY_TOPIC" PropertyRealTopic = "REAL_TOPIC" PropertyRealQueueID = "REAL_QID" PropertyTransactionPrepared = "TRAN_MSG" PropertyProducerGroup = "PGROUP" PropertyMinOffset = "MIN_OFFSET" PropertyMaxOffset = "MAX_OFFSET" PropertyBuyerID = "BUYER_ID" PropertyOriginMessageID = "ORIGIN_MESSAGE_ID" PropertyTransferFlag = "TRANSFER_FLAG" PropertyCorrectionFlag = "CORRECTION_FLAG" PropertyMQ2Flag = "MQ2_FLAG" PropertyReconsumeTime = "RECONSUME_TIME" PropertyMsgRegion = "MSG_REGION" PropertyTraceSwitch = "TRACE_ON" PropertyUniqClientMessageIDKeyidx = "UNIQ_KEY" PropertyMaxReconsumeTimes = "MAX_RECONSUME_TIMES" PropertyConsumeStartTimestamp = "CONSUME_START_TIME" KeySep = " " )
predefined keys
const ( MagicCodePostion = 4 FlagPostion = 16 PhysicOffsetPostion = 28 StoreTimestampPostion = 56 MagicCode = 0xAABBCCDD ^ 1880681586 + 8 BodySizePosition = 4 + 4 + 4 + 4 + 4 + 8 + 8 + 4 + 8 + 8 + 8 + 8 + 4 + 8 /* 14 Prepared Transaction Offset */ NameValueSep = byte(1) PropertySep = byte(2) )
predefined consts
Variables ¶
This section is empty.
Functions ¶
func CreateMessageID ¶
CreateMessageID create id using store host address and the message commited offset returns the string of length 32
func IsMessageID ¶
IsMessageID returns true if the id follows the rules: 1. the length is 32 2. the character is the hex character
func Properties2Bytes ¶
Properties2Bytes converts properties to byte array
func Properties2String ¶
Properties2String converts properties to string
func String2Properties ¶
String2Properties converts string to map
Types ¶
type Addr ¶
Addr the ip address
func ParseMessageID ¶
ParseMessageID parse the id and get the ip address and commit offset
type Ext ¶
type Ext struct { Message StoreSize int32 QueueOffset int64 SysFlag int32 BornTimestamp int64 BornHost Addr StoreTimestamp int64 StoreHost Addr MsgID string CommitLogOffset int64 BodyCRC int32 ReconsumeTimes int32 PreparedTransactionOffset int64 QueueID uint8 }
Ext the message presentation with storage information
type GUID ¶
type GUID struct {
// contains filtered or unexported fields
}
GUID the global unique id generator
type Message ¶
Message the message
func (*Message) ClearProperty ¶
ClearProperty remove the property
func (*Message) GetConsumeStartTimestamp ¶
GetConsumeStartTimestamp returns the property of the consuming start timestamp
func (*Message) GetDelayTimeLevel ¶
GetDelayTimeLevel returns the property of the delay time level
func (*Message) GetProperty ¶
GetProperty get the property byt the specify key
func (*Message) GetWaitStoreMsgOK ¶
GetWaitStoreMsgOK returns the property of the waiting store msag ok
func (*Message) PutProperty ¶
PutProperty update property
func (*Message) SetConsumeStartTimestamp ¶
SetConsumeStartTimestamp update the property of the consuming start timestamp
func (*Message) SetDelayTimeLevel ¶
SetDelayTimeLevel update the property of the delay time level
func (*Message) SetKeys ¶
SetKeys update the property of the keys with multi-value, split with space
func (*Message) SetWaitStoreMsgOK ¶
SetWaitStoreMsgOK update the property of the waiting store msg ok