-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: ZhangJian He <[email protected]>
- Loading branch information
Showing
6 changed files
with
38 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...dmin-reactor/src/main/java/io/github/protocol/bookkeeper/admin/reactor/Configuration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.github.protocol.bookkeeper.admin.reactor; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Setter | ||
@Getter | ||
public class Configuration { | ||
private String host = "localhost"; | ||
|
||
private int port; | ||
|
||
public boolean tlsEnable; | ||
|
||
public Configuration() { | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...reactor/src/main/java/io/github/protocol/bookkeeper/admin/reactor/InnerReactorClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,21 @@ | ||
package io.github.protocol.bookkeeper.admin.reactor; | ||
|
||
import reactor.netty.http.client.HttpClient; | ||
|
||
public class InnerReactorClient { | ||
private final HttpClient httpClient; | ||
|
||
private final String httpPrefix; | ||
|
||
public InnerReactorClient(Configuration conf) { | ||
HttpClient client = HttpClient.create(); | ||
|
||
if (conf.isTlsEnable()) { | ||
this.httpPrefix = "https://" + conf.getHost() + ":" + conf.getPort(); | ||
} else { | ||
this.httpPrefix = "http://" + conf.getHost() + ":" + conf.getPort(); | ||
} | ||
|
||
this.httpClient = client; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters