式の値がどのマッピングにも一致しない場合、Spring Integration を使用して、デフォルトの出力チャネルを使用するコンテンツ ベースのルーターを実装したいと考えています。これが私のBean定義です:
<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" />
ただし、デフォルトの出力チャネルは使用されていないようです。式が「baz」などと評価される場合、ルーターは「channel_default」チャネルにルーティングするのではなく、「baz」という名前のチャネルを探しているようです。
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
XML 名前空間を使用して、私が望んでいることはまったく可能ですか?それとも、独自の実装をコーディングする必要がありますか?