Spring Integration-5 :Routers

In this installment of our Spring Integration tutorial, we examine routers. Routers distribute messages to one or more message channels. Some routers (content routers) examine the message payload or headers in order to select a particular destination message channel. Other routers (recipient list routers) simply distribute the message to all listed message channels.

routing
Copyright © 2014 by Intertech, Inc.

Example Content Router:

<int:payload-type-router input-channel="routingChannel">   <int:mapping type="java.lang.String" channel="stringChannel"/>     <int:mapping type="java.lang.Integer" channel="integerChannel" /></int:payload-type-router>

Recipient List Router:

<int:recipient-list-router id="customRouter" input-channel="routingChannel">   <int:recipient channel="channel1" selector-expression ="payload.equals('foo')"/> <int:recipient channel="channel2" selector-expression="headers.containsKey('bar')"/> </int:recipient-list-router>

Popular posts from this blog

Window function in PySpark with Joins example using 2 Dataframes (inner join)

Complex SQL: fetch the users who logged in consecutively 3 or more times (lead perfect example)

Credit Card Data Analysis using PySpark (how to use auto broadcast join after disabling it)