Skip to content

Commit

Permalink
Remove OpenSergoClientSubscribeInfo.java
Browse files Browse the repository at this point in the history
Signed-off-by: Jiangnan Jia <[email protected]>
  • Loading branch information
jnan806 committed Dec 3, 2022
1 parent 10efa14 commit a960158
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 76 deletions.
21 changes: 7 additions & 14 deletions src/main/java/io/opensergo/OpenSergoClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,6 @@ public OpenSergoClient(String host, int port) {
status = OpenSergoClientStatus.INITIAL;
}

public void registerSubscribeInfo(OpenSergoClientSubscribeInfo subscribeInfo) {
// Register subscriber to local.
if (Optional.of(subscribeInfo.getSubscriberList()).isPresent() && subscribeInfo.getSubscriberList().size() > 0) {
subscribeInfo.getSubscriberList().forEach(subscriber -> {
this.subscribeRegistry.registerSubscriber(subscribeInfo.getSubscribeKey(), subscriber);
OpenSergoLogger.info("OpenSergo subscribeinfo registered, subscribeKey={}, subscriber={}", subscribeInfo.getSubscribeKey(), subscriber);

if (requestAndResponseWriter != null && this.status == OpenSergoClientStatus.STARTED) {
this.subscribeConfig(subscribeInfo.getSubscribeKey());
}
});
}
}

public void start() throws Exception {
OpenSergoLogger.info("OpensergoClient is starting...");

Expand Down Expand Up @@ -188,6 +174,13 @@ public boolean subscribeConfig(SubscribeKey subscribeKey, OpenSergoConfigSubscri
// Send SubscribeRequest
requestAndResponseWriter.onNext(request);

// Register subscriber to local.
if (subscriber != null) {
subscribeRegistry.registerSubscriber(subscribeKey, subscriber);
OpenSergoLogger.info("OpenSergo config subscriber registered, subscribeKey={}, subscriber={}",
subscribeKey, subscriber);
}

return true;
}

Expand Down
62 changes: 0 additions & 62 deletions src/main/java/io/opensergo/OpenSergoClientSubscribeInfo.java

This file was deleted.

0 comments on commit a960158

Please sign in to comment.