Given such FedMsg Consumer code:
def consume(self, msg):
msg = msg['body']
self.log.info("CVS: Got a message %r" % msg['topic'])
def delayed_consume():
self.log.debug("delayed_consume")
moksha.hub.reactor.reactor.callLater(1.0, delayed_consume)
Then the delayed_consume
is not always called out.
It can be forced to be invoked when another fedmsg message is sent what this consumer listens for.
# Copy the cvs_consumer_config.py into ./fedmsg.d/ directory.
# For production copy to /etc/fedmsg.d directory.
cp my_consumer_config.py fedmsg.d
# Setup your consumer by running
python setup.py develop
# Start the fedmsg-hub (which should pick up your consumer) with:
fedmsg-hub
Start the #development, and then send first message to bus:
echo '{"foo": "bar"}' | fedmsg-logger --json-input
You should see delayed_consume
message in hub logs after 1 second of each
message.
@ralphbean submitted fix: fedora-infra/fedmsg-genacls#9