Skip to content
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

Change the setClientFactoryCustomizers to addClientFactoryCustomizer #27775

Conversation

saragluna
Copy link
Member

This PR will change the API of setClientFactoryCustomizers(List<ClientFactoryCustomizer> customizers) to addClientFactoryCustomizer(ClientFactoryCustomizer customizer) so the autoconfigured client factory customizers will still be available.

@ghost ghost added the azure-spring All azure-spring related issues label Mar 21, 2022
@azure-sdk
Copy link
Collaborator

API changes have been detected in com.azure.spring:spring-cloud-azure-stream-binder-servicebus. You can review API changes here

@azure-sdk
Copy link
Collaborator

API changes have been detected in com.azure.spring:spring-cloud-azure-stream-binder-eventhubs. You can review API changes here

public void setProducerFactoryCustomizers(List<EventHubsProducerFactoryCustomizer> producerFactoryCustomizers) {
this.producerFactoryCustomizers = producerFactoryCustomizers;
public void addProducerFactoryCustomizer(EventHubsProducerFactoryCustomizer producerFactoryCustomizer) {
if (producerFactoryCustomizer != null) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When will producerFactoryCustomizer be null?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be call by users

this.producerFactoryCustomizers = producerFactoryCustomizers;
public void addProducerFactoryCustomizer(EventHubsProducerFactoryCustomizer producerFactoryCustomizer) {
if (producerFactoryCustomizer != null) {
this.producerFactoryCustomizers.add(producerFactoryCustomizer);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to consider thread-safe here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not for now

@@ -110,8 +108,8 @@ public EventHubsMessageChannelBinder eventHubBinder(EventHubsChannelProvisioner
binder.setBindingProperties(bindingProperties);
binder.setNamespaceProperties(namespaceProperties.getIfAvailable());
checkpointStores.ifAvailable(binder::setCheckpointStore);
binder.setProducerFactoryCustomizers(producerFactoryCustomizers.orderedStream().collect(Collectors.toList()));
binder.setProcessorFactoryCustomizers(processorFactoryCustomizers.orderedStream().collect(Collectors.toList()));
producerFactoryCustomizers.orderedStream().forEach(binder::addProducerFactoryCustomizer);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding addProducerFactoryCustomizers to support add multiple customizers one time?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not for now, but maybe in later versions

@saragluna
Copy link
Member Author

/azp run java - spring - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@yiliuTo yiliuTo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@saragluna saragluna merged commit d23fde6 into Azure:feature/azure-spring-cloud-4.0 Mar 22, 2022
@saragluna saragluna deleted the xiada/fix-binder-configuration branch April 12, 2022 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
azure-spring All azure-spring related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants