0

I was created one poller which will execute every one second and call some method to perform action but sometimes i am getting "Channel application.bischannel has 0 subscriber(s)" exception.

Here i am attaching my code:

@Component
public class BISPoller {

@Autowired
private BisAPIService bisApiService;    
    
@InboundChannelAdapter(channel="bischannel",poller = @Poller(fixedDelay = "1000"))
public String billingTransactionEventPoller() {
    bisApiService.performBillingTransactionEvent();
    return "Bill Transaction Event Execution Completed";
}

@ServiceActivator(inputChannel = "bischannel")
public void handle(String in) {
 //Logger method
}

}

Let me know how to resolve issue.

  • Hard to say since everything looks good. The `@ServiceActivator` must start before `@InboundChannelAdapter`, create a channel and subscribe to it. I wonder if you are on the latest Spring Integration. Otherwise share a simple project we can reproduce. – Artem Bilan May 31 '23 at 15:44
  • @ArtemBilan this is one class and from here i am calling another class you can create any dummy class which is calling from this class and try to reproduce – Dharmin Patel Jun 01 '23 at 03:41
  • That's my point: I cannot reproduce. And what you claim cannot happen with the code you show so far. The logic in the framework to start the `@ServiceActivator` *before* an `@InboundChannelAdapter`. Therefore my ask for you to share the project where we can reproduce it: to be sure that we are on the same page. Otherwise we are going only to plain soccer: you can reproduce on your side and I cannot on my. – Artem Bilan Jun 01 '23 at 13:00

0 Answers0