Results 1 to 10 of 15

Thread: ChannelNameResolver exception with M4 build

Hybrid View

  1. #1

    Question ChannelNameResolver exception with M4 build

    I am using a ChannelNameResolver to direct JMS responses to appropriate queues.

    Its defined as follows in spring config :

    Code:
    <beans:bean id="dynaRouter"
    
    class="org.springframework.integration.router.SingleChannelRouter">
    
    <beans:property name="channelNameResolver" ref="MyResponseRouteResolver" />
    
    <beans:property name="channelRegistry" ref="internal.MessageBus" />
    
    </beans:bean>
    With M3 jars this works fine and response is channeled and sent appropriately..

    With M4 jars (SI build dated 20080414 ) though I see the following exception , though if you notice I do have both 'channelNameResolver' and 'channelRegistry' defined above :

    org.springframework.integration.ConfigurationExcep tion: router configuration requires either a 'channelResolver' or both 'channelNameResolver' and 'channelRegistry' at org.springframework.integration.router.SingleChann elRouter.resolveChannel(SingleChannelRouter.java:7 7)
    at org.springframework.integration.router.SingleChann elRouter.resolveChannels(SingleChannelRouter.java: 65)
    at org.springframework.integration.router.AbstractRou tingMessageHandler.handle(AbstractRoutingMessageHa ndler.java:79)
    at org.springframework.integration.endpoint.DefaultMe ssageEndpoint.handle(DefaultMessageEndpoint.java:2 56)
    at org.springframework.integration.dispatcher.Default MessageDistributor.distribute(DefaultMessageDistri butor.java:93)
    at org.springframework.integration.dispatcher.Default MessageDispatcher.doDispatch(DefaultMessageDispatc her.java:183)
    at org.springframework.integration.dispatcher.Default MessageDispatcher.access$2(DefaultMessageDispatche r.java:176)
    at org.springframework.integration.dispatcher.Default MessageDispatcher$DispatcherTask.run(DefaultMessag eDispatcher.java:217)
    at org.springframework.integration.scheduling.SimpleM essagingTaskScheduler$MessagingTaskRunner.run(Simp leMessagingTaskScheduler.java:136)


    What has changed ?

  2. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    I've attempted to reproduce this based on your configuration excerpt, but the routing is working as expected, and I am not seeing any errors. Are there any other router instances that may be mis-configured? If not, can you provide more information about other components and how this is being invoked when you see that error?

    Thanks,
    Mark

  3. #3

    Default Further

    As the same config works fine with M3 jars , I dont think there is any problem with the remaining config .

    The logic is being invoked on message being sent to a channel configured as follows , the channelNameResolver then sends to appropriate jms-target channels ..

    Code:
    <channel id="dummyChannel" />
    	
    	<endpoint input-channel="dummyChannel" handler-ref="dynaRouter" />
    
    	<!-- Dynamic list of recipients -->
    	<beans:bean id="dynaRouter"		class="org.springframework.integration.router.SingleChannelRouter">
    		<beans:property name="channelNameResolver"
    			ref="MyResponseRouteResolver" />
    		<beans:property name="channelRegistry"
    			ref="internal.MessageBus" />
    	</beans:bean>
    Since it fails on the initial stages, it does not even reaches the custom router class.

  4. #4
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    Are you defining the MessageBus explicitly (with a <bean/> defintion) or using the namespace (<message-bus/>)?

  5. #5

    Default message bus definition

    <message-bus auto-create-channels="true" error-channel="errorChannel"/>

    The internal.MessageBus is the bean reference defined by SI by the above config I presume.

  6. #6
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    Are you sending Messages to "dummyChannel" programmatically - or is it a reply channel for another endpoint/source-adapter?

    I'm just trying to put all of the pieces together since I am having a hard time understanding how this could happen unless somehow the router is actually being invoked before its dependencies have even been injected.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •