Added priority option for AMQP endpoints

This commit is contained in:
tidwall 2020-05-16 14:31:52 -07:00
parent 70cd167fc0
commit 3718cd766b
2 changed files with 4 additions and 1 deletions

View File

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

View File

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