Hi all,
I'm currently working on implementing OpenZiti in a project and I’ve encountered an issue with the communication between two components (from Inference Server to Message Queue). I'd really appreciate any help or insights you might have.
For the sake of testing, I have everything running on different computers within the same network, representing the IoT Client, Edge, and Cloud.
I’ve been able to configure host-based tunnellers for each platform and have successfully established communication between the following components:
- IoT Client → Web Server
- Web Server → Preprocessor
- Preprocessor → Inference
The Problem
However, I'm facing issues with the communication between the Inference and the MQ, even though I configured it in the same exact way as the other components.
Configuration details:
#1
ziti edge create identity inference -a 'inference' -o inference.jwt
#2
ziti edge create identity rabbitmq -a 'rabbitmq' -o rabbitmq.jwt
#3
ziti edge create config inference-to-rabbitmq.intercept.v1 intercept.v1 \
'{"protocols":["tcp"],"addresses":["ziti.rabbitmq"], "portRanges":[{"low":5672, "high":5672}]}'
#4
ziti edge create config rabbitmq.host.v1 host.v1 \
'{"protocol":"tcp", "address":"rabbitmq", "port":5672}'
#5
ziti edge create service inference-to-rabbitmq.svc --configs inference-to-rabbitmq.intercept.v1,rabbitmq.host.v1
#6
ziti edge create service-policy inference-to-rabbitmq.dial Dial \
--service-roles "@inference-to-rabbitmq.svc" --identity-roles '#inference'
#7
ziti edge create service-policy inference-to-rabbitmq.bind Bind \
--service-roles '@inference-to-rabbitmq.svc' --identity-roles '@${rabbitmq-id}'
To test the communication, I used a simple script to send a message from the Inference to the MQ. The script is as follows:
#!/usr/bin/env python
import pika
connection = pika.BlockingConnection(
pika.ConnectionParameters(host='ziti.rabbitmq'))
channel = connection.channel()
channel.queue_declare(queue='hello')
channel.basic_publish(exchange='', routing_key='hello', body='Hello World!')
print(" [x] Sent 'Hello World!'")
connection.close()
And here is the error I received during the test:
When running the above script:
Traceback (most recent call last):
File "/inference/send.py", line 4, in <module>
connection = pika.BlockingConnection(
File "/usr/local/lib/python3.10/site-packages/pika/adapters/blocking_connection.py", line 360, in __init__
self._impl = self._create_connection(parameters, _impl_class)
File "/usr/local/lib/python3.10/site-packages/pika/adapters/blocking_connection.py", line 451, in _create_connection
raise self._reap_last_connection_workflow_error(error)
pika.exceptions.AMQPConnectionError
From the ziti tunnel on the Inference:
(40)[ 1052.272] INFO tunnel-cbs:ziti_dns.c:566 format_resp() found record[100.64.0.3] for query[1:ziti.rabbitmq]
(40)[ 1052.291] ERROR ziti-sdk:connect.c:1069 connect_reply_cb() conn[0.162/05klez7l/Connecting] failed to connect, reason=exceeded maximum [2] retries creating circuit [c/BtuzjWTfD]: error creating route for [s/BtuzjWTfD] on [r/to2gAmN0.N] (error creating route for [c/BtuzjWTfD]: failed to establish connection with terminator address 3GzQ4Lw74XXEC1zHRZJb0K. error: (rejected by application))
From the ziti tunnel on the MQ:
(11917)[ 807.418] INFO tunnel-cbs:ziti_hosting.c:637 on_hosted_client_connect() hosted_service[inference-to-rabbitmq.svc] client[inference] client_src_addr[tcp:100.64.0.1:34592] dst_addr[tcp:rabbitmq:5672]: incoming connection
(11917)[ 807.423] ERROR tunnel-cbs:ziti_hosting.c:683 on_hosted_client_connect_resolved() hosted_service[inference-to-rabbitmq.svc] client[inference] client_src_addr[tcp:100.64.0.1:34592] getaddrinfo(tcp:rabbitmq:5672) failed: temporary failure
I’m not sure what could be causing the issue with this specific communication, as the other services work fine. I would appreciate your thoughts on what might be going wrong, or if there's anything I might have overlooked in the configuration.
Thanks for your time and help!