Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ctron/kapua-gateway-client
A Gateway Client SDK for Eclipse Kapua™
https://github.com/ctron/kapua-gateway-client
eclipse-iot iot iot-gateway
Last synced: about 1 month ago
JSON representation
A Gateway Client SDK for Eclipse Kapua™
- Host: GitHub
- URL: https://github.com/ctron/kapua-gateway-client
- Owner: ctron
- License: epl-1.0
- Created: 2017-05-16T16:08:13.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-20T09:10:08.000Z (over 7 years ago)
- Last Synced: 2024-05-02T06:15:06.765Z (8 months ago)
- Topics: eclipse-iot, iot, iot-gateway
- Language: Java
- Homepage:
- Size: 898 KB
- Stars: 8
- Watchers: 6
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: license.html
Awesome Lists containing this project
README
# Eclipse Kapua™ Gateway Client SDK [![Build status](https://api.travis-ci.org/ctron/kapua-gateway-client.svg)](https://travis-ci.org/ctron/kapua-gateway-client) [![Maven Central](https://img.shields.io/maven-central/v/de.dentrassi.kapua/kapua-gateway-client.svg "Maven Central Status")](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22de.dentrassi.kapua%22)
This project provides an SDK for connecting to [Eclipse Kapua](https://eclipse.org/kapua) as a gateway.
**Note:** This is not part of the Eclipse Kapua project.
This project should provide a simple to use SDK for pushing telemetry data into Kapua
and consuming command messages out of Kapua.**Note:** This is a work in progress and should not be considered production ready.
## How to use
The following quick steps should provide you with a working example.
### Add to your Maven project
```xml
de.dentrassi.kapua
kapua-gateway-client-provider-mqtt-fuse
de.dentrassi.kapua
kapua-gateway-client-profile-kura
```
### Example client
```java
import static org.eclipse.kapua.gateway.client.Credentials.userAndPassword;
import static org.eclipse.kapua.gateway.client.Errors.ignore;import org.eclipse.kapua.gateway.client.mqtt.fuse.FuseClient;
import org.eclipse.kapua.gateway.client.profile.kura.KuraMqttProfile;try (Client client = KuraMqttProfile.newProfile(FuseClient.Builder::new)
.accountName("kapua-sys")
.clientId("foo-bar-1")
.brokerUrl("tcp://localhost:1883")
.credentials(userAndPassword("kapua-broker", "kapua-password"))
.build()) {try (Application application = client.buildApplication("app1").build()) {
// subscribe to a topic
application.data(Topic.of("my", "receiver")).subscribe(message -> {
System.out.format("Received: %s%n", message);
});// cache sender instance
Sender sender = application
.data(Topic.of("my", "sender"))
.errors(ignore());int i = 0;
while (true) {
// send
sender.send(Payload.of("counter", i++));
Thread.sleep(1000);
}
}
}
```