Files
spring-integration-samples/basic/tcp-with-headers/README.adoc
C.A. Little b7afbb45dc Update README.adoc in tcp-with-headers
Corrected command line for running sample.
2020-04-21 09:47:15 -04:00

33 lines
1.3 KiB
Plaintext

= TCP With Headers
There is no standard way to convey message headers over raw TCP; they need to be encoded into the payload on the sending side and decoded on the receiving side.
This example demonstrates how to use standard framework components to encode the payload and certain headers using JSON.
It takes console input and, if the input starts with a lower case, uppercases it and vice versa.
Whether to upper case or lower case the input is conveyed in a header 'type'.
Run from your favorite IDE, or from the command line `./gradlew :tcp-with-headers:run`.
Here is an example run...
```
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.3.RELEASE)
Enter some text; if it starts with a lower case character,
it will be uppercased by the server; otherwise it will be lowercased;
enter 'quit' to end
this should be uppercased
10:54:39.259 [pool-1-thread-2] INFO exampleLogger - Received type header:upper
THIS SHOULD BE UPPERCASED
This should be lowercased
10:54:49.266 [pool-1-thread-2] INFO exampleLogger - Received type header:lower
this should be lowercased
quit
```