Book Image

Spring Integration Essentials

By : CHANDAN K PANDEY
Book Image

Spring Integration Essentials

By: CHANDAN K PANDEY

Overview of this book

Table of Contents (18 chapters)
Spring Integration Essentials
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Router


After transforming the messages to appropriate formats, the transformers put the message on to the channel transformedChannel. We have three type of messages that will be processed by different endpoints. We can use the payload router that will route it to different components based on the payload type:

    <int:payload-type-router input-channel="transformedChannel" 
      default-output-channel="logChannel">
    <int:mapping type="com.cpandey.siexample.pojo.SoFeed"
      channel="jdbcChannel" />
    <int:mapping type="java.lang.String" 
      channel="jmsChannel" />
    <int:mapping type="org.springframework.mail.MailMessage" 
      channel="mailChannel" />
    </int:payload-type-router>