Spring Book – Chapter 20 – Spring Integration

UDP

Spring Integration supports both one-way and two-way communication using UDP-based protocol using channel adapters and message gateways respectively.

Listing 22-34 below shows maven dependency required for integrating UDP-protocol application using Spring Integration.

Listing 22-34. Maven dependency required

Listing 22-35 below shows configuration of main Spring Integration namespace and UDP (ip) related namespace in the Spring configuration file (file-integration-context.xml).

Listing 22-35. Spring Integration Namespace declaration

Listing 22-36 below shows configuration of a basic UDP adapter in the Spring configuration file (udp-integration-context.xml).

Listing 22-36. Basic inbound and outbound udp adpater configuration

TCP

Spring Integration also supports one-way and two-way communication using TCP-based protocol by configuring channel adapters and message gateways accordingly. Maven dependency and the Spring Integration namespace is same as detailed in the previous section, “UDP”.

Listing 22-37 below shows configuration of a basic TCP adapter in the Spring configuration file (tcp-integration-context.xml). Connection used by the TCP adapters can be configured using the two TCP connections factories, one for the client used for creating an outgoing connection and one for the server used to listen for an incoming connection.

Listing 22-37. Basic inbound and outbound tcp adpater configuration

Page Visitors: 13341

The following two tabs change content below.
Tomcy John

Tomcy John

Blogger & Author at javacodebook
He is an Enterprise Java Specialist holding a degree in Engineering (B-Tech) with over 10 years of experience in several industries. He's currently working as Principal Architect at Emirates Group IT since 2005. Prior to this he has worked with Oracle Corporation and Ernst & Young. His main specialization is on various web technologies and acts as chief mentor and Architect to facilitate incorporating Spring as Corporate Standard in the organization.
Tomcy John

Latest posts by Tomcy John (see all)

2 thoughts on “Spring Book – Chapter 20 – Spring Integration

  1. Hi,
    Thanks for this blog and information sharing!
    I have one question from Spring Integration. Just thought of checking with you.
    I have SimplewebserviceOutBoundGateway. I need to send a document / attachment to the webservice. How will i achieve that?
    This is my current gateway configuration:

    Please let me know, if you can throw some light in this area.
    Thanks in Advance!

  2. Hi,
    Thank you for your information sharing.
    I have one doubt,could you please suggest me the correct frameworks to address that issue.

    My requirement is I would like to get and process files using spring and camel.

    Thanks,
    Madhu

Leave a Reply

Your email address will not be published. Required fields are marked *