Skip to content

Added fixing the xml config for most configuration options #210

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
Nov 21, 2014

Conversation

clairejarvi
Copy link

This allows things to be specified in xml as:

<rabbitmq:consumer>...</rabbitmq:consumer>
<rabbitmq:consumer>...</rabbitmq:consumer>

instead of:

<rabbitmq:consumers>...</rabbitmq:consumers>
<rabbitmq:consumers>...</rabbitmq:consumers>

It appears the the queues option in multiple_consumers might have the same issue but I am unsure how to fix it because fixXmlConfig() doesn't appear to affect it when I tried adding it.

Fixes #197.

@videlalvaro
Copy link
Collaborator

What's the purpose of fixXmlConfig() and what's the advantage of this PR, what is it fixing?

@clairejarvi
Copy link
Author

This fixes the xml config differences according to Symfony's documentation:
http://symfony.com/doc/current/components/config/definition.html#normalization

For single entries:

<rabbitmq:consumers>
    <rabbitmq:consumer key="key" callback="callback">
        <rabbitmq:exchange_options name="name" type="fanout" />
    </rabbitmq:consumer>
</rabbitmq:consumers>

to

<rabbitmq:consumer key="key" callback="callback">
    <rabbitmq:exchange_options name="name" type="fanout" />
</rabbitmq:consumer>

For multiple entries:

<rabbitmq:consumers key="1" callback="callback">
    <rabbitmq:exchange_options name="name" type="fanout" />
</rabbitmq:consumers>
<rabbitmq:consumers key="2" callback="callback">
    <rabbitmq:exchange_options name="name" type="fanout" />
</rabbitmq:consumers>

to

<rabbitmq:consumer key="1" callback="callback">
    <rabbitmq:exchange_options name="name" type="fanout" />
</rabbitmq:consumer>
<rabbitmq:consumer key="2" callback="callback">
    <rabbitmq:exchange_options name="name" type="fanout" />
</rabbitmq:consumer>

@videlalvaro
Copy link
Collaborator

is this backwards compatible?

@clairejarvi
Copy link
Author

fixXmlConfig() adds additional mapping capabilities but doesn't break the current behaviors. It'll end up mapping things in fixXmlConfig() like <consumer> to <consumers> during the tree building.

videlalvaro added a commit that referenced this pull request Nov 21, 2014
Added fixing the xml config for most configuration options
@videlalvaro videlalvaro merged commit d49ead3 into php-amqplib:master Nov 21, 2014
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.

Unable to define multiple producer tags under producers
2 participants