Console Script - RabbitMQ Pika - 'module' object has no attribute 'SOMAXCONN'

Hi Team,

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.

Could you please suggest?

mport pika;
import sys

try:

credentials = pika.PlainCredentials('xxxx', 'xxxx')
parameters = pika.ConnectionParameters('xx.xxx.xxx.xxx',5672,'/',credentials)
connection = pika.BlockingConnection(parameters)

Did someone find out what’s the problem?

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

Maybe you already knew, I just found that you can use the “amqp-client-5.9.0.jar” to talk with RabbitMQ