Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mqtt-broker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>pulsar-protocol-handler-mqtt-parent</artifactId>
<groupId>io.streamnative.pulsar.handlers</groupId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-M1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pulsar-protocol-handler-mqtt</artifactId>
Expand Down Expand Up @@ -56,4 +56,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
2 changes: 1 addition & 1 deletion mqtt-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>pulsar-protocol-handler-mqtt-parent</artifactId>
<groupId>io.streamnative.pulsar.handlers</groupId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-M1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pulsar-protocol-handler-mqtt-common</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion mqtt-proxy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>pulsar-protocol-handler-mqtt-parent</artifactId>
<groupId>io.streamnative.pulsar.handlers</groupId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-M1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pulsar-protocol-handler-mqtt-proxy</artifactId>
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<groupId>io.streamnative.pulsar.handlers</groupId>
<artifactId>pulsar-protocol-handler-mqtt-parent</artifactId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-M1-SNAPSHOT</version>
<name>StreamNative :: Pulsar Protocol Handler :: MoP Parent</name>
<description>Parent for MQTT on Pulsar implemented using Pulsar Protocol Handler.</description>

Expand Down Expand Up @@ -50,8 +50,8 @@
<mockito.version>2.22.0</mockito.version>
<testng.version>6.14.3</testng.version>
<awaitility.version>4.0.2</awaitility.version>
<pulsar.version>4.3.0-SNAPSHOT</pulsar.version>
<sn.bom.version>4.3.0-SNAPSHOT</sn.bom.version>
<pulsar.version>5.0.0-M1-SNAPSHOT</pulsar.version>
<sn.bom.version>5.0.0-M1-SNAPSHOT</sn.bom.version>
<log4j2.version>2.18.0</log4j2.version>
<fusesource.client.version>1.16</fusesource.client.version>
<hivemq.mqtt.client.version>1.2.2</hivemq.mqtt.client.version>
Expand Down
4 changes: 2 additions & 2 deletions tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>pulsar-protocol-handler-mqtt-parent</artifactId>
<groupId>io.streamnative.pulsar.handlers</groupId>
<version>4.3.0-SNAPSHOT</version>
<version>5.0.0-M1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pulsar-protocol-handler-mqtt-tests</artifactId>
Expand Down Expand Up @@ -118,4 +118,4 @@
<url>https://repo.eclipse.org/content/repositories/paho-releases/</url>
</repository>
</repositories>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,9 @@ protected void restartBroker() throws Exception {
}

protected void stopBroker() throws Exception {
for (PulsarService pulsarService : pulsarServiceList) {
pulsarService.close();
for (int i = 0; i < pulsarServiceList.size(); i++) {
mockZooKeeper.setSessionId(i + 1);
pulsarServiceList.get(i).close();
}
pulsarServiceList.clear();
brokerPortList.clear();
Expand All @@ -295,6 +296,7 @@ protected void stopBroker() throws Exception {
}

public void stopBroker(int brokerIndex) throws Exception {
mockZooKeeper.setSessionId(brokerIndex + 1);
pulsarServiceList.get(brokerIndex).close();
pulsarServiceList.remove(brokerIndex);
brokerPortList.remove(brokerIndex);
Expand Down Expand Up @@ -398,6 +400,7 @@ protected void startBroker(MQTTCommonConfiguration conf) throws Exception {
mqttProxyPort, mqttProxyTlsPort, mqttProxyTlsPskPort, mqttHttpPort);
ConfigurationUtils.extractFieldToProperties(conf);
setTLSConf(conf);
mockZooKeeper.setSessionId(pulsarServiceList.size() + 1);
this.pulsarServiceList.add(doStartBroker(conf));
}

Expand All @@ -424,7 +427,7 @@ protected void setupBrokerMocks(PulsarService pulsar) throws Exception {

public static MockZooKeeper createMockZooKeeper() throws Exception {
MockZooKeeper zk = MockZooKeeper.newInstance();
zk.setSessionId(-1);
zk.setSessionId(1);
List<ACL> dummyAclList = new ArrayList<>(0);

ZkUtils.createFullPathOptimistic(zk, "/ledgers/available/192.168.1.1:" + 5000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
import org.apache.pulsar.common.policies.data.ClusterData;
import org.apache.pulsar.common.policies.data.RetentionPolicies;
import org.apache.pulsar.common.policies.data.TenantInfo;
import org.conscrypt.Conscrypt;
import org.fusesource.mqtt.client.MQTT;
import org.testng.SkipException;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
Expand Down Expand Up @@ -96,7 +98,6 @@ protected void setup() throws Exception {
super.setup();
log.info("success internal setup");
setupClusterNamespaces();
setPulsarServiceState();
}

protected void setupClusterNamespaces() throws Exception {
Expand Down Expand Up @@ -137,6 +138,12 @@ protected void setupClusterNamespaces() throws Exception {
}
}

protected void assumeConscryptAvailable() {
if (!Conscrypt.isAvailable()) {
throw new SkipException("Conscrypt native library is not available on this platform");
}
}

@AfterClass(alwaysRun = true)
@Override
protected void cleanup() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ public void testInvalidClientId() throws Exception {
@Test
@SneakyThrows
public void testTlsPskWithTlsv1() {
assumeConscryptAvailable();
Bootstrap client = new Bootstrap();
EventLoopGroup group = new NioEventLoopGroup();
client.group(group);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ public void testSendAndConsumeWithFilter(String topic, String filter) {
@Test(timeOut = TIMEOUT, priority = 4)
@SneakyThrows
public void testTlsPsk() {
assumeConscryptAvailable();
Bootstrap client = new Bootstrap();
EventLoopGroup group = new NioEventLoopGroup();
client.group(group);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ public void testSendAndConsumeWithFilter(String topic, String filter) {
@Test
@SneakyThrows
public void testTlsPskWithTlsv1() {
assumeConscryptAvailable();
Bootstrap client = new Bootstrap();
EventLoopGroup group = new NioEventLoopGroup();
client.group(group);
Expand Down Expand Up @@ -501,6 +502,7 @@ public void testRetainedMessageInCluster() throws Exception {
@Test
@SneakyThrows
public void testAddPskIdentity() {
assumeConscryptAvailable();
HttpClient httpClient = HttpClientBuilder.create().build();
final String mopEndPoint = "http://localhost:" + brokerWebservicePortList.get(0) + "/mop/add_psk_identity";
HttpPost request = new HttpPost();
Expand Down
Loading