-
Notifications
You must be signed in to change notification settings - Fork 5
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 <shoothzj@gmail.com>
- Loading branch information
ZhangJian He
committed
Aug 30, 2024
1 parent
ec24f51
commit ac584f7
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