-
Notifications
You must be signed in to change notification settings - Fork 41.5k
Closed as not planned
Labels
status: invalidAn issue that we don't feel is validAn issue that we don't feel is valid
Description
Hello team,
We've tried upgrading to version 3.2.0 of Spring Boot and we came across what we think might be a bug.
With this new version, Autowiring by name doesn't seen to be working, and it's forcing us to include a @qualifier(name) tag whenever we have multiple beans of the same type. Is this behaviour intended and we missed it from the docs?
Example:
We have multiple Queue and TopicExchange defined with different names, like
@Bean
Queue activityQueue(@Value("${amqp.activity.queue}") String queueName) {
return new Queue(queueName);
}
And we used to inject it with:
@Bean
Binding rabbitActivityBinding(Queue activityQueue, TopicExchange activityExchange) {
return BindingBuilder.bind(activityQueue)
.to(activityExchange).with(ACTIVITY_POSTED_ROUTING_KEY);
}
This used to find the right beans and inject them properly, but now it's complaining that it finds 9 instances and forces us to add a @Qualifier. This looks like a major change to Spring behaviour
A similar example happened with @PathVariable:
@GetMapping(path = "/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseStatus(HttpStatus.OK)
public GetPaymentResponse getPayment(@PathVariable String id)
Is now forcing us to include @PathVariable("id")
elysrivero99 and drothmaler
Metadata
Metadata
Assignees
Labels
status: invalidAn issue that we don't feel is validAn issue that we don't feel is valid