on-internet
← Community

Applying conditional routing in Spring Integration flow

Stack Overflow ·

I'm trying to understand how to properly define routes for Spring's IntegrationFlows. I have a MQTT source, which is implemented as a MqttPahoMessageDrivenChannelAdapter. From there I receive messages from my smarthome devices(sensors, plugs, remote controls). And everything is going through one input channel, having a distinction by payload.header.mac field. My first idea was to use: @Bean public HeaderValueRouter router() { HeaderValueRouter router = new HeaderValueRouter("mqtt_receivedTopic"); router.setChannelMapping("macA", "controlsChannel"); router.setChannelMapping("someOtherHeaderValu

Comments

Sign in or sign up to comment and upvote.

No comments yet.