mirror of https://github.com/tidwall/tile38.git
Added priority option for AMQP endpoints
This commit is contained in:
parent
70cd167fc0
commit
3718cd766b
|
@ -124,7 +124,7 @@ func (conn *AMQPConn) Send(msg string) error {
|
||||||
ContentEncoding: "",
|
ContentEncoding: "",
|
||||||
Body: []byte(msg),
|
Body: []byte(msg),
|
||||||
DeliveryMode: conn.ep.AMQP.DeliveryMode,
|
DeliveryMode: conn.ep.AMQP.DeliveryMode,
|
||||||
Priority: 0,
|
Priority: conn.ep.AMQP.Priority,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,6 +78,7 @@ type Endpoint struct {
|
||||||
Mandatory bool
|
Mandatory bool
|
||||||
Immediate bool
|
Immediate bool
|
||||||
DeliveryMode uint8
|
DeliveryMode uint8
|
||||||
|
Priority uint8
|
||||||
}
|
}
|
||||||
MQTT struct {
|
MQTT struct {
|
||||||
Host string
|
Host string
|
||||||
|
@ -591,6 +592,8 @@ func parseEndpoint(s string) (Endpoint, error) {
|
||||||
endpoint.AMQP.Mandatory = queryBool(val[0])
|
endpoint.AMQP.Mandatory = queryBool(val[0])
|
||||||
case "delivery_mode":
|
case "delivery_mode":
|
||||||
endpoint.AMQP.DeliveryMode = uint8(queryInt(val[0]))
|
endpoint.AMQP.DeliveryMode = uint8(queryInt(val[0]))
|
||||||
|
case "priority":
|
||||||
|
endpoint.AMQP.Priority = uint8(queryInt(val[0]))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue