Skip to content

Commit c8d11b4

Browse files
authored
Merge pull request eugenp#3450 from felipeazv/master
BAEL-1475: moving module
2 parents 1d29f9b + a25ea63 commit c8d11b4

9 files changed

Lines changed: 44 additions & 134 deletions

File tree

‎spring-5-reactive/pom.xml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,13 @@
6060
<!-- <version>1.1.2</version> -->
6161
<!-- </dependency> -->
6262
<!-- Dependencies for Johnzon -->
63-
63+
<!-- lombok-->
64+
<dependency>
65+
<groupId>org.projectlombok</groupId>
66+
<artifactId>lombok</artifactId>
67+
<scope>compile</scope>
68+
</dependency>
69+
6470
<dependency>
6571
<groupId>org.apache.geronimo.specs</groupId>
6672
<artifactId>geronimo-json_1.1_spec</artifactId>

spring-reactive-websocket/src/main/java/com/baeldung/Event.java renamed to spring-5-reactive/src/main/java/com/baeldung/reactive/websocket/Event.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.baeldung;
1+
package com.baeldung.reactive.websocket;
22

33
import lombok.AllArgsConstructor;
44
import lombok.Data;
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.baeldung.reactive.websocket;
2+
3+
import java.net.URI;
4+
import java.time.Duration;
5+
import org.springframework.boot.autoconfigure.SpringBootApplication;
6+
import org.springframework.web.reactive.socket.WebSocketMessage;
7+
import org.springframework.web.reactive.socket.client.ReactorNettyWebSocketClient;
8+
import org.springframework.web.reactive.socket.client.WebSocketClient;
9+
10+
import reactor.core.publisher.Mono;
11+
12+
@SpringBootApplication
13+
public class ReactiveJavaClientWebSocket {
14+
public static void main(String[] args) throws InterruptedException {
15+
WebSocketClient client = new ReactorNettyWebSocketClient();
16+
client.execute(URI.create("ws://localhost:8080/event-emitter"), session -> session.send(Mono.just(session.textMessage("event-me-from-spring-reactive-client")))
17+
.thenMany(session.receive()
18+
.map(WebSocketMessage::getPayloadAsText)
19+
.log())
20+
.then())
21+
.block(Duration.ofSeconds(10L));
22+
}
23+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.baeldung.reactive.websocket;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
6+
@SpringBootApplication
7+
public class ReactiveWebSocketApplication {
8+
public static void main(String[] args) {
9+
SpringApplication.run(ReactiveWebSocketApplication.class, args);
10+
}
11+
}

spring-reactive-websocket/src/main/java/com/baeldung/ReactiveWebSocketConfiguration.java renamed to spring-5-reactive/src/main/java/com/baeldung/reactive/websocket/ReactiveWebSocketConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.baeldung;
1+
package com.baeldung.reactive.websocket;
22

33
import org.springframework.beans.factory.annotation.Autowired;
44
import org.springframework.context.annotation.Bean;

spring-reactive-websocket/src/main/java/com/baeldung/ReactiveWebSocketHandler.java renamed to spring-5-reactive/src/main/java/com/baeldung/reactive/websocket/ReactiveWebSocketHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.baeldung;
1+
package com.baeldung.reactive.websocket;
22

33
import org.springframework.web.reactive.socket.WebSocketSession;
44

spring-reactive-websocket/src/main/resources/static/client-websocket.html renamed to spring-5-reactive/src/main/resources/static/client-websocket.html

File renamed without changes.

‎spring-reactive-websocket/pom.xml‎

Lines changed: 0 additions & 92 deletions
This file was deleted.

‎spring-reactive-websocket/src/main/java/com/baeldung/ReactiveWebSocketApplication.java‎

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)