Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KafkaConnector ¶
type KafkaConnector struct { URL string //the URL of the Kafka message queue WriteDeadline time.Duration // the deadline for future Write calls and any currently-blocked Write call }
func (KafkaConnector) SendMessage ¶
func (c KafkaConnector) SendMessage(ctx context.Context, message []byte, key string, topic string, properties map[string]string) error
SendMessage sends *message* with *key* to the Kafka message queue under the specified *topic*. Currently, you cannot choose to which partition you send the message (it automatically sends to partition 0).
func (KafkaConnector) SubscribeAndConsume ¶
func (c KafkaConnector) SubscribeAndConsume(ctx context.Context, topic string, subscriptionName string, commands map[string]CommandHandler)
type MQConsumer ¶
type MQProducer ¶
type PulsarConnector ¶
type PulsarConnector struct { URL string //the URL of the Pulsar message queue ConsumeAndDelete bool // when set to true, read messages are instantly removed from the message queue }
func (PulsarConnector) SendMessage ¶
func (c PulsarConnector) SendMessage(ctx context.Context, message []byte, key string, topic string, properties map[string]string) error
SendMessage sends *message* with *key* to the Pulsar message queue under the *topic* topic
func (PulsarConnector) SubscribeAndConsume ¶
func (c PulsarConnector) SubscribeAndConsume(ctx context.Context, topic string, subscriptionName string, commands map[string]CommandHandler, maxRetry int, sleepTime time.Duration)
SubscribeAndConsume subscribed to *topic* in the the Pulsar message queue as *subscriptionName*. When a message is received, it checks its key and looks in *commands* which function must be executed.
Click to show internal directories.
Click to hide internal directories.