Skip to content

Commit

Permalink
use vertx based server instead of embedded (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
shoothzj committed Mar 6, 2024
1 parent 9fb4570 commit b1ac76c
Show file tree
Hide file tree
Showing 12 changed files with 383 additions and 311 deletions.
24 changes: 4 additions & 20 deletions ci/spotbugs/exclude.xml
Original file line number Diff line number Diff line change
@@ -1,31 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<FindBugsFilter
xmlns="https://github.com/spotbugs/filter/3.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubusercontent.com/spotbugs/spotbugs/3.1.0/spotbugs/etc/findbugsfilter.xsd">


<!-- pattern sort by alpha -->
<Match>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
</Match>

<Match>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
Expand Down
19 changes: 12 additions & 7 deletions embedded-pulsar-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,27 @@
<parent>
<artifactId>embedded-pulsar-parent</artifactId>
<groupId>io.github.embedded-middleware</groupId>
<version>0.0.5</version>
<version>0.0.6</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>embedded-pulsar-core</artifactId>

<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.pulsar</groupId>
<artifactId>pulsar-broker</artifactId>
<version>${pulsar.version}</version>
<groupId>io.vertx</groupId>
<artifactId>vertx-core</artifactId>
<version>${vertx.version}</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-web</artifactId>
<version>${vertx.version}</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,120 +7,21 @@
@Getter
public class EmbeddedPulsarConfig {

private int bkPort;
private int tcpPort = 6650;

private int zkPort;

private boolean allowAutoTopicCreation = false;

private int autoCreateTopicPartitionNum = 2;

private String autoTopicCreationType = "non-partitioned";

private boolean enableTls;

private String serverKeyStorePath;

private String serverKeyStorePassword;

private String serverTrustStorePath;

private String serverTrustStorePassword;

private String clientKeyStorePath;

private String clientKeyStorePassword;

private String clientTrustStorePath;

private String clientTrustStorePassword;
private int httpPort = 8080;

public EmbeddedPulsarConfig() {
}

public EmbeddedPulsarConfig bkPort(int bkPort) {
this.bkPort = bkPort;
return this;
}

public EmbeddedPulsarConfig zkPort(int zkPort) {
this.zkPort = zkPort;
return this;
}

public EmbeddedPulsarConfig allowAutoTopicCreation(boolean autoTopicCreation) {
this.allowAutoTopicCreation = autoTopicCreation;
return this;
}

public EmbeddedPulsarConfig autoCreateTopicPartitionNum(int autoCreateTopicPartitionNum) {
this.autoCreateTopicPartitionNum = autoCreateTopicPartitionNum;
return this;
}

public EmbeddedPulsarConfig autoTopicCreationType(AutoTopicCreationType autoTopicCreationType) {
this.autoTopicCreationType = autoTopicCreationType.getValue();
return this;
}

public EmbeddedPulsarConfig enableTls(boolean enableTls) {
this.enableTls = enableTls;
public EmbeddedPulsarConfig tcpPort(int tcpPort) {
this.tcpPort = tcpPort;
return this;
}

public EmbeddedPulsarConfig serverKeyStorePath(String serverKeyStorePath) {
this.serverKeyStorePath = serverKeyStorePath;
public EmbeddedPulsarConfig httpPort(int httpPort) {
this.httpPort = httpPort;
return this;
}

public EmbeddedPulsarConfig serverKeyStorePassword(String serverKeyStorePassword) {
this.serverKeyStorePassword = serverKeyStorePassword;
return this;
}

public EmbeddedPulsarConfig serverTrustStorePath(String serverTrustStorePath) {
this.serverTrustStorePath = serverTrustStorePath;
return this;
}

public EmbeddedPulsarConfig serverTrustStorePassword(String serverTrustStorePassword) {
this.serverTrustStorePassword = serverTrustStorePassword;
return this;
}

public EmbeddedPulsarConfig clientKeyStorePath(String clientKeyStorePath) {
this.clientKeyStorePath = clientKeyStorePath;
return this;
}

public EmbeddedPulsarConfig clientKeyStorePassword(String clientKeyStorePassword) {
this.clientKeyStorePassword = clientKeyStorePassword;
return this;
}

public EmbeddedPulsarConfig clientTrustStorePath(String clientTrustStorePath) {
this.clientTrustStorePath = clientTrustStorePath;
return this;
}

public EmbeddedPulsarConfig clientTrustStorePassword(String clientTrustStorePassword) {
this.clientTrustStorePassword = clientTrustStorePassword;
return this;
}

public enum AutoTopicCreationType {
partitioned("partitioned"),
non_partitioned("non-partitioned");

private final String value;

AutoTopicCreationType(String value) {
this.value = value;
}

public String getValue() {
return value;
}
}

}
Loading

0 comments on commit b1ac76c

Please sign in to comment.