-
Notifications
You must be signed in to change notification settings - Fork 41.3k
Closed
Description
RabbitMessagingTemplate has a dependency on RabbitTemplate, now if I were to define my custom RabbitTemplate, this autoconfiguration fails as then there are two RabbitTemplates available. Can you please suggest a good workaround, this is the exception:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'rabbitMessagingTemplate' defined in class path resource [org/springframework/boot/autoconfigure/amqp/RabbitAutoConfiguration$MessagingTemplateConfiguration.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.amqp.rabbit.core.RabbitTemplate]: : No qualifying bean of type [org.springframework.amqp.rabbit.core.RabbitTemplate] is defined: expected single matching bean but found 2: amqpTemplate,rubeExchangeTemplate; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [org.springframework.amqp.rabbit.core.RabbitTemplate] is defined: expected single matching bean but found 2: amqpTemplate,rubeExchangeTemplate
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:752)
Temporarily I have worked around this by defining my own RabbitMessageTemplate which prevents the autoconfigured one from being defined also.
hieugie
Metadata
Metadata
Assignees
Labels
No labels