Skip to content

Add auto-configuration for JmsClient.Builder#49853

Open
vpavic wants to merge 1 commit intospring-projects:mainfrom
vpavic:jmsclient-builder-autoconfig
Open

Add auto-configuration for JmsClient.Builder#49853
vpavic wants to merge 1 commit intospring-projects:mainfrom
vpavic:jmsclient-builder-autoconfig

Conversation

@vpavic
Copy link
Copy Markdown
Contributor

@vpavic vpavic commented Mar 31, 2026

This commit adds auto-configuration for JmsClient.Builder prototype bean in order to enable reuse of preconfigured instances for further customization (for example, message conversion), similar to usages of JsonMapper.Builder, RestClient.Builder and others that follow the same pattern.

This commit adds auto-configuration for `JmsClient.Builder` prototype
bean in order to enable reuse of preconfigured instances for further
customization (for example, message conversion), similar to usages of
`JsonMapper.Builder`, `RestClient.Builder` and others that follow the
same pattern.

Signed-off-by: Vedran Pavic <vedran@vedranpavic.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 31, 2026
@snicoll
Copy link
Copy Markdown
Member

snicoll commented Mar 31, 2026

@vpavic can you please clarify (besides consistency) what you're looking for here? Contrary to the builder you've described, JmsClient.Builder has currently no pre-configuration.

@snicoll snicoll added the status: waiting-for-feedback We need additional information before we can continue label Mar 31, 2026
@vpavic
Copy link
Copy Markdown
Contributor Author

vpavic commented Mar 31, 2026

I'm not looking for consistency (that's just a side effect) but rather exactly what commit message describes:

  • ability to provide common configuration using spring.jms.template.* properties - this is what preconfigured client builder instances will effectively provide
  • ability to take such client builder and apply application-level customizations, most commonly message converters, according to specific needs of individual destinations application interacts with

This is analogous to how I use JsonMapper.Builder and RestClient.Builder instances provided by Spring Boot.

While migrating one project from JmsTemplate to JmsClient I noticed latter contains Builder contract - which was the trigger for this contribution, as it provides potential for simplifying things because I would no longer need to configure multiple JmsTemplate beans.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Mar 31, 2026
@snicoll
Copy link
Copy Markdown
Member

snicoll commented Apr 1, 2026

exactly what commit message describes

I read the commit if that's what you were trying to point out.

The problem here is that the builder is created by a JmsTemplate that could be the one of the auto-configuration but it could be the one from the user. If it is the one from the user, then you end up with a builder that's provided with settings from whatever the user has defined.

This is analogous to how I use JsonMapper.Builder and RestClient.Builder instances provided by Spring Boot.

It isn't. The change is too weak at this point to be considered. If we provide a builder it must always be provided with the auto-configuration applied to it and the curent API makes it quite hard to do so. That's also why this wasn't provided in the first place.

@snicoll snicoll added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants