Documentation ¶
Index ¶
- Constants
- Variables
- func GetTagString(tag *string) string
- func MixTags(tags ...string) string
- func MustSetUp(config *Config)
- func NewProducer() (rmq_client.Producer, error)
- func NewSimpleConsumer(consumerGroup string, ...) (rmq_client.SimpleConsumer, error)
- func SendMessage(producer rmq_client.Producer, ctx context.Context, topic string, tag *string, ...) ([]*rmq_client.SendReceipt, error)
- func SetUp(c *Config) error
- type Config
Constants ¶
Variables ¶
View Source
var (
NotSetupError = errorKit.New("hasn't been set up")
)
Functions ¶
func GetTagString ¶
func NewProducer ¶
func NewProducer() (rmq_client.Producer, error)
NewProducer
PS: In most case, you don't need to create many producers, singletion pattern is more recommended.
@param clientLogPath 客户端日志(blank则输出到控制台)
func NewSimpleConsumer ¶
func NewSimpleConsumer(consumerGroup string, subscriptionExpressions map[string]*rmq_client.FilterExpression) (rmq_client.SimpleConsumer, error)
NewSimpleConsumer
PS: In most case, you don't need to create many consumers, singletion pattern is more recommended.
@param consumerGroup 不能为"" @param subscriptionExpressions (1) key: topic,不能为 "*" || blank
(2) value: tag,一般为 rmq_client.SUB_ALL
@param clientLogPath 客户端日志(blank则输出到控制台)
func SendMessage ¶
func SendMessage(producer rmq_client.Producer, ctx context.Context, topic string, tag *string, body []byte, messageGroup string, deliveryTimestamp time.Time, keys ...string) ([]*rmq_client.SendReceipt, error)
SendMessage Deprecated: 仅供参考如何生产消息
Types ¶
type Config ¶
type Config struct { Endpoints []string `json:"endpoints" yaml:"endpoints"` Credentials *credentials.SessionCredentials `json:"credentials,optional" yaml:"credentials"` ValidatedTopic string `json:"validatedTopic,optional" yaml:"validatedTopic"` ClientLogPath string `json:"clientLogPath,optional" yaml:"clientLogPath"` }
Click to show internal directories.
Click to hide internal directories.