Documentation ¶
Index ¶
- Variables
- func LogError(v ...interface{})
- func LogInfo(v ...interface{})
- type Broker
- func (b *Broker) AddNode() (mqapi.Node, error)
- func (b *Broker) BindPublishGroupToTopic(publishGroupId mqapi.PublishGroupId, topicId mqapi.TopicId) error
- func (b *Broker) BindSubscribeGroupToQueue(subscribeGroupId mqapi.SubscribeGroupId, queueId mqapi.QueueId) error
- func (b *Broker) BindTopicAndQueue(topicId mqapi.TopicId, queueId mqapi.QueueId, tags []mqapi.TagId) error
- func (b *Broker) DefineNewPublishGroup(publishGroupId mqapi.PublishGroupId) (mqapi.PublishGroup, error)
- func (b *Broker) DefineNewQueue(queueId mqapi.QueueId, option *mqapi.QueueOption) (mqapi.Queue, error)
- func (b *Broker) DefineNewSubscribeGroup(subscribeGroupId mqapi.SubscribeGroupId, option *mqapi.SubscribeGroupOption) (mqapi.SubscribeGroup, error)
- func (b *Broker) DefineNewTopic(topicId mqapi.TopicId, option *mqapi.TopicOption) (mqapi.Topic, error)
- func (b *Broker) DeletePublishGroup(publishGroupId mqapi.PublishGroupId) error
- func (b *Broker) DeleteQueue(queueId mqapi.QueueId) error
- func (b *Broker) DeleteSubscribeGroup(subscribeGroupId mqapi.SubscribeGroupId) error
- func (b *Broker) DeleteTopic(topicId mqapi.TopicId) error
- func (b *Broker) GenNewInternalTopicId() (int32, error)
- func (b *Broker) GetNode(nodeId mqapi.NodeId) mqapi.Node
- func (b *Broker) GetPublishGroup(publishGroupId mqapi.PublishGroupId) mqapi.PublishGroup
- func (b *Broker) GetSubscribeGroup(subscribeGroupId mqapi.SubscribeGroupId) mqapi.SubscribeGroup
- func (b *Broker) Shutdown(ctx context.Context) error
- func (b *Broker) Start() error
- func (b *Broker) UnbindPublishGroupFromTopic(publishGroupId mqapi.PublishGroupId, topic mqapi.TopicId) error
- func (b *Broker) UnbindSubscribeGroupFromQueue(subscribeGroupId mqapi.SubscribeGroupId, queueId mqapi.QueueId) error
- func (b *Broker) UnbindTopicAndQueue(topicId mqapi.TopicId, queueId mqapi.QueueId) error
- type BrokerOption
- type Node
- func (n *Node) DirectReply(reply *mqapi.Reply, ctx *mqapi.Ctx) error
- func (n *Node) GetNodeId() mqapi.NodeId
- func (n *Node) GetReplyChannel() <-chan *mqapi.Reply
- func (n *Node) Leave() error
- func (n *Node) PublishGroupInitialize(pg mqapi.PublishGroup) error
- func (n *Node) SubscribeGroupInitialize(sg mqapi.SubscribeGroup) error
- type Partition
- type PublishGroup
- func (pg *PublishGroup) CommitMessage(req *mqapi.MessageCommit, ctx *mqapi.Ctx) (mqapi.MessageFinish, error)
- func (pg *PublishGroup) Join(node mqapi.Node) error
- func (pg *PublishGroup) Leave(node *Node)
- func (pg *PublishGroup) PrePublishMessage(req *mqapi.Request, ctx *mqapi.Ctx) (mqapi.MessageReceived, error)
- func (pg *PublishGroup) PublishGuaranteeMessage(req *mqapi.Request, ctx *mqapi.Ctx) (mqapi.Ack, error)
- func (pg *PublishGroup) PublishMessage(req *mqapi.Request, ctx *mqapi.Ctx) (mqapi.Ack, error)
- func (pg *PublishGroup) Reply(reply *mqapi.Reply, ctx *mqapi.Ctx) error
- type Queue
- type SgQMap
- type Subject
- type SubscribeGroup
- func (sg *SubscribeGroup) Commit(queueId mqapi.QueueId, record *mqapi.QueueRecord, ack *mqapi.Ack) error
- func (sg *SubscribeGroup) Join(node mqapi.Node) error
- func (sg *SubscribeGroup) Leave(node *Node)
- func (sg *SubscribeGroup) PumpLoop(record *mqapi.QueueRecord, queue *Queue)
- func (sg *SubscribeGroup) PumpReleasingLoop(record *mqapi.QueueRecord, queue *Queue)
- func (sg *SubscribeGroup) Release(queueId mqapi.QueueId, record *mqapi.QueueRecord, ack *mqapi.Ack) error
- func (sg *SubscribeGroup) ReleaseChannel() <-chan mqapi.ReleaseChanElem
- func (sg *SubscribeGroup) SubscribeChannel() <-chan mqapi.SubChanElem
- type Topic
- func (topic *Topic) CommitMessages(req *mqapi.MessageCommit, ctx *mqapi.Ctx) (mqapi.Ack, error)
- func (topic *Topic) DeliveryLevel() mqapi.DeliveryLevelType
- func (topic *Topic) PrePublishMessage(req *mqapi.Request, ctx *mqapi.Ctx) (mqapi.Ack, error)
- func (topic *Topic) PreQueue(req *mqapi.Request)
- func (topic *Topic) PublishMessage(req *mqapi.Request, ctx *mqapi.Ctx) (mqapi.Ack, error)
- func (topic *Topic) PublishMessageWithResponse(req *mqapi.Request, ctx *mqapi.Ctx) (mqapi.Ack, error)
- func (topic *Topic) TopicId() mqapi.TopicId
Constants ¶
This section is empty.
Variables ¶
View Source
var (
EmptyMessageIdList = mqapi.Ack{}
)
Functions ¶
Types ¶
type Broker ¶
type Broker struct {
// contains filtered or unexported fields
}
func NewBroker ¶
func NewBroker(option *BrokerOption) *Broker
func (*Broker) BindPublishGroupToTopic ¶
func (*Broker) BindSubscribeGroupToQueue ¶
func (*Broker) BindTopicAndQueue ¶
func (*Broker) DefineNewPublishGroup ¶
func (b *Broker) DefineNewPublishGroup(publishGroupId mqapi.PublishGroupId) (mqapi.PublishGroup, error)
func (*Broker) DefineNewQueue ¶
func (*Broker) DefineNewSubscribeGroup ¶
func (b *Broker) DefineNewSubscribeGroup(subscribeGroupId mqapi.SubscribeGroupId, option *mqapi.SubscribeGroupOption) (mqapi.SubscribeGroup, error)
func (*Broker) DefineNewTopic ¶
func (*Broker) DeletePublishGroup ¶
func (b *Broker) DeletePublishGroup(publishGroupId mqapi.PublishGroupId) error
func (*Broker) DeleteSubscribeGroup ¶
func (b *Broker) DeleteSubscribeGroup(subscribeGroupId mqapi.SubscribeGroupId) error
func (*Broker) GenNewInternalTopicId ¶
func (*Broker) GetPublishGroup ¶
func (b *Broker) GetPublishGroup(publishGroupId mqapi.PublishGroupId) mqapi.PublishGroup
func (*Broker) GetSubscribeGroup ¶
func (b *Broker) GetSubscribeGroup(subscribeGroupId mqapi.SubscribeGroupId) mqapi.SubscribeGroup
func (*Broker) UnbindPublishGroupFromTopic ¶
func (*Broker) UnbindSubscribeGroupFromQueue ¶
type BrokerOption ¶
type BrokerOption struct {
NodeId int16
}
type Node ¶
type Node struct { InitSubscribeGroupFn func(sub mqapi.SubscribeGroup) InitPublishGroupFn func(pub mqapi.PublishGroup) // contains filtered or unexported fields }
func (*Node) GetReplyChannel ¶
func (*Node) PublishGroupInitialize ¶
func (n *Node) PublishGroupInitialize(pg mqapi.PublishGroup) error
func (*Node) SubscribeGroupInitialize ¶
func (n *Node) SubscribeGroupInitialize(sg mqapi.SubscribeGroup) error
type PublishGroup ¶
type PublishGroup struct {
// contains filtered or unexported fields
}
func (*PublishGroup) CommitMessage ¶
func (pg *PublishGroup) CommitMessage(req *mqapi.MessageCommit, ctx *mqapi.Ctx) (mqapi.MessageFinish, error)
CommitMessage exactly once
func (*PublishGroup) Leave ¶
func (pg *PublishGroup) Leave(node *Node)
func (*PublishGroup) PrePublishMessage ¶
func (pg *PublishGroup) PrePublishMessage(req *mqapi.Request, ctx *mqapi.Ctx) (mqapi.MessageReceived, error)
PrePublishMessage exactly once
func (*PublishGroup) PublishGuaranteeMessage ¶
func (pg *PublishGroup) PublishGuaranteeMessage(req *mqapi.Request, ctx *mqapi.Ctx) (mqapi.Ack, error)
PublishGuaranteeMessage at least once
func (*PublishGroup) PublishMessage ¶
PublishMessage at most once
type Queue ¶
type Queue struct { UncommittedMessageRetainTime int // in seconds, default 7 * 24 * 3600 InitBatchObtainCount int // 16 MaxBatchObtainCount int // 1024 QueueChannel chan *mqapi.Request // internal mqapi.QueueType // contains filtered or unexported fields }
func (*Queue) DeliveryLevel ¶
func (this *Queue) DeliveryLevel() mqapi.DeliveryLevelType
type Subject ¶
type Subject struct { }
special queue 1. non-durable 2. always fan out to all subscribers 3. can have responses to publisher
type SubscribeGroup ¶
type SubscribeGroup struct { SubCh chan mqapi.SubChanElem ReleaseCh chan mqapi.ReleaseChanElem // contains filtered or unexported fields }
func (*SubscribeGroup) Commit ¶
func (sg *SubscribeGroup) Commit(queueId mqapi.QueueId, record *mqapi.QueueRecord, ack *mqapi.Ack) error
Commit support the following QoS qos - at least once - ack qos - exactly once - commit
func (*SubscribeGroup) Leave ¶
func (sg *SubscribeGroup) Leave(node *Node)
func (*SubscribeGroup) PumpLoop ¶
func (sg *SubscribeGroup) PumpLoop(record *mqapi.QueueRecord, queue *Queue)
func (*SubscribeGroup) PumpReleasingLoop ¶
func (sg *SubscribeGroup) PumpReleasingLoop(record *mqapi.QueueRecord, queue *Queue)
func (*SubscribeGroup) Release ¶
func (sg *SubscribeGroup) Release(queueId mqapi.QueueId, record *mqapi.QueueRecord, ack *mqapi.Ack) error
Release support the following QoS qos - exactly once - release
func (*SubscribeGroup) ReleaseChannel ¶
func (sg *SubscribeGroup) ReleaseChannel() <-chan mqapi.ReleaseChanElem
func (*SubscribeGroup) SubscribeChannel ¶
func (sg *SubscribeGroup) SubscribeChannel() <-chan mqapi.SubChanElem
type Topic ¶
type Topic struct {
// contains filtered or unexported fields
}
func (*Topic) CommitMessages ¶
CommitMessages apply to exactly once omit dup flag
func (*Topic) DeliveryLevel ¶
func (topic *Topic) DeliveryLevel() mqapi.DeliveryLevelType
func (*Topic) PrePublishMessage ¶
PrePublishMessage apply to exactly once omit dup flag
func (*Topic) PublishMessage ¶
Click to show internal directories.
Click to hide internal directories.