From 3718cd766bafcad075f32263b62fb79715dd966c Mon Sep 17 00:00:00 2001 From: tidwall Date: Sat, 16 May 2020 14:31:52 -0700 Subject: [PATCH] Added priority option for AMQP endpoints --- internal/endpoint/amqp.go | 2 +- internal/endpoint/endpoint.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/endpoint/amqp.go b/internal/endpoint/amqp.go index 824c173c..f8cf4444 100644 --- a/internal/endpoint/amqp.go +++ b/internal/endpoint/amqp.go @@ -124,7 +124,7 @@ func (conn *AMQPConn) Send(msg string) error { ContentEncoding: "", Body: []byte(msg), DeliveryMode: conn.ep.AMQP.DeliveryMode, - Priority: 0, + Priority: conn.ep.AMQP.Priority, }, ) } diff --git a/internal/endpoint/endpoint.go b/internal/endpoint/endpoint.go index 49299c05..31609923 100644 --- a/internal/endpoint/endpoint.go +++ b/internal/endpoint/endpoint.go @@ -78,6 +78,7 @@ type Endpoint struct { Mandatory bool Immediate bool DeliveryMode uint8 + Priority uint8 } MQTT struct { Host string @@ -591,6 +592,8 @@ func parseEndpoint(s string) (Endpoint, error) { endpoint.AMQP.Mandatory = queryBool(val[0]) case "delivery_mode": endpoint.AMQP.DeliveryMode = uint8(queryInt(val[0])) + case "priority": + endpoint.AMQP.Priority = uint8(queryInt(val[0])) } } }