Results 1 to 6 of 6

Thread: two way communication (TCP, no_nio)

  1. #1

    Default two way communication (TCP, no_nio)

    Hello experts,
    I'm newbie using SI-IP, so here a scenario when I need you advice.

    i. Server waits for the connection;
    ii. Client connects to the server;
    iii. Client sends specific message (request);
    iv. Server checks the message, and if a message is the right one, sends in return, a file contaxt as a stream;
    v. Client gets the file context & sends to the server 'OKEY' msg.

    It's first issue I'm looking forward :-).

    Another one, is about reconnecting or watch-dogging, i.e. a client side. How can I set up some property (may be) or write some code to be able to control/cope a reconnection.

    Thank you in advance,

    Oleg

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

    Default

    See the tcp-client-server sample https://github.com/SpringSource/spri...-client-server

    On the client side it uses a tcp-outbound-gateway (which is a request/reply endpoint).

    Depending on the format of the message, you may need to supply a custom (de)serializer; a few standard serializers are provided. (De)Serializers are explained here... http://static.springsource.org/sprin...tion-factories

    For connection reconnecting after a failure, you can add a Retry Advice to the gateway (http://static.springsource.org/sprin...r-advice-chain) and the connection will be re-established after a send fails.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #3

    Default

    Hi Gary!
    Thanks for the answer.

    Will check it out.

  4. #4

    Default

    Gary,
    What is a best approach for:
    1. I have to be aware of client connection/disconnection(s); the same on server side;
    2. If something wrong happens is there some way to reconnect?
    3. How to get SI IP events? Is it possible?

    Thanks in advance,
    Oleg

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

    Default

    There is a new 3.0 feature where Application Events are emitted for connections...

    http://static.springsource.org/sprin...whats-new.html

    3.0 is not released yet (and won't be for quite some time), but the feature is available in the 3.0.0.M1 milestone release...

    http://www.springsource.org/node/3813

    There is no explicit way to reconnect; the connection will be re-established on the next send.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  6. #6

    Default

    Looks awesome !!!
    Thanks!

    BR,
    Oleg

Tags for this Thread

Posting Permissions

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