Tag

Bean Injection

1 views collected around this technical thread.

Sanyou's Java Diary
Sanyou's Java Diary
Jan 30, 2023 · Backend Development

Mastering Spring Bean Injection: 5 Ways to Register Beans in the Container

This article comprehensively reviews the various techniques for injecting beans into the Spring container—including XML and properties configuration files, annotation-based declarations, manual BeanDefinition registration, direct singleton registration, and FactoryBean usage—providing code examples, underlying principles, and practical guidance for each method.

Backend DevelopmentBean InjectionJava
0 likes · 18 min read
Mastering Spring Bean Injection: 5 Ways to Register Beans in the Container
Java Architecture Diary
Java Architecture Diary
Jun 23, 2020 · Backend Development

Fixing @RefreshScope Conflict with @ConditionalOnSingleCandidate in Spring Boot

In Spring Cloud projects, adding @RefreshScope to a custom RabbitMQ ConnectionFactory can clash with @ConditionalOnSingleCandidate, preventing RabbitTemplate from being auto‑wired; this article explains the root cause, demonstrates how to diagnose the issue, and provides a solution to avoid such bean conflicts.

Bean InjectionConditionalOnSingleCandidateRabbitMQ
0 likes · 5 min read
Fixing @RefreshScope Conflict with @ConditionalOnSingleCandidate in Spring Boot