Fix #2790: expose publisher confirms on spring-rabbitmq-sink - #2996
Merged
Conversation
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) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2790.
Publisher confirms need two things wired together, and
spring-rabbitmq-sinkexposed neither. This adds all three knobs, in the places they actually live.Where each option belongs
The issue suggested a
confirmTypeproperty. That one is not an endpoint option — the confirm mode is a property of the connection factory, and onlyconfirm/confirmTimeoutexist on thecamel-spring-rabbitmqendpoint:Confirmed against Spring's own class, which is what the template already instantiates inline:
So the split is:
publisherConfirmTypeCachingConnectionFactorybeanNONE(default),SIMPLE,CORRELATEDconfirmauto(default),enabled,disabledconfirmTimeout5000, negative waits indefinitelyI used the name
publisherConfirmTyperather than the issue'sconfirmTypebecause it is the name of the underlying setter — inventing a second name for the same thing would be one more mapping for a reader to hold.The trap this is worth documenting
Setting
confirm: enabledwhile leavingpublisherConfirmTypeatNONEgives you a sink that looks configured for confirms but has nothing to wait on. Both descriptions say so explicitly, because it is the natural mistake given the options are on two different objects.Compatibility
Nothing changes for existing users.
publisherConfirmTypedefaults toNONE, which is the current behaviour — confirms stay off unless opted into.confirmdefaults toauto, matching the component default, andautowith aNONEfactory means no waiting.Verification
script/validatorreports no errors,script/generatorproduces no doc changes,mvn clean installpasses from the repository root.Binding checked against the real component with
camel run, since a string-to-enum conversion on a bean property is exactly the sort of thing that silently fails:The route starts with
publisherConfirmType: CORRELATED,confirm: enabled,confirmTimeout: 3000— the connection factory is constructed and the enum conversion succeeds — and fails only because there is no broker on localhost. A bad enum value or a misnamed bean property would have failed during startup instead. The defaults-only case (none of the three set) also starts cleanly, which is the regression check that matters here.No Citrus test: exercising confirms needs a live RabbitMQ, and there is no broker in the project's Citrus toolchain for this component.
Claude Code on behalf of Andrea Cosentino