Skip to content

Commit 0c26433

Browse files
Ranjan-DasguptaRanjan-Dasgupta
authored andcommitted
Merge with develop, resolve conflits and version changed to 1.2.5
Signed-off-by: Ranjan-Dasgupta <Ranjan.Dasgupta@us.ibm.com>
2 parents a2e0d16 + 3e3b6c4 commit 0c26433

82 files changed

Lines changed: 1620 additions & 3475 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,10 @@ target/
6262

6363

6464
*.log.*
65+
66+
# Test files
67+
Bug443142Test-*-tcplocalhost*
68+
client-1-tcpioteclipseorg1882
69+
testConnectTimeout
70+
71+

.travis.yml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,18 @@
1-
sudo: true
1+
sudo: required
22
language: java
33
install: true
4-
matrix:
4+
5+
jobs:
56
include:
67
- os: linux
78
dist: trusty
8-
sudo: required
99
jdk: oraclejdk8
10-
# - os: osx
11-
# jdk: oraclejdk8
12-
13-
14-
15-
16-
sudo: required
1710

1811
before_install:
1912
- ./start-broker.sh
2013

2114
script:
2215
- mvn -B clean -q
2316
- mvn -B --projects org.eclipse.paho.client.mqttv3,org.eclipse.paho.client.mqttv3.test test -q
24-
# - mvn -B --projects org.eclipse.paho.mqttv5.common,org.eclipse.paho.mqttv5.client,org.eclipse.paho.mqttv5.client.test test -q
17+
- mvn -B --projects org.eclipse.paho.mqttv5.common,org.eclipse.paho.mqttv5.client,org.eclipse.paho.mqttv5.client.test test -q
2518

26-
#addons:
27-
# apt:
28-
# sources:
29-
# - sourceline: 'ppa:mosquitto-dev/mosquitto-ppa'
30-
# packages:
31-
# - mosquitto

MQTTv3.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ Add the repository definition and the dependency definition shown below to your
1212

1313
Replace %REPOURL% with either ``` https://repo.eclipse.org/content/repositories/paho-releases/ ``` for the official releases, or ``` https://repo.eclipse.org/content/repositories/paho-snapshots/ ``` for the nightly snapshots. Replace %VERSION% with the level required .
1414

15-
The latest release version is ```1.2.4``` and the current snapshot version is ```1.2.5-SNAPSHOT```.
16-
15+
The latest release version is ```1.2.5``` and the current snapshot version is ```1.2.6-SNAPSHOT```.
1716

1817
```
1918
<project ...>

MQTTv5.md

Lines changed: 99 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,110 @@
11
# Eclipse Paho Java Client for MQTTv5
22

3-
_Warning: The Paho MQTTv5 client is under active development and so can expect breaking changes whilst in the develop branch._
3+
The v5 client is build on the same foundations as the v3 client is, however it is being heavily refactored using lessons learnt from the v3 client and feedback from the community. Like v3 client, the Paho Java Client provides two APIs: MqttAsyncClient provides a fully asychronous API where completion of activities is notified via registered callbacks. MqttClient is a synchronous wrapper around MqttAsyncClient where functions appear synchronous to the application.
44

5-
This branch of the Paho Java client is the home of the new MQTTv5 client implementation. This is very much a work in progress, so any feedback / and contributions will be appreciated.
5+
## Using the Paho Java MQTTv5 Client
66

7-
The Committee Specification for MQTT Version 5.0 is available to read here: http://docs.oasis-open.org/mqtt/mqtt/v5.0/cs01/mqtt-v5.0-cs01.html.
7+
### Downloading
88

9-
The v5 client is build on the same foundations as the v3 client is, however it is targeting Java 8 and above, allowing us to take advantages of more modern Java APIs to aid development and use. Any important fixes for the core engine can be ported between the two clients to take advantage of any performance or stability improvements. It is also being heavily refactored using lessons learnt from the v3 client and feedback from the community.
9+
Eclipse hosts a Nexus repository for those who want to use Maven to manage their dependencies. The released libraries are also available in the Maven Central repository.
1010

11-
## Plan
11+
Add the repository definition and the dependency definition shown below to your pom.xml.
1212

13-
#### Project Modules:
14-
* `org.eclipse.paho.mqttv5.client` - A full client similar to the existing mqttv3 client
15-
* `org.eclipse.paho.mqttv5.common` - A common library that could be used by both a client and server, contains a packet implementation that encodes and decodes all MQTTv5 packet types.
16-
* `org.eclipse.paho.mqttv5.testClient` - A number of examples written that show off features of the v5 client.
17-
* `org.eclipse.paho.mqttv5.server` - Not yet implemented. There has been some interest in the community for a Java MQTTv5 server using the vert.x framework. Contributions are very welcome.
13+
Replace %REPOURL% with either ``` https://repo.eclipse.org/content/repositories/paho-releases/ ``` for the official releases, or ``` https://repo.eclipse.org/content/repositories/paho-snapshots/ ``` for the nightly snapshots. Replace %VERSION% with the level required .
1814

19-
## Help, something doesn't work! / This looks terrible! / What about x!
15+
The latest release version is ```1.2.5``` and the current snapshot version is ```1.2.6-SNAPSHOT```.
2016

21-
This client is under active development and as such may be incomplete / broken a lot of the time right now. However, the more feedback and help we get on it, the better it will get! If you have any issues, please raise a bug against the client [here](https://github.com/eclipse/paho.mqtt.java/issues), but **please** prefix it with 'MQTTv5' so we know that it's not an issue with the current v3.1.1 client.
17+
```
18+
<project ...>
19+
<repositories>
20+
<repository>
21+
<id>Eclipse Paho Repo</id>
22+
<url>%REPOURL%</url>
23+
</repository>
24+
</repositories>
25+
...
26+
<dependencies>
27+
<dependency>
28+
<groupId>org.eclipse.paho</groupId>
29+
<artifactId>org.eclipse.paho.mqttv5.client</artifactId>
30+
<version>%VERSION%</version>
31+
</dependency>
32+
<dependency>
33+
<groupId>org.eclipse.paho</groupId>
34+
<artifactId>org.eclipse.paho.mqttv5.common</artifactId>
35+
<version>%VERSION%</version>
36+
</dependency>
37+
</dependencies>
38+
</project>
2239
23-
If you have any ideas about how the API should be designed going forward, then please chip in on [this](https://github.com/eclipse/paho.mqtt.java/issues/389) issue.
40+
```
41+
42+
If you find that there is functionality missing or bugs in the release version, you may want to try using the snapshot version to see if this helps before raising a feature request or an issue.
43+
44+
### Building from source
45+
46+
There are two active branches on the Paho Java git repository, ```master``` which is used to produce stable releases, and ```develop``` where active development is carried out. By default cloning the git repository will download the ```master``` branch, to build from ```develop``` make sure you switch to the remote branch: ``` git checkout -b develop remotes/origin/develop ```
47+
48+
To then build the library run the following maven command: ```mvn package -DskipTests```
49+
50+
This will build the client library without running the tests. The jars for the library, source and javadoc can be found in the ```org.eclipse.paho.mqttv5.client/target``` and ```org.eclipse.paho.mqttv5.common/target``` directories.
51+
52+
## Documentation
53+
Reference documentation is online at: [http://www.eclipse.org/paho/files/javadoc/index.html](http://www.eclipse.org/paho/files/javadoc/index.html)
54+
55+
Log and Debug in the Java Client: [https://wiki.eclipse.org/Paho/Log_and_Debug_in_the_Java_client](https://wiki.eclipse.org/Paho/Log_and_Debug_in_the_Java_client)
56+
57+
## Getting Started
58+
59+
The included code below is a very basic sample that connects to a server and publishes a message using the MqttClient asynchronous API. More extensive samples demonstrating the use of the Asynchronous API will be added in the ```org.eclipse.paho.sample.mqttv5app``` directory of the source soon.
60+
61+
62+
```
63+
import org.eclipse.paho.mqttv5.client.MqttAsyncClient;
64+
import org.eclipse.paho.mqttv5.client.MqttConnectionOptions;
65+
import org.eclipse.paho.mqttv5.client.IMqttToken;
66+
import org.eclipse.paho.mqttv5.client.persist.MemoryPersistence;
67+
import org.eclipse.paho.mqttv5.common.MqttException;
68+
import org.eclipse.paho.mqttv5.common.MqttMessage;
69+
import org.eclipse.paho.mqttv5.common.packet.MqttProperties;
70+
71+
public class MqttPublishSample {
72+
73+
public static void main(String[] args) {
74+
75+
String topic = "MQTT Examples";
76+
String content = "Message from MqttPublishSample";
77+
int qos = 2;
78+
String broker = "tcp://iot.eclipse.org:1883";
79+
String clientId = "JavaSample";
80+
MemoryPersistence persistence = new MemoryPersistence();
81+
82+
try {
83+
MqttConnectionOptions connOpts = new MqttConnectionOptions();
84+
connOpts.setCleanStart(false);
85+
MqttAsyncClient sampleClient = new MqttAsyncClient(broker, clientId, persistence);
86+
System.out.println("Connecting to broker: " + broker);
87+
IMqttToken token = sampleClient.connect(connOpts);
88+
token.waitForCompletion();
89+
System.out.println("Connected");
90+
System.out.println("Publishing message: "+content);
91+
MqttMessage message = new MqttMessage(content.getBytes());
92+
message.setQos(qos);
93+
token = sampleClient.publish(topic, message);
94+
token.waitForCompletion();
95+
System.out.println("Disconnected");
96+
System.out.println("Close client.");
97+
sampleClient.close();
98+
System.exit(0);
99+
} catch(MqttException me) {
100+
System.out.println("reason "+me.getReasonCode());
101+
System.out.println("msg "+me.getMessage());
102+
System.out.println("loc "+me.getLocalizedMessage());
103+
System.out.println("cause "+me.getCause());
104+
System.out.println("excep "+me);
105+
me.printStackTrace();
106+
}
107+
}
108+
}
109+
```
24110

25-
And of course, if you think of an amazing new feature for the v5 client, have a go at implementing it and submit a Pull Request against the develop branch!

README.md

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ Add the repository definition and the dependency definition shown below to your
3232

3333
Replace %REPOURL% with either ``` https://repo.eclipse.org/content/repositories/paho-releases/ ``` for the official releases, or ``` https://repo.eclipse.org/content/repositories/paho-snapshots/ ``` for the nightly snapshots. Replace %VERSION% with the level required .
3434

35-
The latest release version is ```1.2.4``` and the current snapshot version is ```1.2.5-SNAPSHOT```.
36-
35+
The latest release version is ```1.2.5``` and the current snapshot version is ```1.2.6-SNAPSHOT```.
3736

37+
** Dependency definition for MQTTv3 client **
3838
```
3939
<project ...>
4040
<repositories>
@@ -52,7 +52,31 @@ The latest release version is ```1.2.4``` and the current snapshot version is ``
5252
</dependency>
5353
</dependencies>
5454
</project>
55+
```
5556

57+
** Dependency definition for MQTTv5 client **
58+
```
59+
<project ...>
60+
<repositories>
61+
<repository>
62+
<id>Eclipse Paho Repo</id>
63+
<url>%REPOURL%</url>
64+
</repository>
65+
</repositories>
66+
...
67+
<dependencies>
68+
<dependency>
69+
<groupId>org.eclipse.paho</groupId>
70+
<artifactId>org.eclipse.paho.mqttv5.client</artifactId>
71+
<version>%VERSION%</version>
72+
</dependency>
73+
<dependency>
74+
<groupId>org.eclipse.paho</groupId>
75+
<artifactId>org.eclipse.paho.mqttv5.common</artifactId>
76+
<version>%VERSION%</version>
77+
</dependency>
78+
</dependencies>
79+
</project>
5680
```
5781

5882
If you find that there is functionality missing or bugs in the release version, you may want to try using the snapshot version to see if this helps before raising a feature request or an issue.
@@ -63,16 +87,21 @@ There are two active branches on the Paho Java git repository, ```master``` whic
6387

6488
To then build the library run the following maven command: ```mvn package -DskipTests```
6589

66-
This will build the client library without running the tests. The jars for the library, source and javadoc can be found in the ```org.eclipse.paho.client.mqttv3/target``` directory.
90+
This will build the client library without running the tests. The jars for the library, source and javadoc can be found in the following directories:
91+
```
92+
org.eclipse.paho.client.mqttv3/target
93+
org.eclipse.paho.mqttv5.client/target
94+
org.eclipse.paho.mqttv5.common/target
95+
```
6796

6897
## Documentation
69-
Reference documentation is online at: [http://www.eclipse.org/paho/files/javadoc/index.html](http://www.eclipse.org/paho/files/javadoc/index.html)
98+
MQTTv3 reference documentation is online at: [http://www.eclipse.org/paho/files/javadoc/index.html](http://www.eclipse.org/paho/files/javadoc/index.html)
7099

71100
Log and Debug in the Java Client: [https://wiki.eclipse.org/Paho/Log_and_Debug_in_the_Java_client](https://wiki.eclipse.org/Paho/Log_and_Debug_in_the_Java_client)
72101

73102
## Getting Started
74103

75-
The included code below is a very basic sample that connects to a server and publishes a message using the MqttClient synchronous API. More extensive samples demonstrating the use of the Asynchronous API can be found in the ```org.eclipse.paho.sample.mqttv3app``` directory of the source.
104+
The included code below is a very basic sample that connects to a server and publishes a message using the MQTTv3 synchronous API. More extensive samples demonstrating the use of the MQTTv3 and MQTTv5 Asynchronous API can be found in the ```org.eclipse.paho.sample``` directory of the source.
76105

77106

78107
```

org.eclipse.paho.client.mqttv3.internal.traceformat/build.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<!-- classpath.folder = ship.folder of org.eclipse.paho.client.mqttv3 build.xml -->
99
<property name="classpath.folder" value="../org.eclipse.paho.client.mqttv3/target/ship" />
1010

11-
<property name="client.release.version" value="1.2.4" />
12-
<property name="bundleVersion" value="1.2.4" />
11+
<property name="client.release.version" value="1.2.5" />
12+
<property name="bundleVersion" value="1.2.5" />
1313

1414
<property name="bundleVendor" value="Eclipse.org" />
1515
<property name="build.level" value="LYYMMDD" />

org.eclipse.paho.client.mqttv3.repository/category.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<site>
3-
<bundle id="org.eclipse.paho.client.mqttv3" version="1.2.4">
3+
<bundle id="org.eclipse.paho.client.mqttv3" version="1.2.5">
44
<category name="Paho MQTT Java"/>
55
</bundle>
66
<category-def name="Paho MQTT Java" label="Paho MQTT Java">

0 commit comments

Comments
 (0)