Skip to content

Fixing xml configuration for routing-keys #451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 21, 2017

Conversation

mateuszsip
Copy link
Contributor

This is a follow-up to #210.

Currently setting multiple routing keys using xml configuration:

<queue-options>
    <name>test-queue</name>
    <routing-keys>
        <routing-key>foo</routing-key>
        <routing-key>bar</routing-key>
    </routing-keys>
</queue-options>

Ends with:

[Symfony\Component\Config\Definition\Exception\InvalidTypeException]                                                                                   
  Invalid type for path "old_sound_rabbit_mq.consumers.test_consumer.queue_options.routing_keys.routing_key". Expected scalar, but got array. 

But works for single routing key, that is confusing:

<queue-options>
    <name>test-queue</name>
    <routing-keys>
        <routing-key>foo</routing-key>
    </routing-keys>
</queue-options>

There is a solution mentioned in #197

<queue-options>
    <name>test-queue</name>
    <routing-keys>
        foo
    </routing-keys>
    <routing-keys>
        bar
    </routing-keys>
</queue-options>

But it would be nice to use the same valid way that #210 introduced for routing keys.

After merge, configuration like this:

<queue-options>
    <name>test-queue</name>
    <routing-key>foo</routing-key>
    <routing-key>bar</routing-key>
</queue-options>

Is valid and works as expected.

@stloyd stloyd merged commit d4d7226 into php-amqplib:master Jun 21, 2017
@stloyd
Copy link
Collaborator

stloyd commented Jun 21, 2017

Thanks @kejwmen !

@aosmialowski
Copy link

@stloyd can we have a tag, please? For our team, fixing this issue is quite crucial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants