File tree 3 files changed +23
-0
lines changed
src/main/kotlin/net/alfss/demowsclient
3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Demo Websocket Server (proof of concept)
2
+
3
+
1
4
Event (
2
5
type: SUBSCRIBE, UNSUBSCRIBE, MESSAGE
3
6
payload: Text
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ dependencies {
21
21
implementation(" org.jetbrains.kotlin:kotlin-reflect" )
22
22
implementation(" org.jetbrains.kotlin:kotlin-stdlib-jdk8" )
23
23
implementation(project(" :demo_ws_common" ))
24
+ implementation(project(" :demo_ws_push_executor" ))
24
25
}
25
26
26
27
tasks.withType<KotlinCompile > {
Original file line number Diff line number Diff line change 1
1
package net.alfss.demowsclient
2
2
3
+ import net.alfss.demowspushexecutor.entrypoins.http.entities.HttpPushMessageEntity
4
+ import org.springframework.http.MediaType
5
+ import org.springframework.web.reactive.function.client.WebClient
6
+ import java.sql.Timestamp
7
+
8
+ fun main (args : Array <String >) {
9
+ val client = WebClient .builder().baseUrl(" http://localhost:8001" ).build()
10
+
11
+ val message = HttpPushMessageEntity (" tours/9d1cfe43-b917-4a22-8406-2494bedf3f72" , Timestamp (System .currentTimeMillis()).toString())
12
+
13
+ val result = client.post()
14
+ .uri(" /notification/message" )
15
+ .contentType(MediaType .APPLICATION_JSON )
16
+ .syncBody(message)
17
+ .retrieve()
18
+ .bodyToMono(Void ::class .java).log().then()
19
+
20
+ result.block()
21
+ }
You can’t perform that action at this time.
0 commit comments