GithubHelp home page GithubHelp logo

Connect ditto with hono about ditto HOT 4 CLOSED

pavithvishnu avatar pavithvishnu commented on June 17, 2024
Connect ditto with hono

from ditto.

Comments (4)

thjaeckle avatar thjaeckle commented on June 17, 2024

The Eclipse IoT Packages project provides a connection template showing a possible connection configuration to connect to Hono via Kafka:
https://github.com/eclipse/packages/blob/master/packages/cloud2edge/post-install/hono-kafka-connection.json

This should be a good starting point.
Apart from that there is plenty of documentation to explore.

from ditto.

pavithvishnu avatar pavithvishnu commented on June 17, 2024

hi @thjaeckle,
thanks for pointing me to the document, i have followed the document and deployed the c2e package on the AKS, and try out the examples mentioned in that, but i was unable to create a new connection between hono and ditto, i have try both amqp and kafka based connection setting, none of them works.
problem:

  1. AMQP as mentioned in doc (dispatch-router container is not created i have follow the this link to install c2e https://www.eclipse.org/packages/packages/cloud2edge/installation/)
    curl -i -X POST -u devops:${DITTO_DEVOPS_PWD} -H 'Content-Type: application/json' --data '{
    "targetActorSelection": "/system/sharding/connection",
    "headers": {
    "aggregate": false
    },
    "piggybackCommand": {
    "type": "connectivity.commands:createConnection",
    "connection": {
    "id": "hono-connection-for-'"${HONO_TENANT}"'",
    "connectionType": "amqp-10",
    "connectionStatus": "open",
    "uri": "amqp://consumer%40HONO:verysecret@'"${RELEASE}"'-dispatch-router-ext:15672",
    "failoverEnabled": true,
    "sources": [
    {
    "addresses": [
    "telemetry/'"${HONO_TENANT}"'",
    "event/'"${HONO_TENANT}"'"
    ],
    "authorizationContext": [
    "pre-authenticated:hono-connection"
    ],
    "enforcement": {
    "input": "{{ header:device_id }}",
    "filters": [
    "{{ entity:id }}"
    ]
    },
    "headerMapping": {
    "hono-device-id": "{{ header:device_id }}",
    "content-type": "{{ header:content-type }}"
    },
    "replyTarget": {
    "enabled": true,
    "address": "{{ header:reply-to }}",
    "headerMapping": {
    "to": "command/'"${HONO_TENANT}"'/{{ header:hono-device-id }}",
    "subject": "{{ header:subject | fn:default(topic:action-subject) | fn:default(topic:criterion) }}-response",
    "correlation-id": "{{ header:correlation-id }}",
    "content-type": "{{ header:content-type | fn:default('"'"'application/vnd.eclipse.ditto+json'"'"') }}"
    },
    "expectedResponseTypes": [
    "response",
    "error"
    ]
    },
    "acknowledgementRequests": {
    "includes": [],
    "filter": "fn:filter(header:qos,'"'"'ne'"'"','"'"'0'"'"')"
    }
    },
    {
    "addresses": [
    "command_response/'"${HONO_TENANT}"'/replies"
    ],
    "authorizationContext": [
    "pre-authenticated:hono-connection"
    ],
    "headerMapping": {
    "content-type": "{{ header:content-type }}",
    "correlation-id": "{{ header:correlation-id }}",
    "status": "{{ header:status }}"
    },
    "replyTarget": {
    "enabled": false,
    "expectedResponseTypes": [
    "response",
    "error"
    ]
    }
    }
    ],
    "targets": [
    {
    "address": "command/'"${HONO_TENANT}"'",
    "authorizationContext": [
    "pre-authenticated:hono-connection"
    ],
    "topics": [
    "//things/live/commands",
    "//things/live/messages"
    ],
    "headerMapping": {
    "to": "command/'"${HONO_TENANT}"'/{{ thing:id }}",
    "subject": "{{ header:subject | fn:default(topic:action-subject) }}",
    "content-type": "{{ header:content-type | fn:default('"'"'application/vnd.eclipse.ditto+json'"'"') }}",
    "correlation-id": "{{ header:correlation-id }}",
    "reply-to": "{{ fn:default('"'"'command_response/'"${HONO_TENANT}"'/replies'"'"') | fn:filter(header:response-required,'"'"'ne'"'"','"'"'false'"'"') }}"
    }
    },
    {
    "address": "command/'"${HONO_TENANT}"'",
    "authorizationContext": [
    "pre-authenticated:hono-connection"
    ],
    "topics": [
    "//things/twin/events",
    "//things/live/events"
    ],
    "headerMapping": {
    "to": "command/'"${HONO_TENANT}"'/{{ thing:id }}",
    "subject": "{{ header:subject | fn:default(topic:action-subject) }}",
    "content-type": "{{ header:content-type | fn:default('"'"'application/vnd.eclipse.ditto+json'"'"') }}",
    "correlation-id": "{{ header:correlation-id }}"
    }
    }
    ]
    }
    }
    }' http://${DITTO_API_IP}:${DITTO_API_PORT_HTTP}/devops/piggyback/connectivity

  2. Kafka based connection:
    i have trying deploying the ditto as docker container, also as helm package, also with c2e package. in all the cases, whenever i try to create a kafka connection using connectivity api and piggyback command. connectivity containers starts to crashs in loop. there is no recovery for it.

can you please help me out with it.?

from ditto.

pavithvishnu avatar pavithvishnu commented on June 17, 2024

There is an update, I have modified the yaml file. Now I have able to create a connection between hono and ditto using amqp.
but if I send the data from the device to hono it is not reflecting in ditto.

from ditto.

thjaeckle avatar thjaeckle commented on June 17, 2024

Please provide the logs of Ditto's connectivity container. This should give an insight in the potential configuration errors.

from ditto.

Related Issues (20)

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.