i am trying to convert below XML snippet into Java version, appreciate any help here
<int:router input-channel="channel_in" default-output-channel="channel_default"
expression="payload.name" ignore-channel-name-resolution-failures="true">
<int:mapping value="foo" channel="channel_one" />
<int:mapping value="bar" channel="channel_two" />
</int:router>
Here is what i did for my concrete example
@Router(inputChannel = "routerChannel")
public String route(Account message) {
if (message.getType().equals("check")) {
return "checkChannel";
} else if (message.getType().equals("credit")) {
return "creditChannel";
}
return "errorChannel";
}
@Bean
public DirectChannel checkChannel() {
return new DirectChannel();
}
when i do above i am seeing below error
org.springframework.messaging.MessageDeliveryException: Dispatcher has no subscribers for channel 'application:8090.checkChannel'.;