Results 1 to 3 of 3

Thread: Content based router with default output channel?

  1. #1
    Join Date
    Sep 2004
    Posts
    127

    Default Content based router with default output channel?

    I'd like to implement a content based router that uses a default output channel if the expression value doesn't match any of the mappings. Here's my bean definition:

    Code:
    <int:router input-channel="channel_in" default-output-channel="channel_default" 
       expression="payload.name">
    	<int:mapping value="foo" channel="channel_one" />
    	<int:mapping value="bar" channel="channel_two" />
    </int:router>
    However, it seems the default output channel is never used. If the expression evaluates to e.g. 'baz', the router seems to be looking for a channel named 'baz', instead of routing to the 'channel_default' channel:

    Code:
    org.springframework.integration.MessagingException: failed to resolve channel name 'baz'
      Caused by: org.springframework.integration.support.channel.ChannelResolutionException: 
        failed to look up MessageChannel bean with name 'baz'
      Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: 
        No bean named 'baz' is defined
    Is what I want at all possible using the XML namespace, or do I need to code up my own implementation?

  2. #2
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    644

    Default

    Hello.

    How about attribute ?:
    PHP Code:
    <router ignore-channel-name-resolution-failures="true" 
    Good luck,
    Artem Bilan

  3. #3
    Join Date
    Sep 2004
    Posts
    127

    Default

    Thanks Artem, that did the trick.

    I was sure I had tried that before, but it seems I was mistaken.

Tags for this Thread

Posting Permissions

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