Some optimisations: Precalculate the table representation of an upstream, and the safe form of a URI, rather than on every delivery. And only call amqp_channel:next_publish_seqno/1 if we are going to use the result.
Merged bug25797 into default