RabbitMQ Plugin
  1. RabbitMQ Plugin
  2. GPRABBITMQ-25

Cannot bind queues to fanout exchanges through Config DSL

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.3.3
    • Fix Version/s: 1.0.0
    • Labels:
      None
    • Patch Submitted:
      Yes

      Description

      Config.groovy:

      rabbitmq {
          ...
          queues = {
              exchange name: "incoming-mentions", type: fanout, durable: true, {
                  "incoming-mentions"(durable: true)
              }
          }
      }
      

      This fails:

      IllegalStateException occurred when processing request: ***
      Invalid configuration: 'routingKey' must be non-null.. Stacktrace follows:
      Message: Invalid configuration: 'routingKey' must be non-null.
          Line | Method
      ->> 1503 | <init>    in com.rabbitmq.client.impl.AMQImpl$Queue$Bind
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
      |    668 | queueBind in com.rabbitmq.client.impl.ChannelN
      |     59 | queueBind in     ''
      |     10 | produce   in com.brandseye.pork.HackController
      |    886 | runTask . in java.util.concurrent.ThreadPoolExecutor$Worker
      |    908 | run       in     ''
      ^    680 | run . . . in java.lang.Thread
      

      The fix is a one line change to RabbitQueueBuilder.groovy:

      case FanoutExchange:
          newBinding.rule = ""    // rabbit client API doesn't like a null binding
          ....
      

      I have created a Git pull request.

        Activity

        Hide
        Peter Ledbrook added a comment -

        Add code formatting in issue description to make it easier to read.

        Show
        Peter Ledbrook added a comment - Add code formatting in issue description to make it easier to read.
        Hide
        Peter Ledbrook added a comment -

        Fixed with this commit - thanks for the pull request David!

        Show
        Peter Ledbrook added a comment - Fixed with this commit - thanks for the pull request David!

          People

          • Assignee:
            Jeff Scott Brown
            Reporter:
            David Tinker
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: