Sha256: cc3c5b4fad43e0b4beccb2c9e6b839fdf59970c70288fadc695950e947d04d8f

Contents?: true

Size: 1.72 KB

Versions: 7

Compression:

Stored size: 1.72 KB

Contents

@bunny
Feature: Binding AMQP destinations to exchanges
  Background:
    Given the following broker configuration
    """ruby
    MessageDriver::Broker.define do |b|
      b.destination :direct_exchange, "amq.direct", type: :exchange
    end
    """

  Scenario: Binding a queue to an exchange
    When I execute the following code
    """ruby
    MessageDriver::Broker.define do |b|
      b.destination :my_queue, "my_bound_queue", exclusive: true, bindings: [
        {source: "amq.direct", args: {routing_key: "test_binding"}},
        {source: "amq.direct", args: {routing_key: "spec_binding"}}
      ]
    end

    publish(:direct_exchange, "Test Message", {}, {routing_key: "test_binding"})
    publish(:direct_exchange, "Spec Message", {}, {routing_key: "spec_binding"})
    """

    Then I expect to find the following 2 messages on :my_queue
      | body         |
      | Test Message |
      | Spec Message |

  Scenario: Binding an exchange to an exchange
    RabbitMQ's AMQP 0.9 extenstions support binding exchanges to exchanges

    When I execute the following code
    """ruby
    MessageDriver::Broker.define do |b|
      b.destination :fanout, "amq.fanout", type: :exchange, bindings: [
        {source: "amq.direct", args: {routing_key: "test_binding"}},
        {source: "amq.direct", args: {routing_key: "spec_binding"}}
      ]
      b.destination :my_queue, "my_bound_queue", exclusive: true, bindings: [{source: "amq.fanout"}]
    end

    publish(:direct_exchange, "Test Message", {}, {routing_key: "test_binding"})
    publish(:direct_exchange, "Spec Message", {}, {routing_key: "spec_binding"})
    """

    Then I expect to find the following 2 messages on :my_queue
      | body         |
      | Test Message |
      | Spec Message |

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
message-driver-0.4.0 features/amqp_specific_features/binding_amqp_destinations.feature
message-driver-0.3.0 features/amqp_specific_features/binding_amqp_destinations.feature
message-driver-0.2.2 features/amqp_specific_features/binding_amqp_destinations.feature
message-driver-0.2.1 features/amqp_specific_features/binding_amqp_destinations.feature
message-driver-0.2.0 features/amqp_specific_features/binding_amqp_destinations.feature
message-driver-0.2.0.rc2 features/amqp_specific_features/binding_amqp_destinations.feature
message-driver-0.2.0.rc1 features/amqp_specific_features/binding_amqp_destinations.feature