Add support for gzip compression to amqp plugins (#5830)

This commit is contained in:
Daniel Nelson
2019-05-20 14:36:23 -07:00
committed by GitHub
parent 1b2773a762
commit b5cd9a9ff2
7 changed files with 250 additions and 12 deletions

View File

@@ -19,6 +19,7 @@ type ClientConfig struct {
exchangePassive bool
exchangeDurable bool
exchangeArguments amqp.Table
encoding string
headers amqp.Table
deliveryMode uint8
tlsConfig *tls.Config
@@ -114,10 +115,11 @@ func (c *client) Publish(key string, body []byte) error {
false, // mandatory
false, // immediate
amqp.Publishing{
Headers: c.config.headers,
ContentType: "text/plain",
Body: body,
DeliveryMode: c.config.deliveryMode,
Headers: c.config.headers,
ContentType: "text/plain",
ContentEncoding: c.config.encoding,
Body: body,
DeliveryMode: c.config.deliveryMode,
})
}