Coder Social home page Coder Social logo

hono-enmasse's Introduction

Eclipse Hono on EnMasse

Playgroud for running Eclipse Hono on EnMasse.

Prerequisites

The main prerequisite is to have a running OpenShift cluster. In order to have a simple one node cluster on a local development PC, this guide on using oc tools is pretty useful.

Deploying EnMasse

The EnMasse project can be deployed on a running OpenShift cluster using just the following provided script :

    enmasse_deploy.sh

EnMasse deployment

Or the TLS version if you want to enable clients connecting using TLS protocol :

    enmasse_tls_deploy.sh

Deploying Eclipse Hono

After deploying EnMasse, all the Eclipse Hono components can be deployed with the following provided script :

    hono_deploy.sh

It will deploy the Hono Server and the two available protocol adapters (HTTP REST and MQTT).

Eclipse Hono deployment

Deploying addresses

In order to make the messaging infrastructure aware of the telemetry and event channels handled by the Eclipse Hono API, we could deploy them through the EnMasse addresses API :

    curl -X PUT -H "content-type: application/json" --data-binary @addresses.json http://$(oc get service -o jsonpath='{.spec.clusterIP}' address-controller):8080/v3/address

Receiver

An example of receiver application is provided by the Eclipse Hono GitHub repo and how to run it is described on the official website in the Getting Started guide.

Before doing that, it's needed to create a new "user" using the EnMasse console (i.e. user1@enmasse).

User creation

After that, the receiver console application can be launched in the following way :

    mvn spring-boot:run -Drun.arguments=--hono.client.host=172.30.90.42,--hono.client.port=5672,--hono.client.trustStorePath=null,--hono.client.username=user1@enmasse,--hono.client.password=pw

Where the address is related to the messaging router service cluster IP provided by EnMasse. In the following picture, a receiver running and receiving published messages :

Receiver

Sender

The sender can be the one provided as example from the Eclipse Hono GitHub repo, an HTTP client or an MQTT client using related protocol adapters. As the receiver one, the sender console application can be launched in the following way :

    mvn spring-boot:run -Drun.arguments=--spring.profiles.active=sender,--hono.client.host=172.30.35.38

Where the address is related to the hono-app service cluster IP so the Hono server component.

Regarding the protocol adapters, their usage is explained here :

In both cases, the sender starts to work after a device registration that is possible using the HTTP REST API but not the MQTT one in the following way :

    curl -X POST -i -d 'device_id=4711' http://172.30.121.77:8080/registration/DEFAULT_TENANT

Where the address is related to the hono-adapter-rest-vertx service cluster IP. After registering the device, sending data is possible through HTTP REST :

    curl -X PUT -i -H 'Content-Type: application/json' --data-binary '{"temp": 5}' http://172.30.121.77:8080/telemetry/DEFAULT_TENANT/4711

Or using MQTT :

    mosquitto_pub -h 172.30.19.182 -i 4711 -t telemetry/DEFAULT_TENANT/4711 -m '{"temp": 5}'

Where the address is related to the hono-adapter-mqtt-vertx service cluster IP.

Current limitations

The current deployment has the following "limitations" :

  • there are no policies configured into the messaging router (as provided in the official Eclipse Hono example)
  • there is no encrypted communication between the Hono server component and the messaging router infrastructure

The above "limitations" will be addressed in the next cycle.

hono-enmasse's People

Contributors

ppatierno avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.