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

[BUG] AzureMessagingListener annotation cannot be used with Event Hubs and Service Bus spring starter together #24995

Closed
3 tasks done
yiliuTo opened this issue Oct 22, 2021 · 1 comment
Labels
azure-spring All azure-spring related issues bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library.
Milestone

Comments

@yiliuTo
Copy link
Member

yiliuTo commented Oct 22, 2021

Describe the bug
AzureMessagingListener annotation cannot be used with Event Hubs and Service Bus spring starter together. Error

Exception or Stack Trace

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 0 of method azureListenerContainerFactory in com.azure.spring.cloud.autoconfigure.messaging.AzureMessagingListenerConfiguration required a single bean, but 2 were found:
	- eventHubOperation: defined by method 'eventHubOperation' in class path resource [com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubOperationAutoConfiguration.class]
	- topicOperation: defined by method 'topicOperation' in class path resource [com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusTopicOperationAutoConfiguration.class]


Action:

Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed

To Reproduce
Creata a projct and add libraries contains bean of EventHubOperation and ServiceBusTopicOperation together, e.g. starters or stream binders of azure eventhubs and service bus.

Code Snippet
In 4.0.0 branch:

@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(EnableAzureMessaging.class)
@AutoConfigureAfter(value = { AzureEventHubOperationAutoConfiguration.class,
    AzureServiceBusTopicOperationAutoConfiguration.class })
@ConditionalOnBean(SubscribeByGroupOperation.class)
public class AzureMessagingListenerConfiguration {

    @Bean
    @ConditionalOnMissingBean(name = AzureListenerAnnotationBeanPostProcessor.DEFAULT_AZURE_LISTENER_CONTAINER_FACTORY_BEAN_NAME)
    public ListenerContainerFactory<? extends MessageListenerContainer> azureListenerContainerFactory(
        SubscribeByGroupOperation subscribeByGroupOperation) {
        return new DefaultAzureListenerContainerFactory(subscribeByGroupOperation);
    }
}

Expected behavior
Another parameter could be added to the listener annotation to specify which Operation bean to use. For the autoconfiguration, it should accept a list of Operation.

Setup (please complete the following information):

  • Library/Libraries: spring-cloud-azure-starter-servicebus, spring-cloud-azure-starter-eventhubs, spring-cloud-azure-stream-binder-servicebus-queue/topic, spring-cloud-azure-stream-binder-eventhubs

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
@yiliuTo yiliuTo added bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. azure-spring All azure-spring related issues labels Oct 22, 2021
@yiliuTo yiliuTo added this to the Backlog milestone Oct 22, 2021
@yiliuTo yiliuTo self-assigned this Oct 22, 2021
@chenrujun chenrujun moved this to Todo in Spring Cloud Azure Nov 5, 2021
@yiliuTo yiliuTo assigned jialigit and unassigned yiliuTo Jan 6, 2022
@yiliuTo yiliuTo moved this to Todo in Spring Cloud Azure Feb 10, 2022
@jialigit jialigit moved this from Todo to In Progress in Spring Cloud Azure Feb 10, 2022
@yiliuTo yiliuTo moved this from In Progress to Blocked in Spring Cloud Azure Mar 4, 2022
@yiliuTo yiliuTo moved this from Blocked to Todo in Spring Cloud Azure Mar 4, 2022
@Netyyyy Netyyyy added feature-request This issue requires a new behavior in the product in order be resolved. and removed bug This issue requires a change to an existing behavior in the product in order to be resolved. labels Jul 4, 2022
@Netyyyy Netyyyy changed the title [BUG] AzureMessagingListener annotation cannot be used with Event Hubs and Service Bus spring starter together [FEATURE REQ] AzureMessagingListener annotation cannot be used with Event Hubs and Service Bus spring starter together Jul 4, 2022
@jialigit jialigit removed their assignment Jul 8, 2022
@stliu stliu added bug This issue requires a change to an existing behavior in the product in order to be resolved. and removed feature-request This issue requires a new behavior in the product in order be resolved. labels Dec 13, 2022
@stliu stliu changed the title [FEATURE REQ] AzureMessagingListener annotation cannot be used with Event Hubs and Service Bus spring starter together [BUG] AzureMessagingListener annotation cannot be used with Event Hubs and Service Bus spring starter together Dec 13, 2022
azure-sdk pushed a commit to azure-sdk/azure-sdk-for-java that referenced this issue Oct 27, 2023
Release sql microsoft.sql 2023 05 01 preview (Azure#26289)

* Adds base for updating Microsoft.Sql from version preview/2023-02-01-preview to version 2023-05-01-preview

* Updates readme

* Updates API version in new specs and examples

* Adding JobPrivateEndpoints API to version 2023-05-01-preview  (Azure#24902)

* Adds base for updating Microsoft.Sql from version preview/2022-11-01-preview to version 2023-02-01-preview

* Updates readme

* Updates API version in new specs and examples

* add mi refresh API (Azure#24093)

* add mi refresh API

* remove stray character

* add examples

* fix lro error

* fix lro error only in example

* fixing prettier issue

* Test commit - adding error schema

* Test2

* Test - changing error type

* Revert "Test - changing error type"

This reverts commit 84fff94ea9cefca5312d2f5c12e099f315e0c064.

* Reverting 3 test commits

* Test - adding commong error type reference

* fix type format errors

---------

Co-authored-by: Stefan Krivokapic <[email protected]>

* Adding changes from main to release branch. PRs 24175 and 24185 (Azure#24221)

* Enable multiple partner servers and failover of read-only endpoint for SQL DB Failover Group in version 2023-02-01-preview. (Azure#24132)

* Added the swagger spec and example json files for failvoer group API update in V2023-020-1

* Corrected the FailoverGroupGet.json example

* Updated the auto-generated FailoverGroups.json

Fixed FailoverGroups.json swagger arm-id attribute for databases field

* Added the missing headers field manually

* Fix FailoverGroups.json

---------

Co-authored-by: Sharan Singh <[email protected]>

* Changes to Location Capabilities (Azure#24209)

* Loc cap changes

* removing changes not related to my changes in dsmain

* DAG API 2023-02-01 (Azure#24108)

* add new dag api version

* Update swagger

* Update swagger

* patch resource

* make replicationMode writable

* Add FreeLimitExhaustion Capability in 2023-02-01-preview API (Azure#24224)

* Add FreeLimitExhaustion Capability in 2023-02-01-preview API

* Change property from name to exhaustionBehaviorType

* generate swagger for LocationCapabilites (Azure#24290)

* inital commit for LTR Policy Immutability (Azure#24347)

* inital commit for immutable ltr backups (Azure#24349)

* Update Servers swagger files with adding property "IsIPv6Enabled" (Azure#24305)

* Update swagger files for Server API

* Add v5 tag for Servers

* Restore none for minimal TLS version

* Add auto rotation param to databases api (Azure#24339)

* Add auto rotation param to databases api

* add armid

* Adding IsFreemium and CreateTime to Get MI API (Azure#24239)

* job private endpoint swagger

* rerun pipelines

* adding job private endpoints to readme

* rerun pipelines

* trying to fix lint errors

* fixing typos - singular resource name and description.

* adding arm-id

* Moving files to the new version; no changes to the files themselves.

* adding job agent private endpoints to readme

---------

Co-authored-by: Jeremy Frosti <[email protected]>
Co-authored-by: guptanitish-ms <[email protected]>
Co-authored-by: Stefan Krivokapic <[email protected]>
Co-authored-by: lobashh <[email protected]>
Co-authored-by: Sharan Singh <[email protected]>
Co-authored-by: Aleksand4rZivanovic <[email protected]>
Co-authored-by: a-lazarlazic <[email protected]>
Co-authored-by: mykolian <[email protected]>
Co-authored-by: Srna Nikolic <[email protected]>
Co-authored-by: rebeccaxu-ms <[email protected]>
Co-authored-by: LeiWang3 <[email protected]>
Co-authored-by: viparek <[email protected]>
Co-authored-by: Nikola Mirkovic <[email protected]>

* DAG API 2023-05-01 for MI First (Azure#25638)

* mi first dag api 2023-05-01

* adding x-ms-identifiers

* adding job step and target group apis to version 2023-05-01-preview (Azure#25689)

* adding job step and target group apis to versoin 2023-05-01-preview

* remove required credential

---------

Co-authored-by: Ray Boyd <[email protected]>

* updating location capabilities for 2023-05-01-preview (Azure#25539)

Co-authored-by: Ray Boyd <[email protected]>

* Updating Instance Pool swagger for 2023-05-01-preview (Azure#25580)

* Updating Instance Pool swagger for 2023-05-01-preview

* Add format specification

* Update examples

---------

Co-authored-by: Kosta Bizetic <[email protected]>
Co-authored-by: Ivan Arandjelovic <[email protected]>

* Add Archive option to LTR Policy and LTR Backup for SQL DB  (Azure#25799)

* added changes

* fix swagger validation failures

* adding fixes

* added more changes

* added fixes

* fixed LintDiff

* added changes

* fix lintDiff

* Swagger validations for serverless parameters added in SQL API (Azure#25852)

* Swagger validations for serverless parameters added in SQL API

* Fixing spellcheck in example file

* Fix LintDiff error

---------

Co-authored-by: Yash Udasi <[email protected]>

* Add AAD support to job agents version 2023-05-01-preview (Azure#25553)

* adding job agent identity support to 2023-05-01-preview

* updated swagger with just aad changes

---------

Co-authored-by: Ray Boyd <[email protected]>

* Dev/sonjac/ltr api update (Azure#25701)

* Adding generated files.

* Fixing swagger errors.

* Managed Instance swagger to support Authentication Metadata (Azure#25795)

* generated swagger

* fixed prettier:

* fixed minor stuff

* swagger fixes

* added missing example file

* removed unused file

* externalgovernance fixes

* minor fixes

* missing character

* Adding JobAgents API with SKU support to version 2023-05-01-preview (Azure#24995)

* Adds base for updating Microsoft.Sql from version preview/2022-11-01-preview to version 2023-02-01-preview

* Updates readme

* Updates API version in new specs and examples

* add mi refresh API (Azure#24093)

* add mi refresh API

* remove stray character

* add examples

* fix lro error

* fix lro error only in example

* fixing prettier issue

* Test commit - adding error schema

* Test2

* Test - changing error type

* Revert "Test - changing error type"

This reverts commit 84fff94ea9cefca5312d2f5c12e099f315e0c064.

* Reverting 3 test commits

* Test - adding commong error type reference

* fix type format errors

---------

Co-authored-by: Stefan Krivokapic <[email protected]>

* Adding changes from main to release branch. PRs 24175 and 24185 (Azure#24221)

* Enable multiple partner servers and failover of read-only endpoint for SQL DB Failover Group in version 2023-02-01-preview. (Azure#24132)

* Added the swagger spec and example json files for failvoer group API update in V2023-020-1

* Corrected the FailoverGroupGet.json example

* Updated the auto-generated FailoverGroups.json

Fixed FailoverGroups.json swagger arm-id attribute for databases field

* Added the missing headers field manually

* Fix FailoverGroups.json

---------

Co-authored-by: Sharan Singh <[email protected]>

* Changes to Location Capabilities (Azure#24209)

* Loc cap changes

* removing changes not related to my changes in dsmain

* DAG API 2023-02-01 (Azure#24108)

* add new dag api version

* Update swagger

* Update swagger

* patch resource

* make replicationMode writable

* Add FreeLimitExhaustion Capability in 2023-02-01-preview API (Azure#24224)

* Add FreeLimitExhaustion Capability in 2023-02-01-preview API

* Change property from name to exhaustionBehaviorType

* generate swagger for LocationCapabilites (Azure#24290)

* inital commit for LTR Policy Immutability (Azure#24347)

* inital commit for immutable ltr backups (Azure#24349)

* Update Servers swagger files with adding property "IsIPv6Enabled" (Azure#24305)

* Update swagger files for Server API

* Add v5 tag for Servers

* Restore none for minimal TLS version

* Add auto rotation param to databases api (Azure#24339)

* Add auto rotation param to databases api

* add armid

* Adding IsFreemium and CreateTime to Get MI API (Azure#24239)

* Updated the examples for LTR Policies and LTR Backups (Azure#24821)

* Updated the examples for LTR Policies and LTR Backups

* Not sure why makeBackupsImmutable got deleted

* swagger changes

* api version changed

* adding identity files to the version on review

* change of getjobagent

* change test

* nit fix

* Changes to use SKU name to specify SLO

* Changes for job agent update SLO with 2023-05-01 version

* removing files of 2023-02-01

* fix

* removing changes on JobAgents 2023-02-01

---------

Co-authored-by: Jeremy Frosti <[email protected]>
Co-authored-by: guptanitish-ms <[email protected]>
Co-authored-by: Stefan Krivokapic <[email protected]>
Co-authored-by: lobashh <[email protected]>
Co-authored-by: Sharan Singh <[email protected]>
Co-authored-by: Aleksand4rZivanovic <[email protected]>
Co-authored-by: a-lazarlazic <[email protected]>
Co-authored-by: mykolian <[email protected]>
Co-authored-by: Srna Nikolic <[email protected]>
Co-authored-by: rebeccaxu-ms <[email protected]>
Co-authored-by: LeiWang3 <[email protected]>
Co-authored-by: viparek <[email protected]>
Co-authored-by: Nikola Mirkovic <[email protected]>

* added swagger spec and example json files for failovergroup api (Azure#25837)

* Updating Managed Instance swagger for 2023-05-01-preview (Azure#26098)

* Modifying ManagedInstances.json and corresponding examples

* Remove example

* Fix syntax errors

* Swagger API changes to support PUT and PATCH to update replication link type (Azure#25690)

* Add Swagger files for Replication Link Update Link Type

* resolve validation error

* Modify property description

* resolve lint errors

* Reverting MI change for readme to fix merge conflict with main (Azure#26296)

---------

Co-authored-by: jacobopac <[email protected]>
Co-authored-by: guptanitish-ms <[email protected]>
Co-authored-by: Stefan Krivokapic <[email protected]>
Co-authored-by: lobashh <[email protected]>
Co-authored-by: Sharan Singh <[email protected]>
Co-authored-by: Aleksand4rZivanovic <[email protected]>
Co-authored-by: a-lazarlazic <[email protected]>
Co-authored-by: mykolian <[email protected]>
Co-authored-by: Srna Nikolic <[email protected]>
Co-authored-by: rebeccaxu-ms <[email protected]>
Co-authored-by: LeiWang3 <[email protected]>
Co-authored-by: viparek <[email protected]>
Co-authored-by: Nikola Mirkovic <[email protected]>
Co-authored-by: ms-mjovkovic <[email protected]>
Co-authored-by: Ray Boyd <[email protected]>
Co-authored-by: Ray Boyd <[email protected]>
Co-authored-by: Kosta Bizetić <[email protected]>
Co-authored-by: Kosta Bizetic <[email protected]>
Co-authored-by: Ivan Arandjelovic <[email protected]>
Co-authored-by: CelinaJiangJXY <[email protected]>
Co-authored-by: Yash Udasi <[email protected]>
Co-authored-by: Yash Udasi <[email protected]>
Co-authored-by: Sonja Ciric <[email protected]>
Co-authored-by: Nebojsa Savic <[email protected]>
Co-authored-by: alejandro182 <[email protected]>
Co-authored-by: saljain0101 <[email protected]>
Co-authored-by: Marko Milovanovic <[email protected]>
Co-authored-by: Archana Sahoo <[email protected]>
Copy link

Hi @yiliuTo, we deeply appreciate your input into this project. Regrettably, this issue has remained inactive for over 2 years, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 15, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Spring Cloud Azure Mar 15, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
azure-spring All azure-spring related issues bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library.
Projects
Archived in project
Development

No branches or pull requests

4 participants