azure-sdk-for-java: Getting MessageDispatchingException: Dispatcher has no subscribers, when using multibinders for eventhubs

Query/Question Getting below exception when processing events from a namespace and sending to different event hub in other namespace (ref Sample).

ErrorMessage [payload=org.springframework.messaging.MessageDeliveryException: Dispatcher has no subscribers for channel '**unknown.channel.name**'.; nested exception is org.springframework.integration.MessageDispatchingException: Dispatcher has no subscribers
    cloud:
     azure:
       msi-enabled: true
       client-id: abcd
       resource-group: eastus2-rg
       subscription-id: 
       

     stream:
       bindings:
         consume-in-0:
           binder: eventhub-1
           destination: datavalids
           group: $Default           
         valid-out-0:
           binder: eventhub-2
           destination: idvalid
         reject-out-0:
           binder: eventhub-2
           destination: idreject
       binders:
        eventhub-1:
          type: eventhub
          default-candidate: true
          environment:
            spring:
              cloud:
                azure:
                  eventhub:
                    namespace: abc-eastus2-eventhub-1
                    checkpoint-storage-account: premblobsa
                    checkpoint-container: testblob
        eventhub-2:
          type: eventhub
          default-candidate: true
          environment:
            spring:
              cloud:
                azure:
                  eventhub:
                    namespace: abc-eastus2-eventhub-2
                    checkpoint-storage-account: premblobsa
                    checkpoint-container: testblob
       default:
         producer:
           errorChannelEnabled: true  
         
         
       eventhub:
         bindings:
           consume-in-0:
             consumer:
               checkpoint-mode: MANUAL
               
       function:
         definition: consume;valid;reject;
       poller:
         initial-delay: 0
         fixed-delay: 1000

Why is this not a Bug or a feature Request? Not sure if its an issue, just want to check why this error is coming, is there something we are missing in config here?

Setup (please complete the following information if applicable):

  • OS: Linux/Windows10, AKS
  • IDE: Eclipse
  • Library/Libraries: [ com.azure.spring:azure-spring-cloud-stream-binder-eventhubs:2.8.0 ]

Information Checklist We are using streamBridge to sent to multiple output bindings after validating the event:

streamBridge.send("valid-out-0", message.getPayload());
// or
streamBridge.send("reject-out-0", message.getPayload());
  • Query Added
  • Setup information Added

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 21 (12 by maintainers)

Most upvoted comments

The original sample uses the following checkpointing logic:

checkpointer.success()
            .doOnSuccess(s -> LOGGER.info("Message '{}' successfully checkpointed", message))
            .doOnError(e -> LOGGER.error("Error found", e))
            .subscribe();

It seems like the issue gone when changed subscribe to block:

checkpointer.success()
            .doOnSuccess(s -> LOGGER.info("Message '{}' successfully checkpointed", message))
            .doOnError(e -> LOGGER.error("Error found", e))
            .block();

Hi @yiliuTo , Will create a sample project and share with you…

@jialigit @saragluna : As per the recommendation, With Spring Cloud Azure: 4.0.0 (springboot v2.5 and higher) , Consumers with eventhub multibinders working fine and no discrepancies or events drop observed. Thanks everyone for your support and guidance on this !!

Thanks @jialigit , will try and get back to you…!!

@rhyashu , for the NPE issue, I think It’s because of the config indentation problem.

spring:
    cloud:
        stream:
            eventhub:
                bindings:
                    consume-in-0:
                        consumer:
                            checkpoint-mode: MANUAL