-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[Spring] Make ServiceBus JMS connection factory creation customizable #49676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
b68fb6e
e79522c
4645bc8
70c3ae9
80f784b
028d709
b1cebf9
63f49e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| package com.azure.spring.cloud.autoconfigure.jms; | ||
|
|
||
| import com.azure.servicebus.jms.ServiceBusJmsConnectionFactory; | ||
|
|
||
| /** | ||
| * Defines how a {@link ServiceBusJmsConnectionFactory} instance is created. | ||
| * <p> | ||
| * Provide this interface as a Spring bean to customize creation of | ||
| * {@link ServiceBusJmsConnectionFactory} (or a subclass). | ||
| * </p> | ||
| * <p> | ||
| * The factory can be invoked multiple times in one application context | ||
| * (for example sender and listener container paths). Implementations should | ||
| * return a new {@link ServiceBusJmsConnectionFactory} instance per invocation, | ||
| * or otherwise ensure the returned instance is safe to share. | ||
| * </p> | ||
| */ | ||
| @FunctionalInterface | ||
| public interface AzureServiceBusJmsConnectionFactoryFactory { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm a bit confused about the naming of the dual-factory pattern because there's already a class with the same name suffix, |
||
|
|
||
| /** | ||
| * Creates an instance of {@link ServiceBusJmsConnectionFactory} or a subclass thereof. | ||
| * | ||
| * @return an instance of {@link ServiceBusJmsConnectionFactory} | ||
| */ | ||
| ServiceBusJmsConnectionFactory createServiceBusJmsConnectionFactory(); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to keep this logic here because the responsibility of the configuration class is simply to create beans, and it doesn't need much other logic. This class is similar to the class in the package path
com.azure.spring.cloud.service.implementation.xxx.factory, both are responsible for credential logic, but the difference is that it is stored in the autoconfiguration module.