internal

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: Apache-2.0 Imports: 25 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_"
)
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)
	ReqGetBrokerRuntimeInfo             = int16(28)
	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)
	ReqRegisterBroker                   = int16(103)
	ReqGetRouteInfoByTopic              = int16(105)
	ReqGetBrokerClusterInfo             = int16(106)
	ReqSendBatchMessage                 = int16(320)
	ReqCheckTransactionState            = int16(39)
	ReqNotifyConsumerIdsChanged         = int16(40)
	ReqUpdateAndCreateSubscriptionGroup = int16(200)
	ReqGetTopicStatsInfo                = int16(202)
	ReqWipeWritePermOfBroker            = int16(205)
	ReqGetAllTopicListFromNameServer    = int16(206)
	ReqDeleteSubscriptionGroup          = int16(207)
	ReqGetConsumeStats                  = int16(208)
	ReqDeleteTopicInBroker              = int16(215)
	ReqDeleteTopicInNameSrv             = int16(216)
	ReqResetConsuemrOffset              = int16(220)
	GetTopicsByCluster                  = int16(224)
	ReqQueryTopicConsumeByWho           = int16(300)
	ReqGetConsumerRunningInfo           = int16(307)
	ReqConsumeMessageDirectly           = int16(309)
	ReqGetBrokerConsumeStats            = int16(317)
	ReqQueryConsumeQueue                = int16(321)
)
View Source
const (
	ResSuccess              = int16(0)
	ResError                = int16(1)
	ResFlushDiskTimeout     = int16(10)
	ResSlaveNotAvailable    = int16(11)
	ResFlushSlaveTimeout    = int16(12)
	ResTopicNotExist        = int16(17)
	ResPullNotFound         = int16(19)
	ResPullRetryImmediately = int16(20)
	ResPullOffsetMoved      = int16(21)
)
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 = errors.New("service close is not running, please check")
)
View Source
var (
	ErrTopicNotExist = errors.New("topic not exist")
)

Functions

func GetRetryTopic

func GetRetryTopic(group string) string

func NewHeartbeatData

func NewHeartbeatData(clientID string) *heartbeatData

func NewNamesrv

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

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

func NewTraceDispatcher

func NewTraceDispatcher(traceCfg *primitive.TraceConfig) *traceDispatcher

func ValidateGroup

func ValidateGroup(group string)

Types

type BrokerConsumeStatRequestHeader

type BrokerConsumeStatRequestHeader struct {
	ConsumerGroup string
	Topic         string
}

func (*BrokerConsumeStatRequestHeader) Encode

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

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
}

func DefaultClientOptions

func DefaultClientOptions() ClientOptions

func (*ClientOptions) ChangeInstanceNameToPID

func (opt *ClientOptions) ChangeInstanceNameToPID()

func (*ClientOptions) String

func (opt *ClientOptions) String() string

type ClusterListRequestHeader

type ClusterListRequestHeader struct {
	NamesvrAddr string
	BrokerAddr  string
}

func (*ClusterListRequestHeader) Decode

func (request *ClusterListRequestHeader) Decode() map[string]string

func (*ClusterListRequestHeader) Encode

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

type ConsumeStats

type ConsumeStats struct {
	SelfTestCGroup      []string `json:"SELF_TEST_C_GROUP"`
	CidOnsapiOwner      []string `json:"CID_ONSAPI_OWNER"`
	CidOnsapiPermission []string `json:"CID_ONSAPI_PERMISSION"`
	ToolsConsumer       []string `json:"TOOLS_CONSUMER"`
	TestGroup           []string `json:"testGroup"`
	CidOnsHttpProxy     []string `json:"CID_ONS-HTTP-PROXY"`
	FiltErsrvConsumer   []string `json:"FILTERSRV_CONSUMER"`
	CidOnsapiPull       []string `json:"CID_ONSAPI_PULL"`
}

type ConsumeStatsData

type ConsumeStatsData struct {
	BrokerAddr       string          `json:"brokerAddr"`
	ConsumeStatsList []*ConsumeStats `json:"consumeStatsList"`
	TotalDiff        int64           `json:"totalDiff"`
}

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
}

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 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 DeleteSubscriptionGroupRequestHeader

type DeleteSubscriptionGroupRequestHeader struct {
	GroupName  string
	BrokerAddr string
}

func (*DeleteSubscriptionGroupRequestHeader) Encode

func (request *DeleteSubscriptionGroupRequestHeader) 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 GetBrokerClsuterInfoRequetsHeader

type GetBrokerClsuterInfoRequetsHeader struct {
}

func (*GetBrokerClsuterInfoRequetsHeader) Encode

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

type GetConsumeStatsInBrokerHeader

type GetConsumeStatsInBrokerHeader struct {
	IsOrder bool
}

func (*GetConsumeStatsInBrokerHeader) Encode

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

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 GetConsumerRunningInfoRequestHeader

type GetConsumerRunningInfoRequestHeader struct {
	ConsumerGroup string
	ClientId      string
}

func (*GetConsumerRunningInfoRequestHeader) Encode

func (request *GetConsumerRunningInfoRequestHeader) 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 GetTopicsByClusterRequestHeader

type GetTopicsByClusterRequestHeader struct {
	Cluster string
}

func (*GetTopicsByClusterRequestHeader) Decode

func (request *GetTopicsByClusterRequestHeader) Decode() map[string]string

func (*GetTopicsByClusterRequestHeader) Encode

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

type InnerConsumer

type InnerConsumer interface {
	PersistConsumerOffset() error
	UpdateTopicSubscribeInfo(topic string, mqs []*primitive.MessageQueue)
	IsSubscribeTopicNeedUpdate(topic string) bool
	SubscriptionDataList() []*SubscriptionData
	Rebalance()
	IsUnitMode() bool
	GetConsumerRunningInfo() *ConsumerRunningInfo
	GetcType() string
	GetModel() string
	GetWhere() string
}

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

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 {
	// 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) 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) 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)

RegisterProducer mocks base method

func (*MockRMQClient) SendHeartbeatToAllBrokerWithLock

func (m *MockRMQClient) SendHeartbeatToAllBrokerWithLock()

SendHeartbeatToAllBrokerWithLock mocks base method

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)

	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 QueryConsumeQueueRequestHeader

type QueryConsumeQueueRequestHeader struct {
	Topic         string
	ConsumerGroup string
	QueueId       string
	Index         int
}

func (*QueryConsumeQueueRequestHeader) Encode

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

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 QueryTopicConsumeByWhoRequestHeader

type QueryTopicConsumeByWhoRequestHeader struct {
	BrokerAddr string
	Topic      string
}

func (*QueryTopicConsumeByWhoRequestHeader) Decode

func (request *QueryTopicConsumeByWhoRequestHeader) Decode() map[string]string

func (*QueryTopicConsumeByWhoRequestHeader) Encode

func (request *QueryTopicConsumeByWhoRequestHeader) 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)
	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)
}

func GetOrNewRocketMQClient

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

type RegisterBrokerRequestHeader

type RegisterBrokerRequestHeader struct {
	BrokerName   string
	BrokerAddr   string
	ClusterName  string
	HaServerAddr string
	BrokerId     int
	Compressed   bool
}

func (*RegisterBrokerRequestHeader) Encode

func (request *RegisterBrokerRequestHeader) 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 string
}

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"`
}

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) Decode

func (routeData *TopicRouteData) Decode(data string) error

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 UpdateAndCreateSubscriptionGroupRequestHeader

type UpdateAndCreateSubscriptionGroupRequestHeader struct {
	BrokerAddr             string
	ClusterName            string
	GroupName              string
	BrokerId               string
	RetryQueueNums         int
	RetryMaxTimes          int64
	ConsumeEnable          bool
	ConsumeFromMinEnable   bool
	ConsumeBroadcastEnable bool
	NamesrvAddr            string
}

func (*UpdateAndCreateSubscriptionGroupRequestHeader) Decode

func (*UpdateAndCreateSubscriptionGroupRequestHeader) Encode

type UpdateConsumerOffsetRequestHeader

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

func (*UpdateConsumerOffsetRequestHeader) Encode

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

type UpdateTopicRequestHeader

type UpdateTopicRequestHeader struct {
	Topic           string
	ClusterName     string
	NamesrvAddr     string
	TopicFilterType string
}

func (*UpdateTopicRequestHeader) Encode

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

type ViewMessageRequestHeader

type ViewMessageRequestHeader struct {
	Offset int64
}

func (*ViewMessageRequestHeader) Encode

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

type WipeWritePermOfBrokerRequestHeader

type WipeWritePermOfBrokerRequestHeader struct {
	Brokername string
	Nameserver string
}

func (*WipeWritePermOfBrokerRequestHeader) Encode

func (request *WipeWritePermOfBrokerRequestHeader) 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