I'm trying to implement a basic Processor from spring-cloud-stream. I've done this before on other projects, so I thought I was familiar with it. But this time Spring is having a problem creating via @Autowire my Processor reference inside a @Service component.
I thought the important piece was the @EnableBinding(my.class) on the Application, but I have that.
The error is
No qualifying bean of type 'com.mycompany.config.BizSyncProcessor' available
I also tried adding an @Component to the BizSyncProcessor, but that made no difference.
Here are the pieces:
public interface BizSyncProcessor {
String BUSINESS_IDS_INPUT = "updatedBusinessIdsIn";
String BUSINESS_IDS_OUTPUT = "updatedBusinessIdsOut";
@Output(BizSyncProcessor.BUSINESS_IDS_OUTPUT)
MessageChannel writeUpdatedBusinessIds();
@Input(BizSyncProcessor.BUSINESS_IDS_INPUT)
MessageChannel readUpdatedBusinessIds();
}
@Service
public class BusinessService {
@Autowired
private BizSyncProcessor bizSyncProcessor;
// methods which reference bizSyncProcessor's input and outputs
}
@EnableBinding(BizSyncProcessor.class)
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}