Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Sending messages

There is a PULL REP socket waiting to receive message and inject them directly in the message bus. You can send message to the event bus by using a ZMQ PUSH socket REQsocket like this:

Code Block
languagepy
 #!/usr/bin/env python
import zmq
import time
d = {'signal': 'my-signal'"bonjour", "sender": u"externalpoipoi", "data": "Hellohello Worldworld!"}

context = zmq.Context()
publisher = context.socket(zmq.PUSHREQ)
publisher.connect("tcp://localhost:60000")
count = 0
while True:
    count += 1
    publisher.send_json(d)
    message = publisher.recv_json()
    print "message {0} ".format(count),message
    time.sleep(2)

Related Issue : 

Jira Legacy
serverJIRA (openwsn.atlassian.net)
serverId86fa4a0d-9af7-33cf-98fd-d8943a0dd0b4
keySW-263