-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Changes from all commits
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 |
---|---|---|
|
@@ -83,8 +83,8 @@ public class EventHubsMessageChannelBinder extends | |
private final Map<String, ExtendedProducerProperties<EventHubsProducerProperties>> | ||
extendedProducerPropertiesMap = new ConcurrentHashMap<>(); | ||
|
||
private List<EventHubsProducerFactoryCustomizer> producerFactoryCustomizers = new ArrayList<>(); | ||
private List<EventHubsProcessorFactoryCustomizer> processorFactoryCustomizers = new ArrayList<>(); | ||
private final List<EventHubsProducerFactoryCustomizer> producerFactoryCustomizers = new ArrayList<>(); | ||
private final List<EventHubsProcessorFactoryCustomizer> processorFactoryCustomizers = new ArrayList<>(); | ||
|
||
/** | ||
* Construct a {@link EventHubsMessageChannelBinder} with the specified headers to embed and {@link EventHubsChannelProvisioner}. | ||
|
@@ -281,21 +281,25 @@ InstrumentationManager getInstrumentationManager() { | |
} | ||
|
||
/** | ||
* Set the producer factory customizers. | ||
* Add a producer factory customizer. | ||
* | ||
* @param producerFactoryCustomizers The producer factory customizers. | ||
* @param producerFactoryCustomizer The producer factory customizer to add. | ||
*/ | ||
public void setProducerFactoryCustomizers(List<EventHubsProducerFactoryCustomizer> producerFactoryCustomizers) { | ||
this.producerFactoryCustomizers = producerFactoryCustomizers; | ||
public void addProducerFactoryCustomizer(EventHubsProducerFactoryCustomizer producerFactoryCustomizer) { | ||
if (producerFactoryCustomizer != null) { | ||
this.producerFactoryCustomizers.add(producerFactoryCustomizer); | ||
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. Do we need to consider thread-safe here? 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. not for now |
||
} | ||
} | ||
|
||
/** | ||
* Set the processor factory customizers. | ||
* Add a processor factory customizer. | ||
* | ||
* @param processorFactoryCustomizers The processor factory customizers. | ||
* @param processorFactoryCustomizer The processor factory customizer to add. | ||
*/ | ||
public void setProcessorFactoryCustomizers(List<EventHubsProcessorFactoryCustomizer> processorFactoryCustomizers) { | ||
this.processorFactoryCustomizers = processorFactoryCustomizers; | ||
public void addProcessorFactoryCustomizer(EventHubsProcessorFactoryCustomizer processorFactoryCustomizer) { | ||
if (processorFactoryCustomizer != null) { | ||
this.processorFactoryCustomizers.add(processorFactoryCustomizer); | ||
} | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,8 +36,6 @@ | |
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Import; | ||
|
||
import java.util.stream.Collectors; | ||
|
||
import static com.azure.spring.cloud.autoconfigure.context.AzureContextUtils.DEFAULT_TOKEN_CREDENTIAL_BEAN_NAME; | ||
|
||
/** | ||
|
@@ -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); | ||
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. How about adding 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. not for now, but maybe in later versions |
||
processorFactoryCustomizers.orderedStream().forEach(binder::addProcessorFactoryCustomizer); | ||
return binder; | ||
} | ||
|
||
|
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.
When will
producerFactoryCustomizer
be null?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.
this could be call by users