Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultPartitionIdx = 0
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // CreateProducer creates a producer instance CreateProducer(options common.ProducerOptions) (Producer, error) // Subscribe creates a consumer instance and subscribe a topic Subscribe(options ConsumerOptions) (Consumer, error) // Get the earliest MessageID EarliestMessageID() common.MessageID // String to msg ID StringToMsgID(string) (common.MessageID, error) // Deserialize MessageId from a byte array BytesToMsgID([]byte) (common.MessageID, error) // Close the client and free associated resources Close() }
Client is the interface that provides operations of message queues
type Consumer ¶
type Consumer interface { // returns the subscription for the consumer Subscription() string // Get Message channel, once you chan you can not seek again Chan() <-chan common.Message // Seek to the uniqueID position, the second bool param indicates whether the message is included in the position Seek(common.MessageID, bool) error //nolint:govet // Ack make sure that msg is received Ack(common.Message) // Close consumer Close() // GetLatestMsgID return the latest message ID GetLatestMsgID() (common.MessageID, error) // check created topic whether vaild or not CheckTopicValid(channel string) error }
Consumer is the interface that provides operations of a consumer
type ConsumerOptions ¶
type ConsumerOptions struct { // The topic that this consumer will subscribe on Topic string // The subscription name for this consumer SubscriptionName string // InitialPosition at which the cursor will be set when subscribe // Default is `Latest` common.SubscriptionInitialPosition // Set receive channel size BufSize int64 }
ConsumerOptions contains the options of a consumer
Click to show internal directories.
Click to hide internal directories.