Mailinglist Archive: opensuse-buildservice (88 mails)

< Previous Next >
[opensuse-buildservice] RabbitMQ help
Hi,

I want to move a old notify plugin to the new RabbitMQ implementation.
For this I added an rabbitMQ server on the OBS frontend host (running
OBS 2.9.2). After some trouble with the epmd and rabbitMQ server setup I
finally got it running and could test it with the rabbitMQ tutorials, so
I'm sure that this part is working.

options.yml rabbitMQ stuff:

# Rabbitmq based message bus
#
# Prefix of the message bus rooting key
amqp_namespace: 'opensuse.obs'
#
# Connection options -> http://rubybunny.info/articles/connecting.html
amqp_options:
host: localhost
port: 5672
user: guest
pass: guest
vhost: /
#
# Exchange@options -> http://rubybunny.info/articles/exchanges.html
amqp_exchange_name: pubsub
amqp_exchange_options:
type: :topic
auto_delete: false
arguments:
persistent: true
passive: true
#end of options.yml

Then I used a simple python consumer:

#!/usr/bin/env python
import pika

connection =
pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))
channel = connection.channel()

channel.exchange_declare(exchange='pubsub',
exchange_type='topic')

result = channel.queue_declare(exclusive=True)
queue_name = result.method.queue

channel.queue_bind(exchange='pubsub',
queue=queue_name,
routing_key='opensuse.obs.#')

print(' [*] Waiting for pubsub. To exit press CTRL+C')

def callback(ch, method, properties, body):
print(" [x] %r" % body)

channel.basic_consume(callback,
queue=queue_name,
no_ack=True)

channel.start_consuming()
# end of consumer code

I tried '#' as routing_key as well, but neither did work.
Do I need to config something more as the options.yml ?

Does my code or the configuration be wrong ?
Of course I restarted apache after any change in option.yml.

Thanks
Karsten
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-buildservice+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups