mirror of
https://github.com/eventials/goevents.git
synced 2025-04-26 13:48:59 +08:00
Fix errors.
This commit is contained in:
parent
166f0110f6
commit
3bae7283b0
@ -16,14 +16,12 @@ func NewProducer(c *Connection) *Producer {
|
||||
}
|
||||
}
|
||||
|
||||
func (p *Producer) Publish(action string, data interface{}) error {
|
||||
func (p *Producer) Publish(action string, data []byte) error {
|
||||
msg := amqp.Publishing{
|
||||
DeliveryMode: amqp.Persistent,
|
||||
Timestamp: time.Now(),
|
||||
ContentType: "application/json",
|
||||
ContentEncoding: "utf-8",
|
||||
Body: data,
|
||||
}
|
||||
|
||||
return c.channel.Publish(c.exchangeName, routingKey, false, false, msg)
|
||||
return p.conn.channel.Publish(p.conn.exchangeName, action, false, false, msg)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user