Skip to content

Commit

Permalink
feat: init reactor client (#12)
Browse files Browse the repository at this point in the history
Signed-off-by: ZhangJian He <[email protected]>
  • Loading branch information
shoothzj committed Aug 30, 2024
1 parent ec24f51 commit 32fe92d
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bookkeeper-admin-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.github.protocol-laboratory</groupId>
<artifactId>bookkeeper-admin-parent</artifactId>
<version>0.0.2</version>
<version>0.0.3</version>
</parent>

<artifactId>bookkeeper-admin-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bookkeeper-admin-jdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.github.protocol-laboratory</groupId>
<artifactId>bookkeeper-admin-parent</artifactId>
<version>0.0.2</version>
<version>0.0.3</version>
</parent>

<artifactId>bookkeeper-admin-jdk</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bookkeeper-admin-reactor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.github.protocol-laboratory</groupId>
<artifactId>bookkeeper-admin-parent</artifactId>
<version>0.0.2</version>
<version>0.0.3</version>
</parent>

<artifactId>bookkeeper-admin-reactor</artifactId>
Expand Down
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() {
}
}
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;
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.github.protocol-laboratory</groupId>
<artifactId>bookkeeper-admin-parent</artifactId>
<version>0.0.2</version>
<version>0.0.3</version>
<packaging>pom</packaging>

<modules>
Expand Down

0 comments on commit 32fe92d

Please sign in to comment.