Announcement Announcement Module
Collapse
No announcement yet.
MessageDeliveryException: Dispatcher has no subscribers for channel - Help. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • MessageDeliveryException: Dispatcher has no subscribers for channel - Help.

    Attachment

    I'm not sure what's missing here. But I see everything connected in the integration graph. But I still get this exception.

    I simply want to use control bus,

    File in(Staged)->Inbound Adapter (Start via Control bus)->Service Activator(optional)->Outbound adapter->File out
    & stop the adapter.

    Code:
    org.springframework.integration.MessageDeliveryException: Dispatcher has no subscribers for channel filesOut.

    Here's the integration flow I have...

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    	xmlns:int="http://www.springframework.org/schema/integration"
    	xmlns:int-ftp="http://www.springframework.org/schema/integration/ftp"
    	xmlns:int-file="http://www.springframework.org/schema/integration/file"
    	xmlns:context="http://www.springframework.org/schema/context"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans
        					http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    					    http://www.springframework.org/schema/integration
    					    http://www.springframework.org/schema/integration/spring-integration.xsd
    					    http://www.springframework.org/schema/context
    					    http://www.springframework.org/schema/context/spring-context-3.0.xsd
    					    http://www.springframework.org/schema/integration/ftp
    					    http://www.springframework.org/schema/integration/ftp/spring-integration-ftp.xsd
    					    http://www.springframework.org/schema/integration/file
    					    http://www.springframework.org/schema/integration/file/spring-integration-file.xsd">
    	
    	  <!-- Read the property values from application.properties -->
    	<context:property-placeholder location="classpath:/META-INF/application.properties" />
    	<context:component-scan base-package="com.xxx.xxx.xxx"/>
    	
    	<int:channel id="controlChannel"/>
    	
    	<int:control-bus input-channel="controlChannel"/>
    	
    	<int:channel id="filesIn"/>
    	
    	<int-file:inbound-channel-adapter id="fileAdapter" channel="filesIn" directory="file:${moveToDownstream.inputDir}" prevent-duplicates="false" filename-regex="[^.].*" auto-startup="false" >
    		<int:poller fixed-delay="1000" max-messages-per-poll="10" />
    	</int-file:inbound-channel-adapter>
    
    	<int:service-activator id="outboundServiceActivator" input-channel="filesIn"
    		output-channel="filesOut" ref="outboundFileHandler" method="handleMessage"/>
    
    	<bean id="outboundFileHandler" class="xxx.xxx.xxx.xxx.adapters.outbound.ftp.EligibilityRequestFileOutbound" />
    	
    	<int:channel id="filesOut"/>
    	
    	<int-file:outbound-channel-adapter id="outBoundAdapter" channel="filesOut" directory="file:${moveToDownstream.outputDir}" delete-source-files="true" auto-startup="false"/>
    	
    	<bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>
    	
    </beans>
    Hoping the team can help.. Thanks a ton.
    Attached Files
    Last edited by rajsagar; Apr 23rd, 2013, 02:33 PM. Reason: More information

  • #2
    The adapter won't be subscribed to the channel until you start it...

    auto-startup="false"

    You could get this problem if you start the inbound adapter first; always start() consumers before producers.

    Comment


    • #3
      That helped. I set the consumer on by auto-startup="true" and works. Thank you Sir.

      Comment


      • #4
        How to pass the file name to the adapter via spel from code.

        Can I pass the file name in the expression, so that it picks up that specific file and pushes it out the door.

        here's my code snippet that is start/stop the adapter.

        Code:
        logger.info("Starting the inbound adapter.......");
        			sent=controlChannel.send(new GenericMessage<String>("@inboundAdapter.start()"));
        			logger.info("Started the outbound adapter .....");		
        		
        			sent=controlChannel.send(new GenericMessage<String>("@inboundAdapter.stop()"));
        			logger.info("Stopped the outbound adapter .....");

        Comment


        • #5
          It's not designed to work that way - the inbound adapter polls the directory looking for new files with a particular fixed pattern.

          If you already know the file name, you can avoid using the inbound adapter altogether; you can simply use something like

          Code:
          filesIn.send(new GenericMessage<File>(new File(absolutePath)));
          Or, even better, isolate your code from the framework by using a <gateway/>

          Code:
          public interface FileGateway {
              void send(File file);
          }
          ...
          
          private FileGateway gateway; // @Autowire, or inject with setter
          
          ...
          
          gateway.send(new File(absolutePath));
          Last edited by Gary Russell; Apr 23rd, 2013, 05:09 PM.

          Comment


          • #6
            Ok. Let me try and get back to you. Thanks for the quick response

            Comment


            • #7
              Hi Gary,


              I have same above issue,Dispatcher has no subscriber . I have used the auto start ='true' to consumers(outbound gateways and outbound channel adapters) , and i put the auto start ='false' to inbound channel adapter. still i am having the same exception, What might be the reason, ? Can you help me in this issue please?

              Comment

              Working...
              X