Results 1 to 4 of 4

Thread: Spring Integration and Java NIO

  1. #1
    Join Date
    Sep 2004
    Location
    London
    Posts
    311

    Default Spring Integration and Java NIO

    Hello all
    does spring integration offer any facilities for implementing an Asynchronous Server Socket?
    are there any Channels / Adapters that can be used for that?

    w/kindest regards
    Marco

  2. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,142

    Default

    There are NIO channel adapters. Read about them here...

    http://static.springsource.org/sprin...erence.html#ip

    There is currently no support for an inbound and outbound adapter to share the same socket (and thus asynchronously send a reply to an incoming message). Currently, the only two way communication over a socket is via the simple gateways, which use java.net.Socket.

    We have been thinking about having an outbound tcp adapter getting access to the same NIO channel as an inbound adapter. In this environment, the application would be responsible for message correlation (including, perhaps, adding correlation data to the message payloads) but it would allow two-way asynchronous communication over tcp.

    If this is something you need, please create a JIRA issue.

  3. #3
    Join Date
    Sep 2004
    Location
    London
    Posts
    311

    Default

    Gary
    thanks for the reply.
    Am i correct then in assuming that TcpNioReceivingChannelAdapter is meant only for
    unidirectional1 way communication?

    regards
    marco

  4. #4
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,142

    Default

    Yes, that is correct; *all* the channel adapters in SI are one-way (inbound or outbound). Gateways provide two-way comms.

    The hybrid I am talking about would be a pair of collaborative channel adapters (in and out). For SI to SI communication we could handle the correlation within the framework because we can include correlation data in the stream. When communicating with external systems, it's a little more complicated because we don't "own" the wire protocol in the stream and would have to delegate to the application to provide the correlation.

    Regardless of where the correlation is done, we would likely leverage the existing Correlation support in SI where possible.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •