Documentation ¶
Index ¶
- Constants
- func ConsumeMQ(mqCategory string, consumeProxy *mqenv.MQConsumerProxy) error
- func FindOneCategoryNameByInstance(instanceName string) string
- func GetAllCategoryNamesByInstance(instanceName string) []string
- func GetAllMQDriverConfigs() map[string]mqenv.MQConnectorConfig
- func GetKafka(name string) (*kafka.KafkaWorker, error)
- func GetMQRoutes() map[string]Config
- func GetPulsar(name string) (*pulsar.PulsarMQ, error)
- func GetRabbitMQ(name string) (*rabbitmq.RabbitMQ, error)
- func HasConnections() bool
- func Init(mqConfigFile string, mqDriverConfigs map[string]mqenv.MQConnectorConfig) error
- func InitMQTopic(topicCategory string, topicConfig *Config, ...) error
- func InitMQWithRPC(topicCategory string, rpcType int, connCfg *mqenv.MQConnectorConfig, ...) error
- func InitMockMQTopic(mqCategory string, topic string)
- func InitWithMQRoutes(mqRoutesEnv *RoutesEnv, mqDriverConfigs map[string]mqenv.MQConnectorConfig) error
- func NewMQResponseMessage(body []byte, cm *mqenv.MQConsumerMessage) *mqenv.MQPublishMessage
- func PublishMQ(mqCategory string, publishMsg *mqenv.MQPublishMessage) error
- func QueryMQ(mqCategory string, pm *mqenv.MQPublishMessage) (*mqenv.MQConsumerMessage, error)
- func QueryMQRPC(mqCategory string, pm *mqenv.MQPublishMessage) (*mqenv.MQConsumerMessage, error)
- func SetMQConfig(category string, cnf Config)
- func SetupTrackerQueue(queueName string)
- type Config
- type Exchange
- type RoutesEnv
Constants ¶
const ( DriverTypeAMQP = mqenv.DriverTypeAMQP DriverTypeKafka = mqenv.DriverTypeKafka MQTypeConsumer = mqenv.MQTypeConsumer MQTypePublisher = mqenv.MQTypePublisher MQEventCodeOk = mqenv.MQEventCodeOk MQEventCodeFailed = mqenv.MQEventCodeFailed )
Constants
Variables ¶
This section is empty.
Functions ¶
func ConsumeMQ ¶
func ConsumeMQ(mqCategory string, consumeProxy *mqenv.MQConsumerProxy) error
ConsumeMQ consume
func FindOneCategoryNameByInstance ¶ added in v0.2.5
FindOneCategoryNameByInstance first hit category
func GetAllCategoryNamesByInstance ¶ added in v0.2.5
GetAllCategoryNamesByInstance by instancename
func GetAllMQDriverConfigs ¶ added in v0.2.2
func GetAllMQDriverConfigs() map[string]mqenv.MQConnectorConfig
GetAllMQDriverConfigs configs
func GetRabbitMQ ¶
GetRabbitMQ get rabbitmq instance
func HasConnections ¶ added in v0.2.6
func HasConnections() bool
HasConnections returns true if has any mq connection
func Init ¶
func Init(mqConfigFile string, mqDriverConfigs map[string]mqenv.MQConnectorConfig) error
Init initializer
func InitMQTopic ¶ added in v0.2.0
func InitMQTopic(topicCategory string, topicConfig *Config, mqDriverConfigs map[string]mqenv.MQConnectorConfig) error
InitMQTopic initialize sigle mq topic with drivers
func InitMQWithRPC ¶
func InitMQWithRPC(topicCategory string, rpcType int, connCfg *mqenv.MQConnectorConfig, mqCfg *Config) error
InitMQWithRPC init mq with RPC
func InitMockMQTopic ¶ added in v0.2.6
InitMockMQTopic for testing
func InitWithMQRoutes ¶ added in v0.2.1
func InitWithMQRoutes(mqRoutesEnv *RoutesEnv, mqDriverConfigs map[string]mqenv.MQConnectorConfig) error
InitWithMQRoutes patitionally init with RoutesEnv
func NewMQResponseMessage ¶ added in v0.2.2
func NewMQResponseMessage(body []byte, cm *mqenv.MQConsumerMessage) *mqenv.MQPublishMessage
NewMQResponseMessage new mq response publish messge depends on mq consumer message
func PublishMQ ¶
func PublishMQ(mqCategory string, publishMsg *mqenv.MQPublishMessage) error
PublishMQ publish
func QueryMQ ¶ added in v0.2.6
func QueryMQ(mqCategory string, pm *mqenv.MQPublishMessage) (*mqenv.MQConsumerMessage, error)
QueryMQ publishes a message and waiting the response
func QueryMQRPC ¶ added in v0.2.1
func QueryMQRPC(mqCategory string, pm *mqenv.MQPublishMessage) (*mqenv.MQConsumerMessage, error)
QueryMQRPC publishes a message and waiting the response
func SetMQConfig ¶ added in v0.2.6
SetMQConfig with category
func SetupTrackerQueue ¶ added in v0.2.1
func SetupTrackerQueue(queueName string)
SetupTrackerQueue name
Types ¶
type Config ¶
type Config struct { Instance string `yaml:"instance" json:"instance"` // RabbitMQ parameters Queue string `yaml:"queue" json:"queue"` Exchange Exchange `yaml:"exchange" json:"exchange"` BindingKey string `yaml:"bindingKey" json:"bindingKey"` RoutingKeys map[string]string `yaml:"routingKeys" json:"routingKeys"` Durable bool `yaml:"durable" json:"durable"` AutoDelete bool `yaml:"autoDelete" json:"autoDelete"` RPCEnabled bool `yaml:"rpcEnabled"` // Kafka parameters Topic string `yaml:"topic" json:"topic"` GroupID string `yaml:"groupId" json:"groupId"` Partition int `yaml:"partition" json:"partition"` MaxPollIntervalMS int `yaml:"maxPollIntervalMs" json:"maxPollIntervalMs"` // 消息类型: //direct:组播,订阅同一个topic,消费者组会相同,一条消息只会被组内一个消费者接收 //fanout:广播,订阅同一个topic,但是消费者组会使用uuid,所有组都会收到信息 MessageType string `yaml:"messageType" json:"messageType"` UseOriginalContent bool `yaml:"useOriginalContent" json:"useOriginalContent"` }
Config struct