From c8a06250a335549d05105f19f8fb1a56b21283ce Mon Sep 17 00:00:00 2001 From: Michael Klaus Nguetsa <19670912+mnguetsa@users.noreply.github.com> Date: Wed, 13 Mar 2024 16:38:31 +0100 Subject: [PATCH] Improve documentation for AMQP client options about setting a heartbeat --- .../src/main/docs/amqp/client-customization.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/documentation/src/main/docs/amqp/client-customization.md b/documentation/src/main/docs/amqp/client-customization.md index 3064fb1301..165469a650 100644 --- a/documentation/src/main/docs/amqp/client-customization.md +++ b/documentation/src/main/docs/amqp/client-customization.md @@ -16,6 +16,20 @@ connector. You need to indicate the name of the client using the mp.messaging.incoming.prices.client-options-name=my-named-options ``` +If you experience frequent disconnections from the broker, the AmqpClientOptions can also be used to set a heartbeat if you need to keep the AMQP connection permanently. +Some brokers might terminate the AMQP connection after a certain idle timeout. +You can provide a heartbeat value which will be used by the Vert.x proton client to advertise the idle timeout when opening transport to a remote peer. + +```java +@Produces +@Identifier("my-named-options") +public AmqpClientOptions getNamedOptions() { + // set a heartbeat of 30s (in milliseconds) + return new AmqpClientOptions() + .setHeartbeat(30000); +} +``` + ## Client capabilities Both incoming and outgoing AMQP channels can be configured with a list