(Migrated) Can't send and receive message (ZeroMQ)

(This message has been automatically imported from the retired mailing list)

Hello Dariusz,

I’m trying to create a new ZMQ outgoing, with the following information:

Name: LAB

Active: YES

Address: tcp://10.1.0.12:3355 or tcp://127.0.0.1:3355

And ZMQ channel:

Name: RECEIVE

Active: YES

Address: tcp://10.1.0.12:3355 or tcp://127.1.0.1:3355

Socket Type: PULL

Service: teste-receber-zero-mq.processa

data format: JSON

The log shows:

2015-07-23 09:15:37,182 - INFO - 30653:Thread-13 - zato.common.zmq_:22

  • Starting PULL [zmq-connector-RECEBER/tcp://10.1.0.12:3355]

I’ve created this calling service for send message:

#!/usr/bin/env python

-- coding: utf-8 --

from json import dumps
from zato.server.service import Service

version = “1.0.0”

class Processa(Service):

def handle(self):

    request = {'id':123, 'name': 'Jean'}
    val = self.outgoing.zmq.send(dumps(request), 'LAB')

But, I cannot send and receive the message, and the system not
listening port 3355.

Zato version: Zato 2.0.5.rev-9f28518a

Thanks a lot.

Hello Jean,

I have added "export
PYTHONPATH=/opt/zato/2.0.5/code/eggs/pyzmq-2.2.0.1-py2.7-linux-x86_64.egg/"
to /opt/zato/.bashrc in order to use zmq in the python zato uses, but
creating a ZeroMQ channel seens ok but port is not listening too.

I have also seen that there is a move to zmq.green on version 2.1 (
https://github.com/zatosource/zato/issues/324)

For now, I will try with 2.0.5 on Debian 8 and let you know the results.

[]s,
Guilherme

On Thu, Jul 23, 2015 at 10:09 AM, Jean Michel <jean.engenheirocomp@gmail.com

wrote:

Hello Dariusz,

I’m trying to create a new ZMQ outgoing, with the following information:

Name: LAB

Active: YES

Address: tcp://10.1.0.12:3355 or tcp://127.0.0.1:3355

And ZMQ channel:

Name: RECEIVE

Active: YES

Address: tcp://10.1.0.12:3355 or tcp://127.1.0.1:3355

Socket Type: PULL

Service: teste-receber-zero-mq.processa

data format: JSON

The log shows:

2015-07-23 09:15:37,182 - INFO - 30653:Thread-13 - zato.common.zmq_:22 - Starting PULL [zmq-connector-RECEBER/tcp://10.1.0.12:3355]

I’ve created this calling service for send message:

#!/usr/bin/env python

-- coding: utf-8 --

from json import dumps
from zato.server.service import Service

version = “1.0.0”

class Processa(Service):

def handle(self):

    request = {'id':123, 'name': 'Jean'}
    val = self.outgoing.zmq.send(dumps(request), 'LAB')

But, I cannot send and receive the message, and the system not listening port 3355.

Zato version: Zato 2.0.5.rev-9f28518a

Thanks a lot.

On 05/08/2015 23:33, Guilherme Monteiro wrote:

I have added "export
PYTHONPATH=/opt/zato/2.0.5/code/eggs/pyzmq-2.2.0.1-py2.7-linux-x86_64.egg/"
to /opt/zato/.bashrc in order to use zmq in the python zato uses
Just FYI, you can simply do
/opt/zato/2.0.5/bin/py <script.py>
and the script will be run with all the zato-provided libraries
available to be imported.

Regards,

Brian.

Thanks Brian, I didn’t know about the py script! :slight_smile:

Jean, I did not tested it yet on other new and clean installation, but at
least I could test some basic python zmq scripts and using
/opt/zato/2.0.5/bin/py they all worked, so the channel problem should be
something around zmq usage in Zato itself.

I did some search on config files and found just the zeromq_connect_sleep
on server.conf

On my logs I see no error at all. Do you see any?

[]s,
Guilherme

On Wed, Aug 5, 2015 at 7:56 PM, Brian Candler b.candler@pobox.com wrote:

On 05/08/2015 23:33, Guilherme Monteiro wrote:

I have added "export
PYTHONPATH=/opt/zato/2.0.5/code/eggs/pyzmq-2.2.0.1-py2.7-linux-x86_64.egg/"
to /opt/zato/.bashrc in order to use zmq in the python zato uses

Just FYI, you can simply do
/opt/zato/2.0.5/bin/py <script.py>
and the script will be run with all the zato-provided libraries available
to be imported.

Regards,

Brian.