Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client interface { // Create a producer instance CreateProducer(options ProducerOptions) (Producer, error) // Create a consumer instance and subscribe a topic Subscribe(options ConsumerOptions) (Consumer, error) // Close the client and free associated resources Close() }
Client is the interface rocksmq client
type Consumer ¶
type Consumer interface { // returns the subscription for the consumer Subscription() string // returns the topic for the consumer Topic() string // Signal channel MsgMutex() chan struct{} // Message channel Chan() <-chan common.Message // Seek to the uniqueID position Seek(UniqueID) error //nolint:govet // Close consumer Close() // GetLatestMsgID get the latest msgID GetLatestMsgID() (int64, error) // check created topic whether vaild or not CheckTopicValid(topic string) error }
Consumer interface provide operations for 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 // Message for this consumer // When a message is received, it will be pushed to this channel for consumption MessageChannel chan common.Message }
ConsumerOptions is the options of a consumer
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error is a struct contains error msg and result
type Producer ¶
type Producer interface { // return the topic which producer is publishing to Topic() string // publish a message Send(message *common.ProducerMessage) (UniqueID, error) // Close a producer Close() }
Producer provedes some operations for a producer
type ProducerOptions ¶
type ProducerOptions struct {
Topic string
}
ProducerOptions is the options of a producer
type RmqMessage ¶
type RmqMessage struct {
// contains filtered or unexported fields
}
rmqMessage wraps the message for rocksmq
func (*RmqMessage) ID ¶
func (rm *RmqMessage) ID() common.MessageID
ID returns the id of rocksmq message
func (*RmqMessage) Payload ¶
func (rm *RmqMessage) Payload() []byte
Payload returns the payload of rocksmq message
func (*RmqMessage) Properties ¶
func (rm *RmqMessage) Properties() map[string]string
Properties returns the properties of rocksmq message
func (*RmqMessage) Topic ¶
func (rm *RmqMessage) Topic() string
Topic returns the topic name of rocksmq message
Click to show internal directories.
Click to hide internal directories.