Eclipse Kapua :: Gateway Client

A gateway client SDK for Eclipse Kapua™

Лицензия

Лицензия

Категории

Категории

CLI Взаимодействие с пользователем
Группа

Группа

de.dentrassi.kapua
Идентификатор

Идентификатор

kapua-gateway-client
Последняя версия

Последняя версия

0.2.1
Дата

Дата

Тип

Тип

pom
Описание

Описание

Eclipse Kapua :: Gateway Client
A gateway client SDK for Eclipse Kapua™
Ссылка на сайт

Ссылка на сайт

https://github.com/ctron/kapua-gateway-client
Система контроля версий

Система контроля версий

https://github.com/ctron/kapua-gateway-client

Скачать kapua-gateway-client

Имя Файла Размер
kapua-gateway-client-0.2.1.pom 9 KB
Обзор

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/de.dentrassi.kapua/kapua-gateway-client/ -->
<dependency>
    <groupId>de.dentrassi.kapua</groupId>
    <artifactId>kapua-gateway-client</artifactId>
    <version>0.2.1</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/de.dentrassi.kapua/kapua-gateway-client/
implementation 'de.dentrassi.kapua:kapua-gateway-client:0.2.1'
// https://jarcasting.com/artifacts/de.dentrassi.kapua/kapua-gateway-client/
implementation ("de.dentrassi.kapua:kapua-gateway-client:0.2.1")
'de.dentrassi.kapua:kapua-gateway-client:pom:0.2.1'
<dependency org="de.dentrassi.kapua" name="kapua-gateway-client" rev="0.2.1">
  <artifact name="kapua-gateway-client" type="pom" />
</dependency>
@Grapes(
@Grab(group='de.dentrassi.kapua', module='kapua-gateway-client', version='0.2.1')
)
libraryDependencies += "de.dentrassi.kapua" % "kapua-gateway-client" % "0.2.1"
[de.dentrassi.kapua/kapua-gateway-client "0.2.1"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

  • gateway-client-api
  • gateway-client-profile-kura
  • gateway-client-provider-mqtt
  • gateway-client-provider-mqtt-fuse
  • gateway-client-provider-mqtt-paho
  • gateway-client-spi
  • features
  • examples

Eclipse Kapua™ Gateway Client SDK Build status Maven Central

This project provides an SDK for connecting to Eclipse 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

<dependency>
  <groupId>de.dentrassi.kapua</groupId>
  <artifactId>kapua-gateway-client-provider-mqtt-fuse</artifactId>
  <version><!-- replace with current version --></version>
</dependency>
<dependency>
  <groupId>de.dentrassi.kapua</groupId>
  <artifactId>kapua-gateway-client-profile-kura</artifactId>
  <version><!-- replace with current version --></version>
</dependency>

Example client

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<RuntimeException> sender = application
      .data(Topic.of("my", "sender"))
      .errors(ignore());

    int i = 0;
    while (true) {
      // send
      sender.send(Payload.of("counter", i++));
      Thread.sleep(1000);
    }
  }
}

Версии библиотеки

Версия
0.2.1
0.2.0
0.1.0