internal

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package internal is a generated GoMock package.

Package internal is a generated GoMock package.

Index

Constants

View Source
const (
	RetryGroupTopicPrefix    = "%RETRY%"
	DefaultConsumerGroup     = "DEFAULT_CONSUMER"
	ClientInnerProducerGroup = "CLIENT_INNER_PRODUCER"
	SystemTopicPrefix        = "rmq_sys_"
	ReplyMessageFlag         = "reply"
	ReplyTopicPostfix        = "REPLY_TOPIC"
)
View Source
const (
	PropNameServerAddr         = "PROP_NAMESERVER_ADDR"
	PropThreadPoolCoreSize     = "PROP_THREADPOOL_CORE_SIZE"
	PropConsumeOrderly         = "PROP_CONSUMEORDERLY"
	PropConsumeType            = "PROP_CONSUME_TYPE"
	PropClientVersion          = "PROP_CLIENT_VERSION"
	PropConsumerStartTimestamp = "PROP_CONSUMER_START_TIMESTAMP"
)
View Source
const (
	ReqSendMessage                   = int16(10)
	ReqPullMessage                   = int16(11)
	ReqQueryMessage                  = int16(12)
	ReqQueryConsumerOffset           = int16(14)
	ReqUpdateConsumerOffset          = int16(15)
	ReqCreateTopic                   = int16(17)
	ReqSearchOffsetByTimestamp       = int16(29)
	ReqGetMaxOffset                  = int16(30)
	ReqGetMinOffset                  = int16(31)
	ReqViewMessageByID               = int16(33)
	ReqHeartBeat                     = int16(34)
	ReqConsumerSendMsgBack           = int16(36)
	ReqENDTransaction                = int16(37)
	ReqGetConsumerListByGroup        = int16(38)
	ReqLockBatchMQ                   = int16(41)
	ReqUnlockBatchMQ                 = int16(42)
	ReqGetRouteInfoByTopic           = int16(105)
	ReqGetBrokerClusterInfo          = int16(106)
	ReqSendBatchMessage              = int16(320)
	ReqCheckTransactionState         = int16(39)
	ReqNotifyConsumerIdsChanged      = int16(40)
	ReqGetAllSubscriptionGroupConfig = int16(201)
	ReqGetAllTopicListFromNameServer = int16(206)
	ReqDeleteTopicInBroker           = int16(215)
	ReqDeleteTopicInNameSrv          = int16(216)
	ReqResetConsumerOffset           = int16(220)
	ReqGetConsumerStatsFromClient    = int16(221)
	ReqGetConsumerRunningInfo        = int16(307)
	ReqConsumeMessageDirectly        = int16(309)
	ReqSendReplyMessage              = int16(324)
	ReqSendReplyMessageV2            = int16(325)
	ReqPushReplyMessageToClient      = int16(326)
)
View Source
const (
	ResSuccess              = int16(0)
	ResError                = int16(1)
	ResFlushDiskTimeout     = int16(10)
	ResSlaveNotAvailable    = int16(11)
	ResFlushSlaveTimeout    = int16(12)
	ResServiceNotAvailable  = int16(14)
	ResNoPermission         = int16(16)
	ResTopicNotExist        = int16(17)
	ResPullNotFound         = int16(19)
	ResPullRetryImmediately = int16(20)
	ResPullOffsetMoved      = int16(21)
	ResQueryNotFound        = int16(22)
)
View Source
const (
	EnvNameServerAddr = "NAMESRV_ADDR"

	MasterId = int64(0)
)
View Source
const (
	RmqSysTraceTopic = "RMQ_SYS_TRACE_TOPIC"

	ProducerType traceDispatcherType = iota
	ConsumerType

	TraceTopicPrefix = SystemTopicPrefix + "TRACE_DATA_"
	TraceGroupName   = "_INNER_TRACE_PRODUCER"
)
View Source
const (
	DEFAULT_NAMESRV_ADDR = "http://jmenv.tbsite.net:8080/rocketmq/nsaddr"
)
View Source
const (
	V4_1_0 = 0
)

Variables

View Source
var (
	ErrNoNameserver = errors.New("nameServerAddrs can't be empty.")
	ErrMultiIP      = errors.New("multiple IP addr does not support")
	ErrIllegalIP    = errors.New("IP addr error")
)
View Source
var (
	ErrServiceState = errors2.ErrService
)
View Source
var RequestResponseFutureMap = NewRequestResponseFutureMap()

Functions

func GetNamesrv

func GetNamesrv(clientId string) (*namesrvs, error)

func GetReplyTopic

func GetReplyTopic(clusterName string) string

func GetRetryTopic

func GetRetryTopic(group string) string

func NewHeartbeatData

func NewHeartbeatData(clientID string) *heartbeatData

func NewNamesrv

func NewNamesrv(resolver primitive.NsResolver, config *remote.RemotingClientConfig) (*namesrvs, error)

NewNamesrv init Namesrv from namesrv addr string. addr primitive.NamesrvAddr

func NewRequestResponseFutureMap

func NewRequestResponseFutureMap() *requestResponseFutureCache

func NewTraceDispatcher

func NewTraceDispatcher(traceCfg *primitive.TraceConfig) *traceDispatcher

func ValidateGroup

func ValidateGroup(group string) error

Types

type BrokerData

type BrokerData struct {
	Cluster         string           `json:"cluster"`
	BrokerName      string           `json:"brokerName"`
	BrokerAddresses map[int64]string `json:"brokerAddrs"`
	// contains filtered or unexported fields
}

BrokerData BrokerData

func (*BrokerData) Equals

func (b *BrokerData) Equals(bd *BrokerData) bool

type CheckTransactionStateCallback

type CheckTransactionStateCallback struct {
	Addr   net.Addr
	Msg    *primitive.MessageExt
	Header CheckTransactionStateRequestHeader
}

remotingClient callback TransactionProducer

type CheckTransactionStateRequestHeader

type CheckTransactionStateRequestHeader struct {
	TranStateTableOffset int64
	CommitLogOffset      int64
	MsgId                string
	TransactionId        string
	OffsetMsgId          string
}

func (*CheckTransactionStateRequestHeader) Decode

func (request *CheckTransactionStateRequestHeader) Decode(properties map[string]string)

func (*CheckTransactionStateRequestHeader) Encode

func (request *CheckTransactionStateRequestHeader) Encode() map[string]string

type ClientOptions

type ClientOptions struct {
	GroupName            string
	NameServerAddrs      primitive.NamesrvAddr
	Namesrv              Namesrvs
	ClientIP             string
	InstanceName         string
	UnitMode             bool
	UnitName             string
	VIPChannelEnabled    bool
	RetryTimes           int
	Interceptors         []primitive.Interceptor
	Credentials          primitive.Credentials
	Namespace            string
	Resolver             primitive.NsResolver
	RemotingClientConfig *remote.RemotingClientConfig
}

func DefaultClientOptions

func DefaultClientOptions() ClientOptions

func (*ClientOptions) ChangeInstanceNameToPID

func (opt *ClientOptions) ChangeInstanceNameToPID()

func (*ClientOptions) String

func (opt *ClientOptions) String() string

type ConsumeMessageDirectlyHeader

type ConsumeMessageDirectlyHeader struct {
	// contains filtered or unexported fields
}

func (*ConsumeMessageDirectlyHeader) Decode

func (request *ConsumeMessageDirectlyHeader) Decode(properties map[string]string)

func (*ConsumeMessageDirectlyHeader) Encode

func (request *ConsumeMessageDirectlyHeader) Encode() map[string]string

type ConsumeMessageDirectlyResult

type ConsumeMessageDirectlyResult struct {
	Order          bool          `json:"order"`
	AutoCommit     bool          `json:"autoCommit"`
	ConsumeResult  ConsumeResult `json:"consumeResult"`
	Remark         string        `json:"remark"`
	SpentTimeMills int64         `json:"spentTimeMills"`
}

func (ConsumeMessageDirectlyResult) Encode

func (result ConsumeMessageDirectlyResult) Encode() ([]byte, error)

type ConsumeResult

type ConsumeResult int
const (
	ConsumeSuccess ConsumeResult = iota
	ConsumeRetryLater
	Rollback
	Commit
	ThrowException
	ReturnNull
)

type ConsumeStatus

type ConsumeStatus struct {
	PullRT            float64 `json:"pullRT"`
	PullTPS           float64 `json:"pullTPS"`
	ConsumeRT         float64 `json:"consumeRT"`
	ConsumeOKTPS      float64 `json:"consumeOKTPS"`
	ConsumeFailedTPS  float64 `json:"consumeFailedTPS"`
	ConsumeFailedMsgs int64   `json:"consumeFailedMsgs"`
}

type ConsumerRunningInfo

type ConsumerRunningInfo struct {
	Properties       map[string]string
	SubscriptionData map[*SubscriptionData]bool
	MQTable          map[primitive.MessageQueue]ProcessQueueInfo
	StatusTable      map[string]ConsumeStatus
	JStack           string // just follow java request param name, but pass golang stack here.
}

func NewConsumerRunningInfo

func NewConsumerRunningInfo() *ConsumerRunningInfo

func (ConsumerRunningInfo) Encode

func (info ConsumerRunningInfo) Encode() ([]byte, error)

type ConsumerSendMsgBackRequestHeader

type ConsumerSendMsgBackRequestHeader struct {
	Group             string
	Offset            int64
	DelayLevel        int
	OriginMsgId       string
	OriginTopic       string
	UnitMode          bool
	MaxReconsumeTimes int32
}

func (*ConsumerSendMsgBackRequestHeader) Encode

func (request *ConsumerSendMsgBackRequestHeader) Encode() map[string]string

type ConsumerStatus

type ConsumerStatus struct {
	MQOffsetMap map[primitive.MessageQueue]int64
}

func NewConsumerStatus

func NewConsumerStatus() *ConsumerStatus

func (ConsumerStatus) Encode

func (status ConsumerStatus) Encode() ([]byte, error)

type CreateTopicRequestHeader

type CreateTopicRequestHeader struct {
	Topic           string
	DefaultTopic    string
	ReadQueueNums   int
	WriteQueueNums  int
	Perm            int
	TopicFilterType string
	TopicSysFlag    int
	Order           bool
}

func (*CreateTopicRequestHeader) Encode

func (request *CreateTopicRequestHeader) Encode() map[string]string

type DeleteTopicRequestHeader

type DeleteTopicRequestHeader struct {
	Topic string
}

func (*DeleteTopicRequestHeader) Encode

func (request *DeleteTopicRequestHeader) Encode() map[string]string

type EndTransactionRequestHeader

type EndTransactionRequestHeader struct {
	ProducerGroup        string
	TranStateTableOffset int64
	CommitLogOffset      int64
	CommitOrRollback     int
	FromTransactionCheck bool
	MsgID                string
	TransactionId        string
}

func (*EndTransactionRequestHeader) Encode

func (request *EndTransactionRequestHeader) Encode() map[string]string

type FindBrokerResult

type FindBrokerResult struct {
	BrokerAddr    string
	Slave         bool
	BrokerVersion int32
}

type GetConsumerListRequestHeader

type GetConsumerListRequestHeader struct {
	ConsumerGroup string `json:"consumerGroup"`
}

func (*GetConsumerListRequestHeader) Encode

func (request *GetConsumerListRequestHeader) Encode() map[string]string

type GetConsumerRunningInfoHeader

type GetConsumerRunningInfoHeader struct {
	// contains filtered or unexported fields
}

func (*GetConsumerRunningInfoHeader) Decode

func (request *GetConsumerRunningInfoHeader) Decode(properties map[string]string)

func (*GetConsumerRunningInfoHeader) Encode

func (request *GetConsumerRunningInfoHeader) Encode() map[string]string

type GetConsumerStatusRequestHeader

type GetConsumerStatusRequestHeader struct {
	// contains filtered or unexported fields
}

func (*GetConsumerStatusRequestHeader) Decode

func (request *GetConsumerStatusRequestHeader) Decode(properties map[string]string)

func (*GetConsumerStatusRequestHeader) Encode

func (request *GetConsumerStatusRequestHeader) Encode() map[string]string

type GetMaxOffsetRequestHeader

type GetMaxOffsetRequestHeader struct {
	Topic   string
	QueueId int
}

func (*GetMaxOffsetRequestHeader) Encode

func (request *GetMaxOffsetRequestHeader) Encode() map[string]string

type GetRouteInfoRequestHeader

type GetRouteInfoRequestHeader struct {
	Topic string
}

func (*GetRouteInfoRequestHeader) Encode

func (request *GetRouteInfoRequestHeader) Encode() map[string]string

type InnerConsumer

type InnerConsumer interface {
	PersistConsumerOffset() error
	UpdateTopicSubscribeInfo(topic string, mqs []*primitive.MessageQueue)
	IsSubscribeTopicNeedUpdate(topic string) bool
	SubscriptionDataList() []*SubscriptionData
	Rebalance()
	RebalanceIfNotPaused()
	IsUnitMode() bool
	GetConsumerRunningInfo(stack bool) *ConsumerRunningInfo
	ConsumeMessageDirectly(msg *primitive.MessageExt, brokerName string) *ConsumeMessageDirectlyResult
	GetcType() string
	GetModel() string
	GetWhere() string
	ResetOffset(topic string, table map[primitive.MessageQueue]int64)
	GetConsumerStatus(topic string) *ConsumerStatus
}

type InnerProducer

type InnerProducer interface {
	PublishTopicList() []string
	UpdateTopicPublishInfo(topic string, info *TopicPublishInfo)
	IsPublishTopicNeedUpdate(topic string) bool
	IsUnitMode() bool
}

type Keyset

type Keyset map[string]struct{}

type MockInnerConsumer

type MockInnerConsumer struct {
	// contains filtered or unexported fields
}

MockInnerConsumer is a mock of InnerConsumer interface

func NewMockInnerConsumer

func NewMockInnerConsumer(ctrl *gomock.Controller) *MockInnerConsumer

NewMockInnerConsumer creates a new mock instance

func (*MockInnerConsumer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockInnerConsumer) GetConsumerRunningInfo

func (m *MockInnerConsumer) GetConsumerRunningInfo() *ConsumerRunningInfo

GetConsumerRunningInfo mocks base method

func (*MockInnerConsumer) IsSubscribeTopicNeedUpdate

func (m *MockInnerConsumer) IsSubscribeTopicNeedUpdate(topic string) bool

IsSubscribeTopicNeedUpdate mocks base method

func (*MockInnerConsumer) IsUnitMode

func (m *MockInnerConsumer) IsUnitMode() bool

IsUnitMode mocks base method

func (*MockInnerConsumer) PersistConsumerOffset

func (m *MockInnerConsumer) PersistConsumerOffset() error

PersistConsumerOffset mocks base method

func (*MockInnerConsumer) Rebalance

func (m *MockInnerConsumer) Rebalance()

Rebalance mocks base method

func (*MockInnerConsumer) SubscriptionDataList

func (m *MockInnerConsumer) SubscriptionDataList() []*SubscriptionData

SubscriptionDataList mocks base method

func (*MockInnerConsumer) UpdateTopicSubscribeInfo

func (m *MockInnerConsumer) UpdateTopicSubscribeInfo(topic string, mqs []*primitive.MessageQueue)

UpdateTopicSubscribeInfo mocks base method

type MockInnerConsumerMockRecorder

type MockInnerConsumerMockRecorder struct {
	// contains filtered or unexported fields
}

MockInnerConsumerMockRecorder is the mock recorder for MockInnerConsumer

func (*MockInnerConsumerMockRecorder) GetConsumerRunningInfo

func (mr *MockInnerConsumerMockRecorder) GetConsumerRunningInfo() *gomock.Call

GetConsumerRunningInfo indicates an expected call of GetConsumerRunningInfo

func (*MockInnerConsumerMockRecorder) IsSubscribeTopicNeedUpdate

func (mr *MockInnerConsumerMockRecorder) IsSubscribeTopicNeedUpdate(topic interface{}) *gomock.Call

IsSubscribeTopicNeedUpdate indicates an expected call of IsSubscribeTopicNeedUpdate

func (*MockInnerConsumerMockRecorder) IsUnitMode

func (mr *MockInnerConsumerMockRecorder) IsUnitMode() *gomock.Call

IsUnitMode indicates an expected call of IsUnitMode

func (*MockInnerConsumerMockRecorder) PersistConsumerOffset

func (mr *MockInnerConsumerMockRecorder) PersistConsumerOffset() *gomock.Call

PersistConsumerOffset indicates an expected call of PersistConsumerOffset

func (*MockInnerConsumerMockRecorder) Rebalance

func (mr *MockInnerConsumerMockRecorder) Rebalance() *gomock.Call

Rebalance indicates an expected call of Rebalance

func (*MockInnerConsumerMockRecorder) SubscriptionDataList

func (mr *MockInnerConsumerMockRecorder) SubscriptionDataList() *gomock.Call

SubscriptionDataList indicates an expected call of SubscriptionDataList

func (*MockInnerConsumerMockRecorder) UpdateTopicSubscribeInfo

func (mr *MockInnerConsumerMockRecorder) UpdateTopicSubscribeInfo(topic, mqs interface{}) *gomock.Call

UpdateTopicSubscribeInfo indicates an expected call of UpdateTopicSubscribeInfo

type MockInnerProducer

type MockInnerProducer struct {
	// contains filtered or unexported fields
}

MockInnerProducer is a mock of InnerProducer interface

func NewMockInnerProducer

func NewMockInnerProducer(ctrl *gomock.Controller) *MockInnerProducer

NewMockInnerProducer creates a new mock instance

func (*MockInnerProducer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockInnerProducer) IsPublishTopicNeedUpdate

func (m *MockInnerProducer) IsPublishTopicNeedUpdate(topic string) bool

IsPublishTopicNeedUpdate mocks base method

func (*MockInnerProducer) IsUnitMode

func (m *MockInnerProducer) IsUnitMode() bool

IsUnitMode mocks base method

func (*MockInnerProducer) PublishTopicList

func (m *MockInnerProducer) PublishTopicList() []string

PublishTopicList mocks base method

func (*MockInnerProducer) UpdateTopicPublishInfo

func (m *MockInnerProducer) UpdateTopicPublishInfo(topic string, info *TopicPublishInfo)

UpdateTopicPublishInfo mocks base method

type MockInnerProducerMockRecorder

type MockInnerProducerMockRecorder struct {
	// contains filtered or unexported fields
}

MockInnerProducerMockRecorder is the mock recorder for MockInnerProducer

func (*MockInnerProducerMockRecorder) IsPublishTopicNeedUpdate

func (mr *MockInnerProducerMockRecorder) IsPublishTopicNeedUpdate(topic interface{}) *gomock.Call

IsPublishTopicNeedUpdate indicates an expected call of IsPublishTopicNeedUpdate

func (*MockInnerProducerMockRecorder) IsUnitMode

func (mr *MockInnerProducerMockRecorder) IsUnitMode() *gomock.Call

IsUnitMode indicates an expected call of IsUnitMode

func (*MockInnerProducerMockRecorder) PublishTopicList

func (mr *MockInnerProducerMockRecorder) PublishTopicList() *gomock.Call

PublishTopicList indicates an expected call of PublishTopicList

func (*MockInnerProducerMockRecorder) UpdateTopicPublishInfo

func (mr *MockInnerProducerMockRecorder) UpdateTopicPublishInfo(topic, info interface{}) *gomock.Call

UpdateTopicPublishInfo indicates an expected call of UpdateTopicPublishInfo

type MockNamesrvs

type MockNamesrvs struct {
	// contains filtered or unexported fields
}

MockNamesrvs is a mock of Namesrvs interface

func NewMockNamesrvs

func NewMockNamesrvs(ctrl *gomock.Controller) *MockNamesrvs

NewMockNamesrvs creates a new mock instance

func (*MockNamesrvs) AddBroker

func (m *MockNamesrvs) AddBroker(routeData *TopicRouteData)

AddBroker mocks base method

func (*MockNamesrvs) AddrList

func (m *MockNamesrvs) AddrList() []string

AddrList mocks base method

func (*MockNamesrvs) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockNamesrvs) FetchPublishMessageQueues

func (m *MockNamesrvs) FetchPublishMessageQueues(topic string) ([]*primitive.MessageQueue, error)

FetchPublishMessageQueues mocks base method

func (*MockNamesrvs) FetchSubscribeMessageQueues

func (m *MockNamesrvs) FetchSubscribeMessageQueues(topic string) ([]*primitive.MessageQueue, error)

FetchSubscribeMessageQueues mocks base method

func (*MockNamesrvs) FindBrokerAddrByName

func (m *MockNamesrvs) FindBrokerAddrByName(brokerName string) string

FindBrokerAddrByName mocks base method

func (*MockNamesrvs) FindBrokerAddrByTopic

func (m *MockNamesrvs) FindBrokerAddrByTopic(topic string) string

FindBrokerAddrByTopic mocks base method

func (*MockNamesrvs) FindBrokerAddressInSubscribe

func (m *MockNamesrvs) FindBrokerAddressInSubscribe(brokerName string, brokerId int64, onlyThisBroker bool) *FindBrokerResult

FindBrokerAddressInSubscribe mocks base method

func (*MockNamesrvs) UpdateNameServerAddress

func (m *MockNamesrvs) UpdateNameServerAddress()

UpdateNameServerAddress mocks base method

func (*MockNamesrvs) UpdateTopicRouteInfo

func (m *MockNamesrvs) UpdateTopicRouteInfo(topic string) (*TopicRouteData, bool, error)

UpdateTopicRouteInfo mocks base method

func (*MockNamesrvs) UpdateTopicRouteInfoWithDefault

func (m *MockNamesrvs) UpdateTopicRouteInfoWithDefault(topic string, defaultTopic string, defaultQueueNum int) (*TopicRouteData, bool, error)

type MockNamesrvsMockRecorder

type MockNamesrvsMockRecorder struct {
	// contains filtered or unexported fields
}

MockNamesrvsMockRecorder is the mock recorder for MockNamesrvs

func (*MockNamesrvsMockRecorder) AddBroker

func (mr *MockNamesrvsMockRecorder) AddBroker(routeData interface{}) *gomock.Call

AddBroker indicates an expected call of AddBroker

func (*MockNamesrvsMockRecorder) AddrList

func (mr *MockNamesrvsMockRecorder) AddrList() *gomock.Call

AddrList indicates an expected call of AddrList

func (*MockNamesrvsMockRecorder) FetchPublishMessageQueues

func (mr *MockNamesrvsMockRecorder) FetchPublishMessageQueues(topic interface{}) *gomock.Call

FetchPublishMessageQueues indicates an expected call of FetchPublishMessageQueues

func (*MockNamesrvsMockRecorder) FetchSubscribeMessageQueues

func (mr *MockNamesrvsMockRecorder) FetchSubscribeMessageQueues(topic interface{}) *gomock.Call

FetchSubscribeMessageQueues indicates an expected call of FetchSubscribeMessageQueues

func (*MockNamesrvsMockRecorder) FindBrokerAddrByName

func (mr *MockNamesrvsMockRecorder) FindBrokerAddrByName(brokerName interface{}) *gomock.Call

FindBrokerAddrByName indicates an expected call of FindBrokerAddrByName

func (*MockNamesrvsMockRecorder) FindBrokerAddrByTopic

func (mr *MockNamesrvsMockRecorder) FindBrokerAddrByTopic(topic interface{}) *gomock.Call

FindBrokerAddrByTopic indicates an expected call of FindBrokerAddrByTopic

func (*MockNamesrvsMockRecorder) FindBrokerAddressInSubscribe

func (mr *MockNamesrvsMockRecorder) FindBrokerAddressInSubscribe(brokerName, brokerId, onlyThisBroker interface{}) *gomock.Call

FindBrokerAddressInSubscribe indicates an expected call of FindBrokerAddressInSubscribe

func (*MockNamesrvsMockRecorder) UpdateNameServerAddress

func (mr *MockNamesrvsMockRecorder) UpdateNameServerAddress() *gomock.Call

UpdateNameServerAddress indicates an expected call of UpdateNameServerAddress

func (*MockNamesrvsMockRecorder) UpdateTopicRouteInfo

func (mr *MockNamesrvsMockRecorder) UpdateTopicRouteInfo(topic interface{}) *gomock.Call

UpdateTopicRouteInfo indicates an expected call of UpdateTopicRouteInfo

type MockRMQClient

type MockRMQClient struct {
	Namesrv *MockNamesrvs
	// contains filtered or unexported fields
}

MockRMQClient is a mock of RMQClient interface

func NewMockRMQClient

func NewMockRMQClient(ctrl *gomock.Controller) *MockRMQClient

NewMockRMQClient creates a new mock instance

func (*MockRMQClient) CheckClientInBroker

func (m *MockRMQClient) CheckClientInBroker()

CheckClientInBroker mocks base method

func (*MockRMQClient) ClientID

func (m *MockRMQClient) ClientID() string

ClientID mocks base method

func (*MockRMQClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockRMQClient) GetNameSrv

func (m *MockRMQClient) GetNameSrv() Namesrvs

func (*MockRMQClient) InvokeAsync

func (m *MockRMQClient) InvokeAsync(ctx context.Context, addr string, request *remote.RemotingCommand, f func(*remote.RemotingCommand, error)) error

InvokeAsync mocks base method

func (*MockRMQClient) InvokeOneWay

func (m *MockRMQClient) InvokeOneWay(ctx context.Context, addr string, request *remote.RemotingCommand, timeoutMillis time.Duration) error

InvokeOneWay mocks base method

func (*MockRMQClient) InvokeSync

func (m *MockRMQClient) InvokeSync(ctx context.Context, addr string, request *remote.RemotingCommand, timeoutMillis time.Duration) (*remote.RemotingCommand, error)

InvokeSync mocks base method

func (*MockRMQClient) ProcessSendResponse

func (m *MockRMQClient) ProcessSendResponse(brokerName string, cmd *remote.RemotingCommand, resp *primitive.SendResult, msgs ...*primitive.Message) error

ProcessSendResponse mocks base method

func (*MockRMQClient) PullMessage

func (m *MockRMQClient) PullMessage(ctx context.Context, brokerAddrs string, request *PullMessageRequestHeader) (*primitive.PullResult, error)

PullMessage mocks base method

func (*MockRMQClient) RebalanceImmediately

func (m *MockRMQClient) RebalanceImmediately()

RebalanceImmediately mocks base method

func (*MockRMQClient) RegisterACL

func (m *MockRMQClient) RegisterACL()

RegisterACL mocks base method

func (*MockRMQClient) RegisterConsumer

func (m *MockRMQClient) RegisterConsumer(group string, consumer InnerConsumer) error

RegisterConsumer mocks base method

func (*MockRMQClient) RegisterProducer

func (m *MockRMQClient) RegisterProducer(group string, producer InnerProducer) error

RegisterProducer mocks base method

func (*MockRMQClient) SendHeartbeatToAllBrokerWithLock

func (m *MockRMQClient) SendHeartbeatToAllBrokerWithLock()

SendHeartbeatToAllBrokerWithLock mocks base method

func (*MockRMQClient) SetNameSrv

func (m *MockRMQClient) SetNameSrv(mockNamesrvs *MockNamesrvs)

func (*MockRMQClient) Shutdown

func (m *MockRMQClient) Shutdown()

Shutdown mocks base method

func (*MockRMQClient) Start

func (m *MockRMQClient) Start()

Start mocks base method

func (*MockRMQClient) UnregisterConsumer

func (m *MockRMQClient) UnregisterConsumer(group string)

UnregisterConsumer mocks base method

func (*MockRMQClient) UnregisterProducer

func (m *MockRMQClient) UnregisterProducer(group string)

UnregisterProducer mocks base method

func (*MockRMQClient) UpdatePublishInfo

func (m *MockRMQClient) UpdatePublishInfo(topic string, data *TopicRouteData, changed bool)

UpdatePublishInfo mocks base method

func (*MockRMQClient) UpdateTopicRouteInfo

func (m *MockRMQClient) UpdateTopicRouteInfo()

UpdateTopicRouteInfo mocks base method

type MockRMQClientMockRecorder

type MockRMQClientMockRecorder struct {
	// contains filtered or unexported fields
}

MockRMQClientMockRecorder is the mock recorder for MockRMQClient

func (*MockRMQClientMockRecorder) CheckClientInBroker

func (mr *MockRMQClientMockRecorder) CheckClientInBroker() *gomock.Call

CheckClientInBroker indicates an expected call of CheckClientInBroker

func (*MockRMQClientMockRecorder) ClientID

func (mr *MockRMQClientMockRecorder) ClientID() *gomock.Call

ClientID indicates an expected call of ClientID

func (*MockRMQClientMockRecorder) InvokeAsync

func (mr *MockRMQClientMockRecorder) InvokeAsync(ctx, addr, request, f interface{}) *gomock.Call

InvokeAsync indicates an expected call of InvokeAsync

func (*MockRMQClientMockRecorder) InvokeOneWay

func (mr *MockRMQClientMockRecorder) InvokeOneWay(ctx, addr, request, timeoutMillis interface{}) *gomock.Call

InvokeOneWay indicates an expected call of InvokeOneWay

func (*MockRMQClientMockRecorder) InvokeSync

func (mr *MockRMQClientMockRecorder) InvokeSync(ctx, addr, request, timeoutMillis interface{}) *gomock.Call

InvokeSync indicates an expected call of InvokeSync

func (*MockRMQClientMockRecorder) ProcessSendResponse

func (mr *MockRMQClientMockRecorder) ProcessSendResponse(brokerName, cmd, resp interface{}, msgs ...interface{}) *gomock.Call

ProcessSendResponse indicates an expected call of ProcessSendResponse

func (*MockRMQClientMockRecorder) PullMessage

func (mr *MockRMQClientMockRecorder) PullMessage(ctx, brokerAddrs, request interface{}) *gomock.Call

PullMessage indicates an expected call of PullMessage

func (*MockRMQClientMockRecorder) RebalanceImmediately

func (mr *MockRMQClientMockRecorder) RebalanceImmediately() *gomock.Call

RebalanceImmediately indicates an expected call of RebalanceImmediately

func (*MockRMQClientMockRecorder) RegisterConsumer

func (mr *MockRMQClientMockRecorder) RegisterConsumer(group, consumer interface{}) *gomock.Call

RegisterConsumer indicates an expected call of RegisterConsumer

func (*MockRMQClientMockRecorder) RegisterProducer

func (mr *MockRMQClientMockRecorder) RegisterProducer(group, producer interface{}) *gomock.Call

RegisterProducer indicates an expected call of RegisterProducer

func (*MockRMQClientMockRecorder) SendHeartbeatToAllBrokerWithLock

func (mr *MockRMQClientMockRecorder) SendHeartbeatToAllBrokerWithLock() *gomock.Call

SendHeartbeatToAllBrokerWithLock indicates an expected call of SendHeartbeatToAllBrokerWithLock

func (*MockRMQClientMockRecorder) Shutdown

func (mr *MockRMQClientMockRecorder) Shutdown() *gomock.Call

Shutdown indicates an expected call of Shutdown

func (*MockRMQClientMockRecorder) Start

func (mr *MockRMQClientMockRecorder) Start() *gomock.Call

Start indicates an expected call of Start

func (*MockRMQClientMockRecorder) UnregisterConsumer

func (mr *MockRMQClientMockRecorder) UnregisterConsumer(group interface{}) *gomock.Call

UnregisterConsumer indicates an expected call of UnregisterConsumer

func (*MockRMQClientMockRecorder) UnregisterProducer

func (mr *MockRMQClientMockRecorder) UnregisterProducer(group interface{}) *gomock.Call

UnregisterProducer indicates an expected call of UnregisterProducer

func (*MockRMQClientMockRecorder) UpdatePublishInfo

func (mr *MockRMQClientMockRecorder) UpdatePublishInfo(topic, data, changed interface{}) *gomock.Call

UpdatePublishInfo indicates an expected call of UpdatePublishInfo

func (*MockRMQClientMockRecorder) UpdateTopicRouteInfo

func (mr *MockRMQClientMockRecorder) UpdateTopicRouteInfo() *gomock.Call

UpdateTopicRouteInfo indicates an expected call of UpdateTopicRouteInfo

type Namesrvs

type Namesrvs interface {
	UpdateNameServerAddress()

	AddBroker(routeData *TopicRouteData)

	UpdateTopicRouteInfo(topic string) (routeData *TopicRouteData, changed bool, err error)

	UpdateTopicRouteInfoWithDefault(topic string, defaultTopic string, defaultQueueNum int) (*TopicRouteData, bool, error)

	FetchPublishMessageQueues(topic string) ([]*primitive.MessageQueue, error)

	FindBrokerAddrByTopic(topic string) string

	FindBrokerAddrByName(brokerName string) string

	FindBrokerAddressInSubscribe(brokerName string, brokerId int64, onlyThisBroker bool) *FindBrokerResult

	FetchSubscribeMessageQueues(topic string) ([]*primitive.MessageQueue, error)

	AddrList() []string
	// contains filtered or unexported methods
}

type ProcessQueueInfo

type ProcessQueueInfo struct {
	CommitOffset            int64 `json:"commitOffset"`
	CachedMsgMinOffset      int64 `json:"cachedMsgMinOffset"`
	CachedMsgMaxOffset      int64 `json:"cachedMsgMaxOffset"`
	CachedMsgCount          int   `json:"cachedMsgCount"`
	CachedMsgSizeInMiB      int64 `json:"cachedMsgSizeInMiB"`
	TransactionMsgMinOffset int64 `json:"transactionMsgMinOffset"`
	TransactionMsgMaxOffset int64 `json:"transactionMsgMaxOffset"`
	TransactionMsgCount     int   `json:"transactionMsgCount"`
	Locked                  bool  `json:"locked"`
	TryUnlockTimes          int64 `json:"tryUnlockTimes"`
	LastLockTimestamp       int64 `json:"lastLockTimestamp"`
	Dropped                 bool  `json:"dropped"`
	LastPullTimestamp       int64 `json:"lastPullTimestamp"`
	LastConsumeTimestamp    int64 `json:"lastConsumeTimestamp"`
}

type PullMessageRequestHeader

type PullMessageRequestHeader struct {
	ConsumerGroup        string
	Topic                string
	QueueId              int32
	QueueOffset          int64
	MaxMsgNums           int32
	SysFlag              int32
	CommitOffset         int64
	SuspendTimeoutMillis time.Duration
	SubExpression        string
	SubVersion           int64
	ExpressionType       string
}

func (*PullMessageRequestHeader) Encode

func (request *PullMessageRequestHeader) Encode() map[string]string

type PullMessageResponse

type PullMessageResponse struct {
	SuggestWhichBrokerId int64
	NextBeginOffset      int64
	MinOffset            int64
	MaxOffset            int64
}

type QueryConsumerOffsetRequestHeader

type QueryConsumerOffsetRequestHeader struct {
	ConsumerGroup string
	Topic         string
	QueueId       int
}

func (*QueryConsumerOffsetRequestHeader) Encode

func (request *QueryConsumerOffsetRequestHeader) Encode() map[string]string

type QueryMessageRequestHeader

type QueryMessageRequestHeader struct {
	Topic          string
	Key            string
	MaxNum         int
	BeginTimestamp int64
	EndTimestamp   int64
}

func (*QueryMessageRequestHeader) Decode

func (request *QueryMessageRequestHeader) Decode(properties map[string]string) error

func (*QueryMessageRequestHeader) Encode

func (request *QueryMessageRequestHeader) Encode() map[string]string

type QueueData

type QueueData struct {
	BrokerName     string `json:"brokerName"`
	ReadQueueNums  int    `json:"readQueueNums"`
	WriteQueueNums int    `json:"writeQueueNums"`
	Perm           int    `json:"perm"`
	TopicSynFlag   int    `json:"topicSynFlag"`
}

QueueData QueueData

func (*QueueData) Equals

func (q *QueueData) Equals(qd *QueueData) bool

type RMQClient

type RMQClient interface {
	Start()
	Shutdown()

	ClientID() string

	RegisterProducer(group string, producer InnerProducer) error
	UnregisterProducer(group string)
	InvokeSync(ctx context.Context, addr string, request *remote.RemotingCommand,
		timeoutMillis time.Duration) (*remote.RemotingCommand, error)
	InvokeAsync(ctx context.Context, addr string, request *remote.RemotingCommand,
		f func(*remote.RemotingCommand, error)) error
	InvokeOneWay(ctx context.Context, addr string, request *remote.RemotingCommand,
		timeoutMillis time.Duration) error
	CheckClientInBroker()
	SendHeartbeatToAllBrokerWithLock()
	UpdateTopicRouteInfo()

	ProcessSendResponse(brokerName string, cmd *remote.RemotingCommand, resp *primitive.SendResult, msgs ...*primitive.Message) error

	RegisterConsumer(group string, consumer InnerConsumer) error
	UnregisterConsumer(group string)
	PullMessage(ctx context.Context, brokerAddrs string, request *PullMessageRequestHeader) (*primitive.PullResult, error)
	RebalanceImmediately()
	UpdatePublishInfo(topic string, data *TopicRouteData, changed bool)

	GetNameSrv() Namesrvs
	RegisterACL()
}

func GetOrNewRocketMQClient

func GetOrNewRocketMQClient(option ClientOptions, callbackCh chan interface{}) RMQClient

type ReplyMessageRequestHeader

type ReplyMessageRequestHeader struct {
	// contains filtered or unexported fields
}

func (*ReplyMessageRequestHeader) Decode

func (request *ReplyMessageRequestHeader) Decode(properties map[string]string)

func (*ReplyMessageRequestHeader) Encode

func (request *ReplyMessageRequestHeader) Encode() map[string]string

type RequestCallback

type RequestCallback func(ctx context.Context, msg *primitive.Message, err error)

type RequestResponseFuture

type RequestResponseFuture struct {
	CorrelationId string

	ResponseMsg     *primitive.Message
	Timeout         time.Duration
	RequestCallback RequestCallback
	SendRequestOk   bool
	Done            chan struct{}
	CauseErr        error
	BeginTime       time.Time
	// contains filtered or unexported fields
}

RequestResponseFuture store the rpc request. When producer wait for the response, get RequestResponseFuture.

func NewRequestResponseFuture

func NewRequestResponseFuture(correlationId string, timeout time.Duration, callback RequestCallback) *RequestResponseFuture

func (*RequestResponseFuture) ExecuteRequestCallback

func (rf *RequestResponseFuture) ExecuteRequestCallback()

func (*RequestResponseFuture) IsTimeout

func (rf *RequestResponseFuture) IsTimeout() bool

func (*RequestResponseFuture) PutResponseMessage

func (rf *RequestResponseFuture) PutResponseMessage(message *primitive.Message)

func (*RequestResponseFuture) WaitResponseMessage

func (rf *RequestResponseFuture) WaitResponseMessage(reqMsg *primitive.Message) (*primitive.Message, error)

type ResetOffsetBody

type ResetOffsetBody struct {
	OffsetTable map[primitive.MessageQueue]int64 `json:"offsetTable"`
}

func (*ResetOffsetBody) Decode

func (resetOffsetBody *ResetOffsetBody) Decode(body []byte)

Decode note: the origin implementation for parse json is in gson format. this func should support both gson and fastjson schema.

type ResetOffsetHeader

type ResetOffsetHeader struct {
	// contains filtered or unexported fields
}

func (*ResetOffsetHeader) Decode

func (request *ResetOffsetHeader) Decode(properties map[string]string)

func (*ResetOffsetHeader) Encode

func (request *ResetOffsetHeader) Encode() map[string]string

type SearchOffsetRequestHeader

type SearchOffsetRequestHeader struct {
	Topic     string
	QueueId   int
	Timestamp int64
}

func (*SearchOffsetRequestHeader) Encode

func (request *SearchOffsetRequestHeader) Encode() map[string]string

type SendMessageRequestHeader

type SendMessageRequestHeader struct {
	ProducerGroup         string
	Topic                 string
	QueueId               int
	SysFlag               int
	BornTimestamp         int64
	Flag                  int32
	Properties            string
	ReconsumeTimes        int
	UnitMode              bool
	MaxReconsumeTimes     int
	Batch                 bool
	DefaultTopic          string
	DefaultTopicQueueNums int
}

func (*SendMessageRequestHeader) Encode

func (request *SendMessageRequestHeader) Encode() map[string]string

type SendMessageRequestV2Header

type SendMessageRequestV2Header struct {
	*SendMessageRequestHeader
}

func (*SendMessageRequestV2Header) Encode

func (request *SendMessageRequestV2Header) Encode() map[string]string

type SendMessageResponse

type SendMessageResponse struct {
	MsgId         string
	QueueId       int32
	QueueOffset   int64
	TransactionId string
	MsgRegion     string
}

func (*SendMessageResponse) Decode

func (response *SendMessageResponse) Decode(properties map[string]string)

type ServiceState

type ServiceState int32
const (
	StateCreateJust ServiceState = iota
	StateStartFailed
	StateRunning
	StateShutdown
)

type SubscriptionData

type SubscriptionData struct {
	ClassFilterMode bool      `json:"classFilterMode"`
	Topic           string    `json:"topic"`
	SubString       string    `json:"subString"`
	Tags            utils.Set `json:"tagsSet"`
	Codes           utils.Set `json:"codeSet"`
	SubVersion      int64     `json:"subVersion"`
	ExpType         string    `json:"expressionType"`
}

func (*SubscriptionData) Clone

func (sd *SubscriptionData) Clone() *SubscriptionData

type TopicListRequestHeader

type TopicListRequestHeader struct {
	Topic string
}

func (*TopicListRequestHeader) Encode

func (request *TopicListRequestHeader) Encode() map[string]string

type TopicPublishInfo

type TopicPublishInfo struct {
	OrderTopic          bool
	HaveTopicRouterInfo bool
	MqList              []*primitive.MessageQueue
	RouteData           *TopicRouteData
	TopicQueueIndex     int32
}

key is topic, value is TopicPublishInfo

type TopicRouteData

type TopicRouteData struct {
	OrderTopicConf string
	QueueDataList  []*QueueData  `json:"queueDatas"`
	BrokerDataList []*BrokerData `json:"brokerDatas"`
}

TopicRouteData TopicRouteData

func (*TopicRouteData) String

func (routeData *TopicRouteData) String() string

type TraceBean

type TraceBean struct {
	Topic       string
	MsgId       string
	OffsetMsgId string
	Tags        string
	Keys        string
	StoreHost   string
	ClientHost  string
	StoreTime   int64
	RetryTimes  int
	BodyLength  int
	MsgType     primitive.MessageType
}

type TraceContext

type TraceContext struct {
	TraceType   TraceType
	TimeStamp   int64
	RegionId    string
	RegionName  string
	GroupName   string
	CostTime    int64
	IsSuccess   bool
	RequestId   string
	ContextCode int
	TraceBeans  []TraceBean
}

type TraceDispatcher

type TraceDispatcher interface {
	GetTraceTopicName() string

	Start()
	Append(ctx TraceContext) bool
	Close()
}

type TraceTransferBean

type TraceTransferBean struct {
	// contains filtered or unexported fields
}

type TraceType

type TraceType string
const (
	Pub       TraceType = "Pub"
	SubBefore TraceType = "SubBefore"
	SubAfter  TraceType = "SubAfter"
)

type TransactionListener

type TransactionListener interface {
}

type UpdateConsumerOffsetRequestHeader

type UpdateConsumerOffsetRequestHeader struct {
	ConsumerGroup string
	Topic         string
	QueueId       int
	CommitOffset  int64
}

func (*UpdateConsumerOffsetRequestHeader) Encode

func (request *UpdateConsumerOffsetRequestHeader) Encode() map[string]string

type ViewMessageRequestHeader

type ViewMessageRequestHeader struct {
	Offset int64
}

func (*ViewMessageRequestHeader) Encode

func (request *ViewMessageRequestHeader) Encode() map[string]string

Directories

Path Synopsis
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements.
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL