Results 1 to 3 of 3

Thread: Example using tcp-outbound-channel-adapter

  1. #1

    Default Example using tcp-outbound-channel-adapter

    Hi,

    I need a simple example of how to use the tcp-outbound-channel-adapter to send a message to socket on another process.

    I am new to Spring Integrations. I saw in the tcp-client-server demo how to use a gateway to send a message. I need to send Asynchronous XML messages over sockets.

    Here is my applicationContext:

    <int-ip:tcp-connection-factory id="cfClient"
    type="client" host="10.100.211.80" port="10754" single-use="false"
    so-timeout="10000" />
    <int:channel id="input" />

    <int-ip:tcp-outbound-channel-adapter id="outboundClient"
    channel="input"
    connection-factory="cfClient"/>

    But now I need sample java code to use the adapter to send a message.

    Please help!

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

    Default

    See the tcp sample in the intermediate folder...

    https://github.com/SpringSource/spri...rver-multiplex

    It does request/reply with correlation over adapters; sounds like you don't need that, but it shows the use of adapters in both a client and server environment.

    See the TcpClientServerDemoTest test case.

    If you don't need replies; simply use a <gateway/> with a method that returns void...

    Code:
    public interface SendOnlyGateway {
    
    	public void sendOnly(String text);
    
    }
    Let us know if you need more help.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #3

    Default

    Thanks for the quick response. I will look at the example you suggested!

Posting Permissions

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