Announcement Announcement Module
Collapse
No announcement yet.
two way communication (TCP, no_nio) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

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

    Comment


    • #3
      Hi Gary!
      Thanks for the answer.

      Will check it out.

      Comment


      • #4
        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

        Comment


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

          Comment


          • #6
            Looks awesome !!!
            Thanks!

            BR,
            Oleg

            Comment

            Working...
            X