Documentation ¶
Index ¶
Constants ¶
View Source
const LOG_FIELD = "[RABBITMQ]"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RabbitConfig ¶
type RabbitConfig struct { Dsn string //队列地址 QueueName string //队列名 ExChange string //交换机名称 Key string //绑定的key名称 Durable bool //是否持久化 AutoDelete bool //是否自动删除 Exclusive bool //是否具有排他性 NoWait bool //是否阻塞处理 Args amqp.Table //额外的属性 Consumer string //指定消费者 AutoAck bool //是否自动应答,告诉我已经消费完了 NoLocal bool //若设置为true,则表示为不能将同一个connection中发送的消息传递给这个connection中的消费者 }
type RabbitMQ ¶
type RabbitMQ struct { Payload chan []byte //拿到的数据 // contains filtered or unexported fields }
RabbitMQ结构体
func NewRabbitMQ ¶
func NewRabbitMQ(config RabbitConfig) (rabbitmq *RabbitMQ)
func (*RabbitMQ) ConsumeSimple ¶
func (r *RabbitMQ) ConsumeSimple()
func (*RabbitMQ) PublishSimple ¶
直接模式,生产者.
Click to show internal directories.
Click to hide internal directories.