Versions in this module Expand all Collapse all v2 v2.1.4 Nov 7, 2023 Changes in this version + const ConsumerPull + const ConsumerPush + const DEFAULT_NAMESRV_ADDR + const ExceptionReturn + const FailedReturn + const FlagBornHostV6 + const FlagCompressed + const FlagStoreHostV6 + const MsgIdLength + const NullReturn + const PropCtxType + const PropertyBuyerId + const PropertyCheckImmunityTimeInSeconds + const PropertyCluster + const PropertyConsumeStartTime + const PropertyCorrectionFlag + const PropertyCorrelationID + const PropertyDelayTimeLevel + const PropertyKeySeparator + const PropertyKeys + const PropertyMQ2Flag + const PropertyMaxOffset + const PropertyMaxReconsumeTimes + const PropertyMessageReplyToClient + const PropertyMessageTTL + const PropertyMinOffset + const PropertyMsgRegion + const PropertyMsgType + const PropertyOriginMessageId + const PropertyProducerGroup + const PropertyRealQueueId + const PropertyRealTopic + const PropertyReconsumeTime + const PropertyReplyMessageArriveTime + const PropertyRetryTopic + const PropertyShardingKey + const PropertyTags + const PropertyTraceSwitch + const PropertyTransactionID + const PropertyTransactionPrepared + const PropertyTranscationCheckTimes + const PropertyTranscationPreparedQueueOffset + const PropertyTransferFlag + const PropertyUniqueClientMessageIdKeyIndex + const PropertyWaitStoreMsgOk + const SendAsync + const SendFlushDiskTimeout + const SendFlushSlaveTimeout + const SendOK + const SendOneway + const SendSlaveNotAvailable + const SendSync + const SendUnknownError + const SuccessReturn + const TimeoutReturn + var CompressedFlag = 0x1 + var MultiTagsFlag = 0x1 << 1 + var PanicHandler func(interface{}) + var TransactionCommitType = 0x2 << 2 + var TransactionNotType = 0 + var TransactionPreparedType = 0x1 << 2 + var TransactionRollbackType = 0x3 << 2 + func BackBuffer(b *bytes.Buffer) + func BackHeader(d *[]byte) + func ClearCompressedFlag(flag int) int + func CreateMessageId(addr []byte, port int32, offset int64) string + func CreateUniqID() string + func Diff(origin, latest []string) bool + func GetBuffer() *bytes.Buffer + func GetHeader() *[]byte + func GetTransactionValue(flag int) int + func IsRemotingErr(err error) bool + func NewMQClientErr(code int16, msg string) error + func NewPassthroughResolver(addr []string) *passthroughResolver + func NewRemotingErr(s string) error + func Pid() int16 + func ResetTransactionValue(flag int, typeFlag int) int + func SetCompressedFlag(flag int) int + func WithConcurrentlyCtx(ctx context.Context, c *ConsumeConcurrentlyContext) context.Context + func WithConsumerCtx(ctx context.Context, c *ConsumeMessageContext) context.Context + func WithMethod(ctx context.Context, m CommunicationMode) context.Context + func WithOrderlyCtx(ctx context.Context, c *ConsumeOrderlyContext) context.Context + func WithProducerCtx(ctx context.Context, c *ProducerCtx) context.Context + func WithRecover(fn func()) + type AccessChannel int + const Cloud + const Local + type CommunicationMode string + func GetMethod(ctx context.Context) CommunicationMode + type ConsumeConcurrentlyContext struct + AckIndex int32 + DelayLevelWhenNextConsume int + MQ MessageQueue + func GetConcurrentlyCtx(ctx context.Context) (*ConsumeConcurrentlyContext, bool) + func NewConsumeConcurrentlyContext() *ConsumeConcurrentlyContext + type ConsumeMessageContext struct + ConsumerGroup string + MQ *MessageQueue + Msgs []*MessageExt + Properties map[string]string + Status string + Success bool + func GetConsumerCtx(ctx context.Context) (*ConsumeMessageContext, bool) + type ConsumeOrderlyContext struct + AutoCommit bool + MQ MessageQueue + SuspendCurrentQueueTimeMillis int + func GetOrderlyCtx(ctx context.Context) (*ConsumeOrderlyContext, bool) + func NewConsumeOrderlyContext() *ConsumeOrderlyContext + type ConsumeReturnType string + func (c ConsumeReturnType) Ordinal() int + type Credentials struct + AccessKey string + SecretKey string + SecurityToken string + func (c Credentials) IsEmpty() bool + type CtxKey int + type EnvResolver struct + func NewEnvResolver() *EnvResolver + func (e *EnvResolver) Description() string + func (e *EnvResolver) Resolve() []string + type HttpResolver struct + func NewHttpResolver(instance string, domain ...string) *HttpResolver + func (h *HttpResolver) Description() string + func (h *HttpResolver) DomainWithUnit(unitName string) + func (h *HttpResolver) Resolve() []string + type Interceptor func(ctx context.Context, req, reply interface{}, next Invoker) error + func ChainInterceptors(interceptors ...Interceptor) Interceptor + type Invoker func(ctx context.Context, req, reply interface{}) error + type LocalTransactionState int + const CommitMessageState + const RollbackMessageState + const UnkonwnState + type MQBrokerErr struct + ErrorMessage string + ResponseCode int16 + func (e MQBrokerErr) Error() string + type MQClientErr struct + func (e MQClientErr) Error() string + type Message struct + Batch bool + Body []byte + Compress bool + CompressedBody []byte + Flag int32 + Queue *MessageQueue + Topic string + TransactionId string + func NewMessage(topic string, body []byte) *Message + func (m *Message) GetKeys() string + func (m *Message) GetProperties() map[string]string + func (m *Message) GetProperty(key string) string + func (m *Message) GetShardingKey() string + func (m *Message) GetTags() string + func (m *Message) Marshal() []byte + func (m *Message) MarshallProperties() string + func (m *Message) RemoveProperty(key string) string + func (m *Message) String() string + func (m *Message) UnmarshalProperties(data []byte) + func (m *Message) WithDelayTimeLevel(level int) *Message + func (m *Message) WithKeys(keys []string) *Message + func (m *Message) WithProperties(p map[string]string) + func (m *Message) WithProperty(key, value string) + func (m *Message) WithShardingKey(key string) *Message + func (m *Message) WithTag(tags string) *Message + type MessageExt struct + BodyCRC int32 + BornHost string + BornTimestamp int64 + CommitLogOffset int64 + MsgId string + OffsetMsgId string + PreparedTransactionOffset int64 + QueueOffset int64 + ReconsumeTimes int32 + StoreHost string + StoreSize int32 + StoreTimestamp int64 + SysFlag int32 + func DecodeMessage(data []byte) []*MessageExt + func (msgExt *MessageExt) GetRegionID() string + func (msgExt *MessageExt) GetTags() string + func (msgExt *MessageExt) IsTraceOn() string + func (msgExt *MessageExt) String() string + type MessageID struct + Addr string + Offset int64 + Port int + func UnmarshalMsgID(id []byte) (*MessageID, error) + type MessageQueue struct + BrokerName string + QueueId int + Topic string + func (mq *MessageQueue) HashCode() int + func (mq *MessageQueue) String() string + type MessageType int + const DelayMsg + const NormalMsg + const TransMsgCommit + const TransMsgHalf + type NamesrvAddr []string + func NewNamesrvAddr(s ...string) (NamesrvAddr, error) + func (addr NamesrvAddr) Check() error + type NsResolver interface + Description func() string + Resolve func() []string + type ProducerCtx struct + BornHost string + BrokerAddr string + CommunicationMode CommunicationMode + MQ MessageQueue + Message Message + MsgType MessageType + Namespace string + ProducerGroup string + Props map[string]string + SendResult *SendResult + func GetProducerCtx(ctx context.Context) (*ProducerCtx, bool) + type PullResult struct + MaxOffset int64 + MinOffset int64 + NextBeginOffset int64 + Status PullStatus + SuggestWhichBrokerId int64 + func (result *PullResult) GetBody() []byte + func (result *PullResult) GetMessageExts() []*MessageExt + func (result *PullResult) GetMessages() []*Message + func (result *PullResult) SetBody(data []byte) + func (result *PullResult) SetMessageExts(msgExts []*MessageExt) + func (result *PullResult) String() string + type PullStatus int + const PullBrokerTimeout + const PullFound + const PullNoMsgMatched + const PullNoNewMsg + const PullOffsetIllegal + type RemotingErr struct + func (e *RemotingErr) Error() string + type SendResult struct + MessageQueue *MessageQueue + MsgID string + OffsetMsgID string + QueueOffset int64 + RegionID string + Status SendStatus + TraceOn bool + TransactionID string + func NewSendResult() *SendResult + func (result *SendResult) String() string + type SendStatus int + type StaticResolver struct + type TraceConfig struct + Access AccessChannel + GroupName string + NamesrvAddrs []string + Resolver NsResolver + TraceTopic string + type TransactionListener interface + CheckLocalTransaction func(*MessageExt) LocalTransactionState + ExecuteLocalTransaction func(*Message) LocalTransactionState + type TransactionSendResult struct + State LocalTransactionState