1
0
mirror of https://github.com/eventials/goevents.git synced 2025-04-26 13:48:59 +08:00

Fix errors.

This commit is contained in:
Alexandre Vicenzi 2016-11-28 15:08:56 -02:00
parent 166f0110f6
commit 3bae7283b0

View File

@ -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)
}