Announcement Announcement Module
Collapse
No announcement yet.
Example using tcp-outbound-channel-adapter Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


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

      Comment

      Working...
      X