Hello I have a "common" project which contains all the implementations of various queues I use.
I use 2 queues in my flow due to legacy.
It has Kafka and rabbit.
My project defines 2 beans and sub-beans:
- KafkaProducer
- KafkaConsumer
- RabbitQueue
All containing some sub-beans to handle failures and stuff.
Now this is my questions: I have one microservice that does not use Kafka. I only want to define the Rabbit queue and its beans, but once I import this common jar dependency, It automatically initiates the Kafka beans.
How can this be done in spring without separating to different libraries.
For example:
@Componenet
public class KafkaProducer {
@Inject
private KafkaFailureHandler failureHandler;
}
Regards, Ido