java - How to implement TCP connection handshaking with Spring Integration? -


i'm new spring integration , trying receive data devices on tcp. i've come following spring context:

<bean id="serializer" class="com.somepackage.customserializer"/>  <int-ip:tcp-connection-factory id="connectionfactory"                                type="server"                                port="${tcp.socket.connection.listener.port}"                                deserializer="serializer" /> 

the problem device's protocol upon initial connection sends handshaking sequence , expects magic answer before starts sending messages.

a message pattern different handshaking sequence, cannot implement serializer distinguish between these two. if implement handshaking process interceptor. tried implement statefull serializer turned out serializers singletons, shared between different connections.

could please advise how perform custom negotiation (handshaking) before default mechanisms (splitting data messages) come play ? should customize connection factory ?

thank !

i think need custom tcp interceptor. documentation:

16.4 tcp connection interceptors

connection factories can configured reference tcpconnectioninterceptorfactorychain. interceptors can used add behavior connections, such negotiation, security, , other setup. no interceptors provided framework but, example, see interceptedsharedconnectiontests in source repository.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -