Skip to content

Commit f3a4176

Browse files
committed
Port to Java In-Process SDK 8.0.0.
1 parent a419cb6 commit f3a4176

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>com.lightstreamer.examples</groupId>
66
<artifactId>rss-adapter-java</artifactId>
7-
<version>1.1.0</version>
7+
<version>1.2.0</version>
88
<packaging>jar</packaging>
99

1010
<name>Lightstreamer RSS Demo Java Adapter</name>
@@ -65,7 +65,7 @@
6565
<dependency>
6666
<groupId>com.lightstreamer</groupId>
6767
<artifactId>ls-adapter-inprocess</artifactId>
68-
<version>7.4.0</version>
68+
<version>8.0.0</version>
6969
</dependency>
7070
<dependency>
7171
<groupId>org.apache.logging.log4j</groupId>

src/main/java/com/lightstreamer/examples/rss_demo/adapters/RSSMetadataAdapter.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
import java.io.File;
2222
import java.util.Map;
23+
import java.util.concurrent.CompletableFuture;
24+
import java.util.concurrent.CompletionStage;
2325

2426
import org.apache.logging.log4j.LogManager;
2527
import org.apache.logging.log4j.Logger;
@@ -98,9 +100,11 @@ private String convertRSSUserName(String item, String session) throws ItemsExcep
98100
* Triggered by a client "sendMessage" call.
99101
* The message encodes a chat message from the client.
100102
*/
101-
public void notifyUserMessage(String user, String session, String message)
103+
public CompletionStage<String> notifyUserMessage(String user, String session, String message)
102104
throws NotificationException, CreditsException {
103105

106+
// we won't introduce blocking operations, hence we can proceed inline
107+
104108
if (message == null) {
105109
logger.warn("Null message received");
106110
throw new NotificationException("Null message received");
@@ -114,6 +118,8 @@ public void notifyUserMessage(String user, String session, String message)
114118

115119
this.loadRSSFeed();
116120
this.handleRSSMessage(pieces,message,session);
121+
122+
return CompletableFuture.completedStage(null);
117123
}
118124

119125
private void loadRSSFeed() throws CreditsException {

0 commit comments

Comments
 (0)