Hono is deployed on a Minikube cluster (I followed https://www.eclipse.org/hono/getting-started/ to set up Hono locally) and Ditto is running on localhost. I tried to follow this tutorial and adapt it so it works for local deployment. Unfortunately I'm unable to connect Ditto to the AMQP endpoint of my local Hono instance, which I tried the following way:
curl -X POST -i -u devops:foobar -H 'Content-Type: application/json' -d '{
"targetActorSelection": "/system/sharding/connection",
"headers": {
"aggregate": false
},
"piggybackCommand": {
"type": "connectivity.commands:testConnection",
"connection": {
"id": "hono-example-connection",
"connectionType": "amqp-10",
"connectionStatus": "open",
"failoverEnabled": true,
"uri": "amqp://consumer%40HONO:verysecret@honotry:15672",
"sources": [
{
"addresses": [
"telemetry/test_tenant"
],
"authorizationContext": ["nginx:ditto"]
}
]}
}
}' http://localhost:8080/devops/piggyback/connectivity?timeout=8000
"honotry" resolves to the IP address of the service "hono-dispatch-router-ext".
I get the return:
{"?":{"?":{"type":"devops.responses:errorResponse","status":504,"serviceName":null,"instance":null,"payload":{"status":504,"error":"connectivity:connection.failed","message":"The Connection with ID 'hono-example-connection' failed to connect.","description":"honotry: System error"}}}}
I don't know why I get this error message.
I'm able to connect the local Ditto instance to Hono Sandbox:
curl -X POST -i -u devops:foobar -H 'Content-Type: application/json' -d '{
"targetActorSelection": "/system/sharding/connection",
"headers": {
"aggregate": false
},
"piggybackCommand": {
"type": "connectivity.commands:testConnection",
"connection": {
"id": "hono-example-connection",
"connectionType": "amqp-10",
"connectionStatus": "open",
"failoverEnabled": true,
"uri": "amqp://consumer%40HONO:[email protected]:15672",
"sources": [
{
"addresses": [
"telemetry/test_tenant"
],
"authorizationContext": ["nginx:ditto"]
}
]}
}
}' http://localhost:8080/devops/piggyback/connectivity?timeout=8000
I get the return:
{"?":{"?":{"type":"connectivity.responses:testConnection","status":200,"connectionId":"hono-example-connection","testResult":"successfully connected + initialized mapper"}}}
It is also possible to connect the local Hono AMQP Endpoint using the command line client:
java -jar hono-cli-*-exec.jar --hono.client.host=honotry --hono.client.port=15672 --hono.client.username=consumer@HONO --hono.client.password=verysecret --spring.profiles.active=receiver --tenant.id=test_tenant
Does anyone have an idea how to fix that problem? Thank you in advance!
EDIT:
kubectl get service -n hono
returns
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
hono-adapter-amqp-vertx LoadBalancer 10.98.166.86 10.98.166.86 5672:32672/TCP,5671:32671/TCP 38d
hono-adapter-amqp-vertx-headless ClusterIP None <none> <none> 38d
hono-adapter-http-vertx LoadBalancer 10.109.22.54 10.109.22.54 8080:30080/TCP,8443:30443/TCP 38d
hono-adapter-http-vertx-headless ClusterIP None <none> <none> 38d
hono-adapter-mqtt-vertx LoadBalancer 10.102.80.84 10.102.80.84 1883:31883/TCP,8883:30883/TCP 38d
hono-adapter-mqtt-vertx-headless ClusterIP None <none> <none> 38d
hono-artemis ClusterIP 10.109.194.251 <none> 5671/TCP 38d
hono-dispatch-router ClusterIP 10.96.42.49 <none> 5673/TCP 38d
hono-dispatch-router-ext LoadBalancer 10.98.212.66 10.98.212.66 15671:30671/TCP,15672:30672/TCP 38d
hono-grafana ClusterIP 10.97.9.216 <none> 3000/TCP 38d
hono-prometheus-server ClusterIP 10.102.174.24 <none> 9090/TCP 38d
hono-service-auth ClusterIP 10.101.250.119 <none> 5671/TCP 38d
hono-service-auth-headless ClusterIP None <none> <none> 38d
hono-service-device-connection-headless ClusterIP None <none> <none> 38d
hono-service-device-registry ClusterIP 10.108.127.7 <none> 5671/TCP,8443/TCP 38d
hono-service-device-registry-ext LoadBalancer 10.108.60.120 10.108.60.120 28080:31080/TCP,28443:31443/TCP 38d
hono-service-device-registry-headless ClusterIP None <none> <none> 38d
honotry is set to 10.98.212.66 in /etc/hosts.