Documentation ¶
Overview ¶
Package client defines the api and information which can be exposed to user.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfirmResult ¶
ConfirmResult of a consumption.
type Consumer ¶
type Consumer interface { // GetMessage receive a single message. GetMessage() (*ConsumerResult, error) // Confirm the consumption of a message. Confirm(confirmContext string, consumed bool) (*ConfirmResult, error) // GetCurrConsumedInfo returns the consumptions of the consumer. GetCurrConsumedInfo() map[string]*remote.ConsumerOffset // Close closes the consumer client and release the resources. Close() // GetClientID returns the clientID of the consumer. GetClientID() string }
Consumer is an interface that abstracts behavior of TubeMQ's consumer
type ConsumerResult ¶
type ConsumerResult struct { TopicName string ConfirmContext string PeerInfo *PeerInfo Messages []*Message }
ConsumerResult of a consumption.
type Message ¶
type Message struct { Topic string Data []byte DataLen int32 ID int64 Flag int32 Properties map[string]string }
Message represents a TubeMQ message.
type PeerInfo ¶
type PeerInfo struct { PartitionID uint32 BrokerHost string PartitionKey string CurrOffset int64 MaxOffset int64 }
PeerInfo represents the partition information of a broker.
type Producer ¶
type RoundRobinPartitionRouter ¶
type RoundRobinPartitionRouter struct {
// contains filtered or unexported fields
}
func NewPartitionRouter ¶
func NewPartitionRouter() *RoundRobinPartitionRouter
func (*RoundRobinPartitionRouter) GetPartition ¶
func (router *RoundRobinPartitionRouter) GetPartition(message *Message, partitionList []*metadata.Partition) int
Click to show internal directories.
Click to hide internal directories.