-
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
[BUG] Service bus custom endpoint address #43555
Comments
@Anton0123 Thank you for reaching out. @Netyyyy could you please look into this issue? |
Sure, we will take a look |
Thank you, this is currently a blocker for us going into production |
HI @Anton0123 , thanks for using Spring Cloud Azure! You can use the below workaround first; the fix is coming and available in the next version: Add below Java configuration: @Configuration
class ServiceBusClientConfiguration {
@Bean
AzureServiceClientBuilderCustomizer<ServiceBusClientBuilder> reproducerCustomizer() {
return builder -> builder.customEndpointAddress("https://test.address.com:443");
}
@Bean
ServiceBusProcessorFactoryCustomizer processorFactoryCustomizer(@Qualifier(DEFAULT_TOKEN_CREDENTIAL_BEAN_NAME) TokenCredential defaultAzureCredential,
AzureTokenCredentialResolver azureTokenCredentialResolver,
ObjectProvider<AzureServiceClientBuilderCustomizer<ServiceBusClientBuilder>> clientBuilderCustomizers) {
return (processor -> {
if (processor instanceof DefaultServiceBusNamespaceProcessorFactory factory) {
factory.setDefaultCredential(defaultAzureCredential);
factory.setTokenCredentialResolver(azureTokenCredentialResolver);
clientBuilderCustomizers.orderedStream().forEach(factory::addServiceBusClientBuilderCustomizer);
}
});
}
@Bean
ServiceBusProducerFactoryCustomizer producerFactoryCustomizer(@Qualifier(DEFAULT_TOKEN_CREDENTIAL_BEAN_NAME) TokenCredential defaultAzureCredential,
AzureTokenCredentialResolver azureTokenCredentialResolver,
ObjectProvider<AzureServiceClientBuilderCustomizer<ServiceBusClientBuilder>> clientBuilderCustomizers) {
return (producer -> {
if (producer instanceof DefaultServiceBusNamespaceProducerFactory factory) {
factory.setDefaultCredential(defaultAzureCredential);
factory.setTokenCredentialResolver(azureTokenCredentialResolver);
clientBuilderCustomizers.orderedStream().forEach(factory::addServiceBusClientBuilderCustomizer);
}
});
}
} |
@moarychan Thank you for the quick resolution and for the workaround! It seems like it did the trick. |
Describe the bug
The custom endpoint address is not merged from the namespace properties to producer/processor/consumer properties. This results in the custom endpoint address being null.
To Reproduce
Configure a custom endpoint address for the namespace but not for individual consumers or producers. The custom endpoint address will not be used when sending or receiving messages.
Code Snippet
Example configuration
Expected behavior
I expect the custom-endpoint-address to be used by the consumers/producers/processors.
Screenshots
Setup (please complete the following information):
Additional context
See
com.azure.spring.messaging.servicebus.implementation.properties.merger
, for exampleSenderPropertiesParentMerger
. It does not map the custom endpoint address.https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/spring/spring-messaging-azure-servicebus/src/main/java/com/azure/spring/messaging/servicebus/implementation/properties/merger/SenderPropertiesParentMerger.java
The text was updated successfully, but these errors were encountered: