Skip to content

Commit 1db8d51

Browse files
committed
Merge pull request #2 from jpwsutton/develop
Updating the Contributing and Readme files
2 parents 4c28d24 + 1e3cd8b commit 1db8d51

3 files changed

Lines changed: 150 additions & 54 deletions

File tree

CONTRIBUTING.md

Lines changed: 31 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,62 @@
1-
Contributing to Paho
2-
====================
1+
# Contributing to Paho
32

4-
Thanks for your interest in this project.
3+
Thanks for your interest in this project!
54

6-
Project description:
7-
--------------------
5+
You can contribute bugfixes and new features by sending pull requests through GitHub.
86

9-
The Paho project has been created to provide reliable open-source implementations of open and standard messaging protocols aimed at new, existing, and emerging applications for Machine-to-Machine (M2M) and Internet of Things (IoT).
10-
Paho reflects the inherent physical and cost constraints of device connectivity. Its objectives include effective levels of decoupling between devices and applications, designed to keep markets open and encourage the rapid growth of scalable Web and Enterprise middleware and applications.
7+
## Legal
118

12-
- [Project web site](https://www.eclipse.org/paho)
13-
- [Project information](https://projects.eclipse.org/projects/iot.paho)
9+
In order for your contribution to be accepted, it must comply with the Eclipse Foundation IP policy.
1410

15-
Source
16-
------
11+
Please read the [Eclipse Foundation policy on accepting contributions via Git](http://wiki.eclipse.org/Development_Resources/Contributing_via_Git).
1712

18-
The Paho Java client and Android service are stored in a git repository. The URLs to access it are:
13+
1. Sign the [Eclipse CLA](http://www.eclipse.org/legal/CLA.php)
14+
1. Register for an Eclipse Foundation User ID. You can register [here](https://dev.eclipse.org/site_login/createaccount.php).
15+
2. Log into the [Projects Portal](https://projects.eclipse.org/), and click on the '[Eclipse CLA](https://projects.eclipse.org/user/sign/cla)' link.
16+
2. Go to your [account settings](https://dev.eclipse.org/site_login/myaccount.php#open_tab_accountsettings) and add your GitHub username to your account.
17+
3. Make sure that you _sign-off_ your Git commits in the following format:
18+
``` Signed-off-by: John Smith <johnsmith@nowhere.com> ``` This is usually at the bottom of the commit message. You can automate this by adding the '-s' flag when you make the commits. e.g. ```git commit -s -m "Adding a cool feature"```
19+
4. Ensure that the email address that you make your commits with is the same one you used to sign up to the Eclipse Foundation website with.
1920

20-
ssh://<username>@git.eclipse.org:29418/paho/org.eclipse.paho.mqtt.java
21-
https://<username>@git.eclipse.org/r/paho/org.eclipse.paho.mqtt.java
21+
## Contributing a change
2222

23-
A [web browsable repository](http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.java.git) is available.
23+
1. Fork the repository on GitHub
24+
2. Clone the forked repository onto your computer: ``` git clone https://github.com/eclipse/paho.mqtt.java.git ```
25+
3. Checkout the remote ```develop``` branch: ``` git checkout -b develop remotes/origin/develop ```
26+
4. Make your changes
27+
5. If developing a new feature, make sure to include JUnit tests.
28+
6. Ensure that all tests pass.
29+
7. Commit the changes into the branch: ``` git commit -s ``` Make sure that your commit message is meaningful and describes your changes correctly.
30+
8. If you have a lot of commits for the change, squash them into a single commit.
31+
9. Push the changes to the develop branch in your forked repository.
32+
10. Finally, submit a pull request using the normal GitHub Web Interface.
2433

25-
Contributing a patch
26-
--------------------
27-
28-
The Paho repositories are accessed through Gerrit, the code review
29-
project, which makes it possible for anybody to clone the repository, make
30-
changes and push them back for review and eventual acceptance into the project.
31-
32-
To do this, you must follow a few steps. The first of these are described at
33-
34-
- [Contributing via git](https://wiki.eclipse.org/Development_Resources/Contributing_via_Git)
35-
36-
* Sign the Eclipse CLA
37-
* Use a valid commit record, including a signed-off-by entry.
38-
39-
There are further details at
40-
41-
- [Handling Git Contributions](https://wiki.eclipse.org/Development_Resources/Handling_Git_Contributions)
42-
43-
Once the patch is pushed back to Gerrit, the project committers will be
44-
informed and they will undertake a review of the code. The patch may need
45-
modifying for some reason. In order to make amending commits more
46-
straightforward, the steps at
47-
https://git.eclipse.org/r/Documentation/cmd-hook-commit-msg.html should be
48-
followed. This automatically inserts a "Change-Id" entry to your commit message
49-
which allows you to amend commits and have Gerrit track them as the same
50-
change.
5134

5235
What happens next depends on the content of the patch. If it is 100% authored
5336
by the contributor and is less than 1000 lines (and meets the needs of the
54-
project), then it can be committed to the main repository. If not, more steps
55-
are required. These are detailed in the
37+
project), then it can be pulled into the main repository. If not, more steps
38+
are required. These are detailed in the
5639
[legal process poster](http://www.eclipse.org/legal/EclipseLegalProcessPoster.pdf).
5740

5841

59-
Developer resources:
60-
--------------------
6142

62-
Information regarding source code management, builds, coding standards, and more.
43+
## Developer resources:
6344

64-
- [https://projects.eclipse.org/projects/iot.paho/developer](https://projects.eclipse.org/projects/iot.paho/developer)
6545

66-
Contributor License Agreement:
67-
------------------------------
46+
Information regarding source code management, builds, coding standards, and more.
6847

69-
Before your contribution can be accepted by the project, you need to create and electronically sign the Eclipse Foundation [Contributor License Agreement (CLA)](http://www.eclipse.org/legal/CLA.php).
48+
- [https://projects.eclipse.org/projects/iot.paho/developer](https://projects.eclipse.org/projects/iot.paho/developer)
7049

7150
Contact:
7251
--------
7352

74-
Contact the project developers via the project's development
53+
Contact the project developers via the project's development
7554
[mailing list](https://dev.eclipse.org/mailman/listinfo/paho-dev).
7655

7756
Search for bugs:
7857
----------------
7958

80-
This project uses [Bugzilla](https://bugs.eclipse.org/bugs/buglist.cgi?product=Paho) to track ongoing development and issues.
59+
This project currently uses [Bugzilla](https://bugs.eclipse.org/bugs/buglist.cgi?product=Paho) to track ongoing development and issues.
8160

8261
Create a new bug:
8362
-----------------

README.md

Lines changed: 118 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,118 @@
1-
Paho Java client for MQTT
1+
# Eclipse Paho Java Client
2+
3+
The Paho Java Client is an MQTT client library written in Java for developing applications that run on the JVM or other Java compatible platforms such as Android
4+
5+
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.
6+
7+
8+
## Project description:
9+
10+
The Paho project has been created to provide reliable open-source implementations of open and standard messaging protocols aimed at new, existing, and emerging applications for Machine-to-Machine (M2M) and Internet of Things (IoT).
11+
Paho reflects the inherent physical and cost constraints of device connectivity. Its objectives include effective levels of decoupling between devices and applications, designed to keep markets open and encourage the rapid growth of scalable Web and Enterprise middleware and applications.
12+
13+
14+
## Links
15+
16+
- Project Website: [https://www.eclipse.org/paho](https://www.eclipse.org/paho)
17+
- Eclipse Project Information: [https://projects.eclipse.org/projects/iot.paho](https://projects.eclipse.org/projects/iot.paho)
18+
- Paho Java Client Page: [https://eclipse.org/paho/clients/java/](https://eclipse.org/paho/clients/java)
19+
- GitHub: [https://github.com/eclipse/paho.mqtt.java](https://github.com/eclipse/paho.mqtt.java)
20+
- Twitter: [@eclipsepaho](https://twitter.com/eclipsepaho)
21+
- Issues: Currently [https://bugs.eclipse.org/bugs/buglist.cgi?component=MQTT-Java](https://bugs.eclipse.org/bugs/buglist.cgi?component=MQTT-Java), though will soon be GitHub Issues.
22+
- Mailing-list: [https://dev.eclipse.org/mailman/listinfo/paho-dev](https://dev.eclipse.org/mailman/listinfo/paho-dev)
23+
24+
## Using the Paho Java Client
25+
26+
### Downloading
27+
28+
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.
29+
30+
Add the repository definition and the dependency definition shown below to your pom.xml.
31+
32+
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 .
33+
The latest release version is ```1.0.2``` and the current snapshot version is ```1.0.3```.
34+
35+
```
36+
<project ...>
37+
<repositories>
38+
<repository>
39+
<id>Eclipse Paho Repo</id>
40+
<url>%REPOURL%</url>
41+
</repository>
42+
</repositories>
43+
...
44+
<dependencies>
45+
<dependency>
46+
<groupId>org.eclipse.paho</groupId>
47+
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
48+
<version>%VERSION%</version>
49+
</dependency>
50+
</dependencies>
51+
</project>
52+
53+
```
54+
55+
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.
56+
57+
### Builing from source
58+
59+
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 ```
60+
61+
To then build the library run the following maven command: ```mvn package -DskipTests```
62+
63+
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.
64+
65+
## Documentation
66+
Reference documentation is online at: [http://www.eclipse.org/paho/files/javadoc/index.html](http://www.eclipse.org/paho/files/javadoc/index.html)
67+
68+
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)
69+
70+
## Getting Started
71+
72+
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.
73+
74+
75+
```
76+
import org.eclipse.paho.client.mqttv3.MqttClient;
77+
import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
78+
import org.eclipse.paho.client.mqttv3.MqttException;
79+
import org.eclipse.paho.client.mqttv3.MqttMessage;
80+
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
81+
82+
public class MqttPublishSample {
83+
84+
public static void main(String[] args) {
85+
86+
String topic = "MQTT Examples";
87+
String content = "Message from MqttPublishSample";
88+
int qos = 2;
89+
String broker = "tcp://iot.eclipse.org:1883";
90+
String clientId = "JavaSample";
91+
MemoryPersistence persistence = new MemoryPersistence();
92+
93+
try {
94+
MqttClient sampleClient = new MqttClient(broker, clientId, persistence);
95+
MqttConnectOptions connOpts = new MqttConnectOptions();
96+
connOpts.setCleanSession(true);
97+
System.out.println("Connecting to broker: "+broker);
98+
sampleClient.connect(connOpts);
99+
System.out.println("Connected");
100+
System.out.println("Publishing message: "+content);
101+
MqttMessage message = new MqttMessage(content.getBytes());
102+
message.setQos(qos);
103+
sampleClient.publish(topic, message);
104+
System.out.println("Message published");
105+
sampleClient.disconnect();
106+
System.out.println("Disconnected");
107+
System.exit(0);
108+
} catch(MqttException me) {
109+
System.out.println("reason "+me.getReasonCode());
110+
System.out.println("msg "+me.getMessage());
111+
System.out.println("loc "+me.getLocalizedMessage());
112+
System.out.println("cause "+me.getCause());
113+
System.out.println("excep "+me);
114+
me.printStackTrace();
115+
}
116+
}
117+
}
118+
```

org.eclipse.paho.client.mqttv3.test/src/test/resources/test.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ SERVER_URI=tcp://iot.eclipse.org:1883
44
CLIENT_KEY_STORE=clientkeystore.jks
55
CLIENT_KEY_STORE_PASSWORD=password
66
CLIENT_TRUST_STORE=clientkeystore.jks
7-
SERVER_SSL_PORT=8883
7+
SERVER_SSL_PORT=18884
88
SERVER_WEBSOCKET_URI=ws://iot.eclipse.org:80
99

1010
# The list of server URIs which may be set in the MQTT ConnectOptions for an HA testcase.

0 commit comments

Comments
 (0)