I am using Ignition 8 and trying to read the data from tags and send it to RabbitMQ queue using pika library.
But when I try to establish a connection using python Pika library it return error as
‘module’ object has no attribute ‘SOMAXCONN’
The script runs fine when executed independently outside the Ignition environment, but the same script fails when executed on Tag or Console script with above error.
Actually I found we can add that “SOMAXCONN = 128” in _Socket.py in jython lib manually.
However pika didn’t work in ignition
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\jython2.7.2\Lib\site-packages\pika\adapters\blocking_connection.py", line 359, in __init__
self._impl = self._create_connection(parameters, _impl_class)
File "C:\jython2.7.2\Lib\site-packages\pika\adapters\blocking_connection.py", line 450, in _create_connection
raise self._reap_last_connection_workflow_error(error)
pika.exceptions.AMQPConnectionError
There is probably a way to do this the same as MQTT, for now. On my side, I use amqp-client.xxxx.jar. It is not fun great to use, and loading the JAR file is a bit of a pain for update, or if there is any issue. I will say that creating a module to integrate will be a better approach.
I did not have time to watch on how to create a module for it yet
@calimero100582 Thanks, I also figured it out how to do it by now.
The JAR file import is indeed not to much fun, definitely when transferring/deploying servers. I will create a module in the near future to support AMQP.