Skip to content

[BUG] spring-messaging-azure-servicebus when Upgreading spring boot version from 2.7.13 to 3.1.0 Throws a bean not found error #36114

Description

@AsmaeFILALI

Describe the bug
spring-messaging-azure-servicebus when Upgreading spring boot version from 2.7.13 to 3.1.0 Throws an Error, the Same code works well in the spring version 2.7.13, in the documentation the only step for migrating to spring 3.x.x is to use spring-cloud-azure-dependencies with the version 5.3.0

Exception or Stack Trace
Application Failed to start, Description: A component required a bean named 'azureServiceBusListenerContainerFactory' that could not be found.

To Reproduce

	<dependency>
			<groupId>com.azure.spring</groupId>
			<artifactId>spring-cloud-azure-starter</artifactId>
		</dependency>
		<dependency>
			<groupId>com.azure.spring</groupId>
			<artifactId>spring-messaging-azure-servicebus</artifactId>
		</dependency>
	</dependencies>
	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>
	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>com.azure.spring</groupId>
				<artifactId>spring-cloud-azure-dependencies</artifactId>
				<version>5.3.0</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>
</project>
  • META-INF/spring.factories
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.azure.spring.cloud.autoconfigure.messaging.AzureMessagingListenerAutoConfiguration

The code is the same as the one instructed in microsoft's documentation : https://learn.microsoft.com/en-us/azure/developer/java/spring-framework/using-service-bus-in-spring-applications#use-spring-messaging-azure-service-bus
Expected behavior
That the Application starts and sends/recieves messages from servicebus

Screenshots
If applicable, add screenshots to help explain your problem.

Setup (please complete the following information):

  • OS: windows
  • IDE: vscode
  • Library/Libraries: com.azure.spring:spring-cloud-azure-dependencies:5.3.0 imported in the dependency management
  • Java version: [17]
  • App Server/Environment: Tomcat embeded in springboot
  • Frameworks: Spring Boot 3.1.0

If you suspect a dependency version mismatch (e.g. you see NoClassDefFoundError, NoSuchMethodError or similar), please check out Troubleshoot dependency version conflict article first. If it doesn't provide solution for the problem, please provide:

  • verbose dependency tree (mvn dependency:tree -Dverbose)
  • exception message, full stack trace, and any available logs

Additional context

  • Have done a debug for trying to resolve the issue, first thing it looks that AzureMessagingListenerAutoConfiguration package have changed from com.azure.spring.cloud.autoconfigure.messaging to com.azure.spring.cloud.autoconfigure.implementation.messaging
  • I have included the com.azure.spring.cloud.autoconfigure.implementation.messaging.AzureMessagingListenerAutoConfiguration in the spring.factories file as following
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.azure.spring.cloud.autoconfigure.implementation.messaging.AzureMessagingListenerAutoConfiguration

The above steps did not resolve the Issue, I have put a break point in the class com.azure.spring.cloud.autoconfigure.implementation.messaging.AzureMessagingListenerAutoConfiguration the debbuger never stops on it while stopping on the other autoconfiguration classes

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientThis issue points to a problem in the data-plane of the library.azure-springAll azure-spring related issuescustomer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions