Prior to this change, Koji would always send messages with a hard-coded
topic:// prefix.
This works fine for ActiveMQ 5 and Artemis, but RabbitMQ does not
support that syntax. Instead, RabbitMQ brokers expect clients to use
topic addresses with a "/topic/" prefix.
The RFE for RabbitMQ to support "topic://" prefixes is
https://github.com/rabbitmq/rabbitmq-server/issues/2583
In the meantime, allow users to specify "topic://" or "/topic/"
explicitly in their configuration.
For backwards-compatibility, if the user chose neither "topic://" nor
"/topic/", prepend the "topic://" string, preserving the plugin's
existing behavior.
(Note: ActiveMQ 5 advertises its expected topic:// prefix in the initial
connection properties, so we could read that value dynamically, but
RabbitMQ and Artemis do not send an expected topic prefix connection
properties, so we just make the user choose explicitly here.)
When a build completes, we store the original, unsigned rpm headers
to disk. This results in the postRPMSign callback being called, and
a rpm.sign message being sent with an empty sigkey. The intended
sematics of the rpm.sign message is to notify a service when an rpm
has been signed. Therefore, we should not be sending a message when
the sigkey is empty.
This plugin sends messages to a broker about events in the hub
using the proton library. This library supports the AMQP 1.0
protocol and is compatible with a wide variety of message
brokers. It queues all messages until the postCommit callback,
avoiding race conditions between message reception and database
transaction commit.