Add tcp-with-headers sample\
* Fix http/https in license; skip hidden files in project scan.
This commit is contained in:
committed by
Artem Bilan
parent
cb052d2d98
commit
8eb85d29b3
32
basic/tcp-with-headers/README.adoc
Normal file
32
basic/tcp-with-headers/README.adoc
Normal file
@@ -0,0 +1,32 @@
|
||||
= 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 :dynamic-tcp-client: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
|
||||
```
|
||||
Reference in New Issue
Block a user