Skip to content
Snippets Groups Projects

Lofar release 4 0

Merged Jorrit Schaap requested to merge LOFAR-Release-4_0 into master

Merge request reports

Merged by Jorrit SchaapJorrit Schaap 5 years ago (Oct 11, 2019 9:22am UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
282 """
283 does the exchange with the given name exist on the given broker?
284 :param name: the name for the exchange
285 :param broker: a message broker address
286 :return True if it exists, False if not.
287 """
288 try:
289 with kombu.Connection(hostname=broker, port=DEFAULT_PORT, userid=DEFAULT_USER, password=DEFAULT_PASSWORD) as connection:
290 exchange = kombu.Exchange(name, channel=connection)
291 try:
292 exchange.declare(channel=connection.default_channel, passive=True)
293 return True
294 except amqp.exceptions.NotFound:
295 return False
296 except Exception as e:
297 raise MessagingError("Could test if exchange %s exists on broker %s error=%s" % (name, broker, e))
  • Auke Klazema
    Auke Klazema @klazema started a thread on commit 41a94585
  • 351 """
    352 does the queue with the given name exist on the given broker?
    353 :param name: the name for the queue
    354 :param broker: a message broker address
    355 :return True if it exists, False if not.
    356 """
    357 try:
    358 with kombu.Connection(hostname=broker, port=DEFAULT_PORT, userid=DEFAULT_USER, password=DEFAULT_PASSWORD) as connection:
    359 queue = kombu.Queue(name, no_declare=True, channel=connection)
    360 try:
    361 queue.queue_declare(channel=connection.default_channel, passive=True)
    362 return True
    363 except amqp.exceptions.NotFound:
    364 return False
    365 except Exception as e:
    366 raise MessagingError("Could test if queue %s exists on broker %s error=%s" % (name, broker, e))
  • merged

  • Jorrit Schaap mentioned in commit 04287eec

    mentioned in commit 04287eec

  • Please register or sign in to reply
    Loading