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

  • logging-channel-adapter and "Dispatcher has no subscribers for channel"

    I am new to spring intergration, I am trying to build a sample application which listen to JMS messages using message-driven-channel-adapter and sent them to logging channel to print it to log.
    My config looks like this :

    Code:
    <si:channel id="in">
    	<si:interceptors>
    	 <si:wire-tap channel="logger" />
    	</si:interceptors>
    </si:channel>
    
    <si:logging-channel-adapter id="logger"  expression="payload.toString()" level="DEBUG" />
    
    <jms:message-driven-channel-adapter   connection-factory="jmsFactory"  extract-payload="false"   destination="testTopic" channel="in" />
    When running this code I am getting below exception :
    Code:
    org.springframework.integration.MessageDeliveryException: Dispatcher has no subscribers for channel in.
    	at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:82)
    	at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:157)
    	at org.springframework.integration.core.MessagingTemplate.doSend(MessagingTemplate.java:288)
    	at org.springframework.integration.core.MessagingTemplate.send(MessagingTemplate.java:149)
    So can sombody please help in resolving this, also I want to print messages recieved (from jms adapter) to a log file, so what configuration are required for that ? as I am not able to find any configuration through which I can use logging channel adapter with log4j.

  • #2
    log 4J config and logging channel adapter

    I found the reason for the error. I was defining topic like this
    Code:
    <bean id="testTopic"  class="org.apache.activemq.command.ActiveMQTopic">
    		<property name="physicalName" value=">" />
    	</bean>
    <jms:message-driven-channel-adapter  connection-factory="jmsFactory"  extract-payload="true" message-converter="simpleConverter"  destination="testTopic" channel="in" />
    I was using > sign , which implies for lisiten to all the messages on all topics. When I changed it to a perticular toipc like
    Code:
    <bean id="testTopic"  class="org.apache.activemq.command.ActiveMQTopic">
    		<property name="physicalName" value="testing.a" />
    	</bean>
    It givens no error.
    So topic > was reason for the issue. Logging issues still remain open for me.
    I am defining my config like:
    Code:
    <si:channel id="in">
    	<si:interceptors>
    	 <si:wire-tap channel="logger" />
    	</si:interceptors>
    </si:channel>
    
    <si:logging-channel-adapter id="logger"  expression="payload.toString()" level="DEBUG" />
    
    <bean id="testTopic"  class="org.apache.activemq.command.ActiveMQTopic">
    		<property name="physicalName" value="testing.a" />
    	</bean>
    <jms:message-driven-channel-adapter   connection-factory="jmsFactory"  extract-payload="false"   destination="testTopic" channel="in" />
    And my log4j.property file is like :

    Code:
    log4j.rootLogger=INFO, CA,
    #Console Appender 
    log4j.appender.CA=org.apache.log4j.ConsoleAppender 
    log4j.appender.CA.layout=org.apache.log4j.PatternLayout 
    log4j.appender.CA.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
    #File Appender 
    log4j.appender.FA=org.apache.log4j.RollingFileAppender 
    log4j.appender.FA.File=./logs/JMSMessage.log
    log4j.appender.FA.layout=org.apache.log4j.PatternLayout 
    log4j.appender.FA.layout.ConversionPattern=%d - %m%n
    org.springframework.integration.handler.LoggingHandler=INFO,FA
    even Then I not able to see any log file generated.

    Comment

    Working...
    X