Issue with class-based OPC UA client in multiprocessor system #1695
Unanswered
shayakhmetovi
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Thank you for this library. It looks great! We tried to integrate it into our project. We faced some issues with implementing the subscription mechanism.
We added a subscription model that stores information about the client, subscription ID, subscription handle, and node ID. We created a class for the OPC UA client that stores information about subscriptions, including the Subscription object. Subscriptions are handled by a workflow handler (joeflow). As soon as data change notification data is received, our subscription handler starts a workflow that performs processing in asynchronous workers (RabbitMQ/Dramatiq). Problem: Dramatiq workers create a new instance of the OPC UA client. Each client creates a new connection to the OPC UA server. How can we properly organize work with a subscription in a system with multiple OPC UA clients? We added client synchronization through the subscription model in the database. Every 10 seconds, the client checks the connection with the server and checks the subscription table to determine which subscription is active, which subscription needs to be created on the client, and which subscription needs to be deleted since it has already been created on another client. However, we encountered low performance and a large number of requests to the DB and OPC UA server. Are there any examples of how to implement a singleton client in a multiprocessor system with state exchange? Or is it impossible to do without OPC UA client as a separate microservice?
All instances are working in Docker.
We will really appreciate your help.
Python 3.8
Django==4.2.11
django-dramatiq
dramatiq[rabbitmq, watch]
joeflow[reversion,dramatiq]==1.1.3
Beta Was this translation helpful? Give feedback.
All reactions