This is an automated email from the ASF dual-hosted git repository.

oscerd pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git


The following commit(s) were added to refs/heads/main by this push:
     new 43f1e8d92 Fix #2790: expose publisher confirms on spring-rabbitmq-sink 
(#2996)
43f1e8d92 is described below

commit 43f1e8d92143ad2a80f203d13a870fb658c7498e
Author: Andrea Cosentino <[email protected]>
AuthorDate: Tue Sep 1 11:06:39 2026 +0200

    Fix #2790: expose publisher confirms on spring-rabbitmq-sink (#2996)
    
    Waiting for publisher confirms needs two things wired together, and the
    Kamelet exposed neither.
    
    The confirm mode lives on the connection factory, not on the endpoint, so
    publisherConfirmType is set on the CachingConnectionFactory the template
    already declares inline. Camel converts the string onto Spring's
    CachingConnectionFactory.ConfirmType enum (NONE, SIMPLE, CORRELATED).
    
    confirm and confirmTimeout are genuine camel-spring-rabbitmq endpoint
    options and are passed through to the endpoint.
    
    The issue also suggested a confirmType property with the same three
    values. That would duplicate publisherConfirmType, which is the name the
    underlying setter uses, so this exposes the connection factory name
    instead of inventing a second one.
    
    Defaults keep current behaviour: publisherConfirmType NONE leaves confirms
    switched off, so nothing changes for existing users unless they opt in.
    Both descriptions say that confirm only has something to wait on once
    publisherConfirmType is SIMPLE or CORRELATED, since setting one without
    the other is the easy mistake here.
    
    Verified with `camel run` against the real component: the route starts and
    the connection factory binds with publisherConfirmType CORRELATED, confirm
    enabled and confirmTimeout 3000, failing only with ConnectException as
    there is no broker. The defaults-only case starts cleanly too.
    
    Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
---
 kamelets/spring-rabbitmq-sink.kamelet.yaml | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/kamelets/spring-rabbitmq-sink.kamelet.yaml 
b/kamelets/spring-rabbitmq-sink.kamelet.yaml
index 5ed6e5675..e671dea23 100644
--- a/kamelets/spring-rabbitmq-sink.kamelet.yaml
+++ b/kamelets/spring-rabbitmq-sink.kamelet.yaml
@@ -77,6 +77,28 @@ spec:
         description: Specifies whether the producer should auto declare 
binding between exchange, queue and routing key when starting
         type: boolean
         default: false
+      publisherConfirmType:
+        title: Publisher Confirm Type
+        description: The publisher confirm mode of the underlying connection 
factory. Must be SIMPLE or
+          CORRELATED for the confirm option below to have anything to wait on. 
NONE, the default, leaves
+          publisher confirms switched off.
+        type: string
+        default: "NONE"
+        enum: ["NONE", "SIMPLE", "CORRELATED"]
+      confirm:
+        title: Confirm
+        description: Controls whether to wait for publisher confirms. auto 
lets Camel detect whether the
+          connection factory is configured for confirms, enabled always waits, 
disabled never waits.
+          Requires publisherConfirmType to be SIMPLE or CORRELATED.
+        type: string
+        default: "auto"
+        enum: ["auto", "enabled", "disabled"]
+      confirmTimeout:
+        title: Confirm Timeout
+        description: How long in milliseconds to wait for a sent message to be 
confirmed by RabbitMQ when
+          doing send-only (InOnly) messaging. A negative value waits 
indefinitely.
+        type: string
+        default: "5000"
       vhost:
         title: Virtual Host
         description: The virtual host
@@ -100,6 +122,7 @@ spec:
           password: '{{?password}}'
           uri: '{{protocol}}://{{host}}:{{port}}'
           virtualHost: "{{vhost}}"
+          publisherConfirmType: "{{publisherConfirmType}}"
     from:
       uri: "kamelet:source"
       steps:
@@ -110,3 +133,5 @@ spec:
             routingKey: "{{?routingKey}}"
             queues: "{{?queues}}"
             autoDeclareProducer: "{{autoDeclareProducer}}"
+            confirm: "{{confirm}}"
+            confirmTimeout: "{{confirmTimeout}}"

Reply via email to