diff --git a/eng/common/pipelines/templates/stages/archetype-auto-release-prepare.yml b/eng/common/pipelines/templates/stages/archetype-auto-release-prepare.yml index 1312b1ea1718..8e34b5844643 100644 --- a/eng/common/pipelines/templates/stages/archetype-auto-release-prepare.yml +++ b/eng/common/pipelines/templates/stages/archetype-auto-release-prepare.yml @@ -21,8 +21,8 @@ stages: # fixed cross-language output contract. Downstream release stages read outputs as: # condition: dependencies.AutoReleasePrepare.outputs['ResolveAutoReleasePackages.resolve.'] # variables: stageDependencies.AutoReleasePrepare.ResolveAutoReleasePackages.outputs['resolve.'] - # Emitted variables: AutoReleasePrNumber, AutoReleaseLabelPresent, HasAutoReleaseArtifacts, - # AutoReleaseArtifactsJson, and ReleaseArtifact_ per declared artifact. + # Emitted variables: HasAutoReleaseArtifacts (the single eligibility gate), AutoReleaseArtifactsJson, + # and ReleaseArtifact_ per declared artifact. - stage: AutoReleasePrepare displayName: Auto-release prepare dependsOn: ${{ parameters.DependsOn }} diff --git a/eng/common/scripts/Resolve-AutoReleasePackages.ps1 b/eng/common/scripts/Resolve-AutoReleasePackages.ps1 index b72f39519349..0c9823dfc9ce 100644 --- a/eng/common/scripts/Resolve-AutoReleasePackages.ps1 +++ b/eng/common/scripts/Resolve-AutoReleasePackages.ps1 @@ -21,8 +21,8 @@ commit, this script: for pipelines that iterate the releasable set at runtime (e.g. Java). The script FAILS CLOSED: on any error, or if no qualifying labeled PR / changed package is found, it -emits AutoReleaseLabelPresent=false, HasAutoReleaseArtifacts=false, AutoReleaseArtifactsJson=[] and -ReleaseArtifact_=false for every artifact, and exits 0 so the CI run is not failed. +emits HasAutoReleaseArtifacts=false, AutoReleaseArtifactsJson=[] and ReleaseArtifact_=false +for every artifact, and exits 0 so the CI run is not failed. .PARAMETER CommitSha The build source version (merge commit) to resolve the pull request from. Typically $(Build.SourceVersion). @@ -49,11 +49,11 @@ The base branch a PR must have been merged into to qualify. Defaults to 'main'. .OUTPUTS Azure DevOps output variables (reference cross-stage via dependencies..outputs['..']): - - AutoReleasePrNumber : the resolved PR number, or empty - - AutoReleaseLabelPresent : 'true' if the resolved merged PR has the auto-release label - HasAutoReleaseArtifacts : 'true' if at least one declared package is releasable - AutoReleaseArtifactsJson : JSON array of the matched declared-artifact objects (or '[]') - ReleaseArtifact_ : 'true'/'false' per declared artifact +HasAutoReleaseArtifacts is the single eligibility gate: it is 'true' only when a merged, auto-release-labeled +PR changed at least one declared package, and it is emitted last so any earlier failure fails closed. #> #Requires -Version 7.0 [CmdletBinding()] @@ -86,12 +86,10 @@ try { if ($null -ne $parsed) { $declaredArtifacts = @($parsed) } } catch { - Write-Host "##[warning]Failed to parse -Artifacts JSON; treating as empty. $($_.Exception.Message)" + LogWarning "Failed to parse -Artifacts JSON; treating as empty. $($_.Exception.Message)" } # Fail-closed defaults: nothing releases unless we positively determine otherwise below. -Set-PipelineVariable -Name 'AutoReleasePrNumber' -Value '' -IsOutput -Set-PipelineVariable -Name 'AutoReleaseLabelPresent' -Value 'false' -IsOutput Set-PipelineVariable -Name 'HasAutoReleaseArtifacts' -Value 'false' -IsOutput Set-PipelineVariable -Name 'AutoReleaseArtifactsJson' -Value '[]' -IsOutput foreach ($artifact in $declaredArtifacts) { @@ -109,30 +107,28 @@ function Invoke-AutoReleaseResolution { -RequiredLabel $AutoReleaseLabel ` -AuthToken $AuthToken - if ($release.PullRequestNumber) { - Set-PipelineVariable -Name 'AutoReleasePrNumber' -Value "$($release.PullRequestNumber)" -IsOutput - } - if (-not $release.IsEligible) { Write-Host "Skipping auto-release: $($release.SkipReason)" return } $pr = $release.PullRequest - Write-Host "PR #$($pr.number) is eligible for auto-release (merged into '$BaseBranch' with the '$AutoReleaseLabel' label)." - Set-PipelineVariable -Name 'AutoReleaseLabelPresent' -Value 'true' -IsOutput + # Prefer the PR's canonical html_url; fall back to constructing it so the log link stays clickable even + # if the field is absent from the payload. + $prLink = if ($pr.PSObject.Properties['html_url'] -and $pr.html_url) { "$($pr.html_url)" } else { "https://github.com/$RepoId/pull/$($pr.number)" } + Write-Host "PR $prLink is eligible for auto-release (merged into '$BaseBranch' with the '$AutoReleaseLabel' label)." if ($declaredArtifacts.Count -eq 0) { - Write-Host "No declared artifacts for this pipeline. Nothing to auto-release." + LogWarning "PR $prLink has the '$AutoReleaseLabel' label but this pipeline declares no artifacts; nothing will be auto-released." return } # Turn the PR's changed files into a diff object (Generate-PR-Diff.ps1 shape) and reuse the repo's # package-detection logic to identify the changed packages. - Write-Host "Fetching changed files for PR #$($pr.number)..." + Write-Host "Fetching changed files for PR $prLink..." $files = @(Get-GitHubPullRequestFiles -RepoId $RepoId -PullRequestNumber $pr.number -AuthToken $AuthToken) $diff = New-GitHubPullRequestDiffObject -PullRequestNumber $pr.number -PullRequestFiles $files - Write-Host "PR #$($pr.number) changed $($diff.ChangedFiles.Count) file(s) and deleted $($diff.DeletedFiles.Count) file(s)." + Write-Host "PR $prLink changed $($diff.ChangedFiles.Count) file(s) and deleted $($diff.DeletedFiles.Count) file(s)." $diffPath = Join-Path ([System.IO.Path]::GetTempPath()) ("autorelease-diff-" + [System.Guid]::NewGuid().ToString('N') + ".json") $diff | ConvertTo-Json -Depth 10 | Set-Content -Path $diffPath -Encoding utf8 @@ -187,16 +183,16 @@ function Invoke-AutoReleaseResolution { } if ($isMatch) { - Write-Host " [$name] changed by PR #$($pr.number) -> releasable." + Write-Host " [$name] changed by PR $prLink -> releasable." Set-PipelineVariable -Name "ReleaseArtifact_$safeName" -Value 'true' -IsOutput $matchedArtifacts += $artifact } else { - Write-Host " [$name] not changed by PR #$($pr.number)." + Write-Host " [$name] not changed by PR $prLink." } } catch { - Write-Host "##[warning]Failed to evaluate an artifact; treating as not releasable. $($_.Exception.Message)" + LogWarning "Failed to evaluate an artifact; treating as not releasable. $($_.Exception.Message)" } } @@ -204,11 +200,11 @@ function Invoke-AutoReleaseResolution { # Pipe (not -InputObject) with -AsArray so a single match still serializes as a JSON array, '[{...}]'. $artifactsJson = $matchedArtifacts | ConvertTo-Json -Depth 100 -Compress -AsArray Set-PipelineVariable -Name 'AutoReleaseArtifactsJson' -Value $artifactsJson -IsOutput - Write-Host "Auto-release packages from PR #$($pr.number): $((@($matchedArtifacts | ForEach-Object { $_.name })) -join ', ')" + Write-Host "Auto-release packages from PR ${prLink}: $((@($matchedArtifacts | ForEach-Object { $_.name })) -join ', ')" Set-PipelineVariable -Name 'HasAutoReleaseArtifacts' -Value 'true' -IsOutput } else { - Write-Host "PR #$($pr.number) changed no releasable package in this pipeline." + LogWarning "PR $prLink has the '$AutoReleaseLabel' label but changed no releasable package in this pipeline; nothing will be auto-released." } } @@ -216,11 +212,10 @@ try { Invoke-AutoReleaseResolution } catch { - # Re-emit the fail-closed defaults so a failure after any positive signal was set (e.g. after - # AutoReleaseLabelPresent or a ReleaseArtifact_ flag was flipped to 'true') cannot leak a - # partial "release" decision to downstream stages, regardless of how each consumer gates on the outputs. - Write-Host "##[warning]Auto-release resolution failed; skipping auto-release. $($_.Exception.Message)" - Set-PipelineVariable -Name 'AutoReleaseLabelPresent' -Value 'false' -IsOutput + # Re-emit the fail-closed defaults so a failure after any positive signal was set (e.g. after a + # ReleaseArtifact_ flag was flipped to 'true') cannot leak a partial "release" decision to + # downstream stages, regardless of how each consumer gates on the outputs. + LogWarning "Auto-release resolution failed; skipping auto-release. $($_.Exception.Message)" Set-PipelineVariable -Name 'HasAutoReleaseArtifacts' -Value 'false' -IsOutput Set-PipelineVariable -Name 'AutoReleaseArtifactsJson' -Value '[]' -IsOutput foreach ($artifact in $declaredArtifacts) { diff --git a/sdk/spring/CHANGELOG.md b/sdk/spring/CHANGELOG.md index e15247907a52..13874b75783e 100644 --- a/sdk/spring/CHANGELOG.md +++ b/sdk/spring/CHANGELOG.md @@ -25,6 +25,14 @@ This section includes changes in `spring-cloud-azure-autoconfigure` module. - Upgrade to Jackson 3 to align with Spring Boot 4 ([#49538](https://github.com/Azure/azure-sdk-for-java/issues/49538)). +### Spring Cloud Azure Service + +This section includes changes in `spring-cloud-azure-service` module. + +#### Bugs Fixed + +- Fixed the Service Bus producer, consumer and processor sub-client builders overwriting configuration already set on the underlying `ServiceBusClientBuilder` through an `AzureServiceClientBuilderCustomizer` (for example the `ClientOptions` carrying `TracingOptions`). The customizers are now applied to the underlying builder as the last step, so their configuration is preserved ([#49742](https://github.com/Azure/azure-sdk-for-java/issues/49742)). + ### Spring Messaging Azure This section includes changes in `spring-messaging-azure` module. diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/messaging/AzureMessagingListenerAutoConfiguration.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/messaging/AzureMessagingListenerAutoConfiguration.java index ee1c360a9459..3fc1d730e27c 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/messaging/AzureMessagingListenerAutoConfiguration.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/messaging/AzureMessagingListenerAutoConfiguration.java @@ -49,8 +49,10 @@ public class AzureMessagingListenerAutoConfiguration { @Configuration @ConditionalOnBean(EventHubsProcessorFactory.class) static class EventHubsConfiguration { - @Bean(name = "azureEventHubsListenerContainerFactory") - @ConditionalOnMissingBean(name = "azureEventHubsListenerContainerFactory") + @Bean( + name = EventHubsListenerAnnotationBeanPostProcessor.DEFAULT_EVENT_HUBS_LISTENER_CONTAINER_FACTORY_BEAN_NAME) + @ConditionalOnMissingBean( + name = EventHubsListenerAnnotationBeanPostProcessor.DEFAULT_EVENT_HUBS_LISTENER_CONTAINER_FACTORY_BEAN_NAME) public MessageListenerContainerFactory azureEventHubsListenerContainerFactory( EventHubsProcessorFactory eventHubsProcessorFactory, ObjectProvider> messageConverterProvider) { @@ -73,8 +75,10 @@ static class EnableEventHubsConfiguration { @Configuration @ConditionalOnBean(ServiceBusProcessorFactory.class) static class ServiceBusConfiguration { - @Bean(name = "azureServiceBusListenerContainerFactory") - @ConditionalOnMissingBean(name = "azureServiceBusListenerContainerFactory") + @Bean( + name = ServiceBusListenerAnnotationBeanPostProcessor.DEFAULT_SERVICE_BUS_LISTENER_CONTAINER_FACTORY_BEAN_NAME) + @ConditionalOnMissingBean( + name = ServiceBusListenerAnnotationBeanPostProcessor.DEFAULT_SERVICE_BUS_LISTENER_CONTAINER_FACTORY_BEAN_NAME) public MessageListenerContainerFactory azureServiceBusListenerContainerFactory( ServiceBusProcessorFactory serviceBusProcessorFactory, ObjectProvider> messageConverterProvider) { diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/factory/AbstractServiceBusSubClientBuilderFactory.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/factory/AbstractServiceBusSubClientBuilderFactory.java index 060dfc07a26f..836a0550d186 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/factory/AbstractServiceBusSubClientBuilderFactory.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/factory/AbstractServiceBusSubClientBuilderFactory.java @@ -39,10 +39,11 @@ abstract class AbstractServiceBusSubClientBuilderFactory> serviceBusClientBuilderCustomizers; /** * Create a {@link AbstractServiceBusSubClientBuilderFactory} instance with the properties and the collection of - * @{link ServiceBusClientBuilder} customizers. + * {@link AzureServiceClientBuilderCustomizer} customizers. * @param properties the properties describing the service bus sub client, which could be a sender, a receiver or * a processor. * @param serviceClientBuilderCustomizers the collection of customizers for the service bus client builder. @@ -70,11 +71,16 @@ protected AbstractServiceBusSubClientBuilderFactory(ServiceBusClientBuilder serv this.serviceBusClientBuilder = serviceBusClientBuilder; this.shareServiceBusClientBuilder = true; this.serviceBusClientBuilderFactory = null; + // The shared ServiceBusClientBuilder is configured and customized by its own factory, so there are no + // customizers for this sub-client builder factory to re-apply. + this.serviceBusClientBuilderCustomizers = null; } else { this.serviceBusClientBuilderFactory = new ServiceBusClientBuilderFactory(properties); - if (serviceBusClientBuilderCustomizers != null) { - serviceBusClientBuilderCustomizers.forEach(this.serviceBusClientBuilderFactory::addBuilderCustomizer); - } + // Remember the customizers instead of adding them to the nested factory, so they are applied to the + // underlying ServiceBusClientBuilder as the last step of each build() call. This ensures they win over + // the property-derived configuration this factory redirects onto the shared builder (for example + // ClientOptions carrying TracingOptions). See #49742. + this.serviceBusClientBuilderCustomizers = serviceBusClientBuilderCustomizers; // Don't build yet - defer until first use when ApplicationContext is available this.serviceBusClientBuilder = null; this.shareServiceBusClientBuilder = false; @@ -90,6 +96,23 @@ public void setApplicationContext(ApplicationContext applicationContext) throws } } + @Override + public T build() { + // super.build() creates the sub-client builder and, in the non-shared path, lazily builds and configures + // the underlying ServiceBusClientBuilder from the properties (including the Spring identifier). + // The customizers are deliberately not applied during that step. + T builder = super.build(); + // Apply the ServiceBusClientBuilder customizers as the last step of this build() call, + // so they take precedence over the property-derived configuration redirected onto the underlying builder. + // See #49742. + if (!isShareServiceBusClientBuilder() && this.serviceBusClientBuilderCustomizers != null) { + ServiceBusClientBuilder parentServiceBusClientBuilder = getServiceBusClientBuilder(); + this.serviceBusClientBuilderCustomizers.forEach(customizer -> + customizer.customize(parentServiceBusClientBuilder)); + } + return builder; + } + @Override protected void configureCredential(T builder) { // skip to avoid overriding the parent builder's credentials. diff --git a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/lifecycle/ServiceBusProcessorClientLifecycleManager.java b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/lifecycle/ServiceBusProcessorClientLifecycleManager.java index bc34275b242b..16aa4882f8c2 100644 --- a/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/lifecycle/ServiceBusProcessorClientLifecycleManager.java +++ b/sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/lifecycle/ServiceBusProcessorClientLifecycleManager.java @@ -12,10 +12,12 @@ /** * Helper class to control the lifecycle of a {@link ServiceBusProcessorClient}. - * This class implements {@code SmartLifecycle} to auto start {@link ServiceBusProcessorClient} when the Spring Application Context starts, - * And stop the {@link ServiceBusProcessorClient} when the Spring Application Context stops. - * NOTE, there is not need to call {@link #start()} or {@link #stop()} explicitly, as the {@link ServiceBusProcessorClient} will be started and stopped automatically. - * And since the {@link ServiceBusProcessorClient} is a {@link AutoCloseable}, there is no need to call {@link ServiceBusProcessorClient#close()} explicitly. + * This class implements {@code SmartLifecycle} to automatically start {@link ServiceBusProcessorClient} when the + * Spring Application Context starts and stops it when the Spring Application Context stops. + * NOTE: There is no need to call {@link #start()} or {@link #stop()} explicitly, as the + * {@link ServiceBusProcessorClient} will be started and stopped automatically. + * Since {@link ServiceBusProcessorClient} is {@link AutoCloseable}, there is no need to call + * {@link ServiceBusProcessorClient#close()} explicitly. */ public class ServiceBusProcessorClientLifecycleManager implements SmartLifecycle { private final Logger logger = LoggerFactory.getLogger(ServiceBusProcessorClientLifecycleManager.class); diff --git a/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/servicebus/factory/ServiceBusSenderClientBuilderFactoryTests.java b/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/servicebus/factory/ServiceBusSenderClientBuilderFactoryTests.java index 06dd1c00391e..77c4084c6a03 100644 --- a/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/servicebus/factory/ServiceBusSenderClientBuilderFactoryTests.java +++ b/sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/servicebus/factory/ServiceBusSenderClientBuilderFactoryTests.java @@ -3,10 +3,18 @@ package com.azure.spring.cloud.service.implementation.servicebus.factory; +import com.azure.core.util.ClientOptions; import com.azure.messaging.servicebus.ServiceBusClientBuilder; +import com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer; import com.azure.spring.cloud.service.implementation.servicebus.properties.ServiceBusSenderClientTestProperties; import com.azure.spring.cloud.service.servicebus.properties.ServiceBusEntityType; import org.junit.jupiter.api.Test; +import org.mockito.ArgumentMatchers; +import org.mockito.InOrder; +import org.mockito.Mockito; + +import java.util.Collections; +import java.util.List; import static org.mockito.Mockito.atLeast; import static org.mockito.Mockito.doReturn; @@ -34,6 +42,29 @@ void queueConfigured() { verify(builder, times(1)).queueName("test-queue"); } + @Test + void serviceBusClientBuilderCustomizerAppliedAsLastStep() { + ServiceBusSenderClientTestProperties properties = createMinimalServiceProperties(); + properties.setShareServiceBusClientBuilder(false); + + ServiceBusClientBuilder rootBuilder = mock(ServiceBusClientBuilder.class); + @SuppressWarnings("unchecked") + AzureServiceClientBuilderCustomizer customizer = + mock(AzureServiceClientBuilderCustomizer.class); + + ServiceBusSenderClientBuilderFactory factory = + new CustomizerTestFactory(properties, Collections.singletonList(customizer), rootBuilder); + + factory.build(); + + InOrder inOrder = Mockito.inOrder(rootBuilder, customizer); + inOrder.verify(rootBuilder, atLeast(1)) + .clientOptions(ArgumentMatchers.any(ClientOptions.class)); + inOrder.verify(customizer, times(1)).customize(rootBuilder); + inOrder.verify(rootBuilder, Mockito.never()) + .clientOptions(ArgumentMatchers.any(ClientOptions.class)); + } + @Override protected ServiceBusSenderClientTestProperties createMinimalServiceProperties() { ServiceBusSenderClientTestProperties properties = new ServiceBusSenderClientTestProperties(); @@ -100,4 +131,24 @@ protected ServiceBusClientBuilder getServiceBusClientBuilder() { return this.serviceBusClientBuilder; } } + + static class CustomizerTestFactory extends ServiceBusSenderClientBuilderFactory { + private final ServiceBusClientBuilder serviceBusClientBuilder; + CustomizerTestFactory(ServiceBusSenderClientTestProperties properties, + List> customizers, + ServiceBusClientBuilder serviceBusClientBuilder) { + super(properties, customizers); + this.serviceBusClientBuilder = serviceBusClientBuilder; + } + + @Override + public ServiceBusClientBuilder.ServiceBusSenderClientBuilder createBuilderInstance() { + return mock(ServiceBusClientBuilder.ServiceBusSenderClientBuilder.class); + } + + @Override + protected ServiceBusClientBuilder getServiceBusClientBuilder() { + return this.serviceBusClientBuilder; + } + } } diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/messaging/eventhubs/implementation/core/annotation/EventHubsListener.java b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/messaging/eventhubs/implementation/core/annotation/EventHubsListener.java index 968b79e3c680..a3e6a6fc0bb1 100644 --- a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/messaging/eventhubs/implementation/core/annotation/EventHubsListener.java +++ b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/messaging/eventhubs/implementation/core/annotation/EventHubsListener.java @@ -20,7 +20,7 @@ * specified {@link #destination}. The {@link #containerFactory} identifies the * {@link MessageListenerContainerFactory} to use to build * the Azure listener container. If not set, a default container factory is - * assumed to be available with a bean name of {@code eventHubsListenerContainerFactory} + * assumed to be available with a bean name of {@code azureEventHubsListenerContainerFactory} * unless an explicit default has been provided through configuration. * *

Processing of {@code @EventHubsListener} annotations is performed by registering a diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/messaging/eventhubs/implementation/core/annotation/EventHubsListenerAnnotationBeanPostProcessor.java b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/messaging/eventhubs/implementation/core/annotation/EventHubsListenerAnnotationBeanPostProcessor.java index da40c1b3065f..715740a5f7fb 100644 --- a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/messaging/eventhubs/implementation/core/annotation/EventHubsListenerAnnotationBeanPostProcessor.java +++ b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/messaging/eventhubs/implementation/core/annotation/EventHubsListenerAnnotationBeanPostProcessor.java @@ -42,7 +42,7 @@ public class EventHubsListenerAnnotationBeanPostProcessor extends AzureListenerAnnotationBeanPostProcessorAdapter { public static final String DEFAULT_EVENT_HUBS_LISTENER_ANNOTATION_BPP_BEAN_NAME = "eventHubsListenerAnnotationBeanPostProcessor"; - private static final String DEFAULT_EVENT_HUBS_LISTENER_CONTAINER_FACTORY_BEAN_NAME = "azureEventHubsListenerContainerFactory"; + public static final String DEFAULT_EVENT_HUBS_LISTENER_CONTAINER_FACTORY_BEAN_NAME = "azureEventHubsListenerContainerFactory"; /** * Construct an {@link EventHubsListenerAnnotationBeanPostProcessor} instance with default configuration. diff --git a/sdk/spring/spring-messaging-azure-servicebus/src/main/java/com/azure/spring/messaging/servicebus/implementation/core/annotation/ServiceBusListener.java b/sdk/spring/spring-messaging-azure-servicebus/src/main/java/com/azure/spring/messaging/servicebus/implementation/core/annotation/ServiceBusListener.java index 2de391e86e36..f1009cba2384 100644 --- a/sdk/spring/spring-messaging-azure-servicebus/src/main/java/com/azure/spring/messaging/servicebus/implementation/core/annotation/ServiceBusListener.java +++ b/sdk/spring/spring-messaging-azure-servicebus/src/main/java/com/azure/spring/messaging/servicebus/implementation/core/annotation/ServiceBusListener.java @@ -20,7 +20,7 @@ * specified {@link #destination}. The {@link #containerFactory} identifies the * {@link MessageListenerContainerFactory} to use to build * the Azure listener container. If not set, a default container factory is - * assumed to be available with a bean name of {@code serviceBusListenerContainerFactory} + * assumed to be available with a bean name of {@code azureServiceBusListenerContainerFactory} * unless an explicit default has been provided through configuration. * *

Processing of {@code @ServiceBusListener} annotations is performed by registering a diff --git a/sdk/spring/spring-messaging-azure-servicebus/src/main/java/com/azure/spring/messaging/servicebus/implementation/core/annotation/ServiceBusListenerAnnotationBeanPostProcessor.java b/sdk/spring/spring-messaging-azure-servicebus/src/main/java/com/azure/spring/messaging/servicebus/implementation/core/annotation/ServiceBusListenerAnnotationBeanPostProcessor.java index 10496af577f1..e9c7add84901 100644 --- a/sdk/spring/spring-messaging-azure-servicebus/src/main/java/com/azure/spring/messaging/servicebus/implementation/core/annotation/ServiceBusListenerAnnotationBeanPostProcessor.java +++ b/sdk/spring/spring-messaging-azure-servicebus/src/main/java/com/azure/spring/messaging/servicebus/implementation/core/annotation/ServiceBusListenerAnnotationBeanPostProcessor.java @@ -43,7 +43,7 @@ public class ServiceBusListenerAnnotationBeanPostProcessor extends AzureListenerAnnotationBeanPostProcessorAdapter { public static final String DEFAULT_SERVICE_BUS_LISTENER_ANNOTATION_BPP_BEAN_NAME = "serviceBusListenerAnnotationBeanPostProcessor"; - private static final String DEFAULT_SERVICE_BUS_LISTENER_CONTAINER_FACTORY_BEAN_NAME = "azureServiceBusListenerContainerFactory"; + public static final String DEFAULT_SERVICE_BUS_LISTENER_CONTAINER_FACTORY_BEAN_NAME = "azureServiceBusListenerContainerFactory"; /** * Construct an {@link ServiceBusListenerAnnotationBeanPostProcessor} instance with default configuration. @@ -64,7 +64,7 @@ protected AzureListenerEndpoint createAndConfigureMethodListenerEndpoint(Service BeanFactory beanFactory, MessageHandlerMethodFactory messageHandlerMethodFactory) { MethodServiceBusListenerEndpoint endpoint = new MethodServiceBusListenerEndpoint(); - + endpoint.setBean(bean); endpoint.setMethod(method); endpoint.setBeanFactory(beanFactory); diff --git a/sdk/spring/spring-messaging-azure/src/main/java/com/azure/spring/messaging/implementation/config/AzureListenerEndpoint.java b/sdk/spring/spring-messaging-azure/src/main/java/com/azure/spring/messaging/implementation/config/AzureListenerEndpoint.java index 5ba0d9fafc5f..3a919fccce3a 100644 --- a/sdk/spring/spring-messaging-azure/src/main/java/com/azure/spring/messaging/implementation/config/AzureListenerEndpoint.java +++ b/sdk/spring/spring-messaging-azure/src/main/java/com/azure/spring/messaging/implementation/config/AzureListenerEndpoint.java @@ -8,8 +8,8 @@ import com.azure.spring.messaging.listener.MessageListenerContainer; /** - * Model for a Azure listener endpoint. Can be used against a {@link AzureListenerConfigurer AzureListenerConfigurer} to - * register endpoints programmatically. + * Model for an Azure listener endpoint. Can be used against a {@link AzureListenerConfigurer AzureListenerConfigurer} + * to register endpoints programmatically. */ public interface AzureListenerEndpoint { diff --git a/sdk/template/azure-sdk-template-three/README.md b/sdk/template/azure-sdk-template-three/README.md index 9de375ef15c2..ab6a41417108 100644 --- a/sdk/template/azure-sdk-template-three/README.md +++ b/sdk/template/azure-sdk-template-three/README.md @@ -153,5 +153,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com - - diff --git a/sdk/template/azure-sdk-template-two/README.md b/sdk/template/azure-sdk-template-two/README.md index 8042ecd591fb..34e4a0bc5615 100644 --- a/sdk/template/azure-sdk-template-two/README.md +++ b/sdk/template/azure-sdk-template-two/README.md @@ -153,5 +153,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [coc_contact]: mailto:opencode@microsoft.com - -