Sha256: df97049eb5f69731281ff32f7aa70e6f8dafa76a341dcb9fa9303260add575e7

Contents?: true

Size: 1.75 KB

Versions: 11

Compression:

Stored size: 1.75 KB

Contents

@bunny
@read_queues_directly
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

11 entries across 11 versions & 1 rubygems

Version Path
message-driver-1.0.1 features/amqp_specific_features/binding_amqp_destinations.feature
message-driver-1.0.0 features/amqp_specific_features/binding_amqp_destinations.feature
message-driver-0.7.2 features/amqp_specific_features/binding_amqp_destinations.feature
message-driver-0.7.1 features/amqp_specific_features/binding_amqp_destinations.feature
message-driver-0.7.0 features/amqp_specific_features/binding_amqp_destinations.feature
message-driver-0.6.1 features/amqp_specific_features/binding_amqp_destinations.feature
message-driver-0.6.0 features/amqp_specific_features/binding_amqp_destinations.feature
message-driver-0.5.3 features/amqp_specific_features/binding_amqp_destinations.feature
message-driver-0.5.2 features/amqp_specific_features/binding_amqp_destinations.feature
message-driver-0.5.1 features/amqp_specific_features/binding_amqp_destinations.feature
message-driver-0.5.0 features/amqp_specific_features/binding_amqp_destinations.feature