New feature (added in 2023.3.4)
This is an alternative to the Notification SSE API and is suitable for work queues where the consumers are not within the application boundary, and where scalability is a concern.
AMQP publication is enabled by setting the
AMQP_BROKER_URL environment variable to the URL of the broker. If it is not
set, AMQP publication is disabled and notifications are neither published nor added to the internal publication queue.
The other environment variables that can be used to configure the AMQP publication are documented here.
Notifications with the
@multinode annotation will not be published to the AMQP broker.
The engine can only guarantee that messages are delivered at least once to the broker. It is the responsibility of the
consumers to handle duplicate messages. This can be done by using the
messageId header, which is set to the
The AMQP messages use the same serialization format as the Notification SSE API, i.e.
Simple streaming client
clients package includes a simple streaming client that can be used to consume notifications from the broker. It
is available as
AmqpReceiveClientImpl and is configured with an
method can be used to open a stream of notifications from the broker. If the
timeout parameter is set, the stream will
be closed after waiting to receive a message for the specified duration. If the
timeout parameter is not set or is
negative, the stream will be kept open indefinitely. A duration of zero will close the stream immediately once no more
messages are available.
For more advanced use cases, it is recommended to use the
Client from the
qpid-protonj2 package directly.