Results 1 to 5 of 5

Thread: HeadersExchangeParser argumets support?

  1. #1
    Join Date
    Nov 2012
    Posts
    3

    Default HeadersExchangeParser argumets support?

    Does HeadersExchangeParser support multiple key value pairs?

    Something like
    <rabbit:binding queue="${queueNames}" key="" value="">

    <rabbit:binding-arguments >
    <entry key="match-x"><value type="java.lang.String">any</value></entry>
    <entry key="XYZ0"><value type="java.lang.String">true</value></entry>
    <entry key="XYZ1"><value type="java.lang.String">true</value></entry>
    <entry key="XYZ2"><value type="java.lang.String">true</value></entry>
    </rabbit:binding-arguments>
    </rabbit:binding>


    It does not seem so.
    https://github.com/SpringSource/spri...ngeParser.java

  2. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,036

    Default

    Please use [ code ] ... [ /code ] tags (no spaces in brackets) around code and config.

    Just use a separate binding for each...

    Code:
        <rabbit:headers-exchange name="foo">
        	<rabbit:bindings>
        		<rabbit:binding queue="si.test.queue" key="foo" value="bar" />
        		<rabbit:binding queue="si.test.queue" key="baz" value="qux" />
           	</rabbit:bindings>
        </rabbit:headers-exchange>
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #3
    Join Date
    Nov 2012
    Posts
    3

    Default Does it work for match-x all?

    Quote Originally Posted by Gary Russell View Post
    Please use [ code ] ... [ /code ] tags (no spaces in brackets) around code and config.

    Just use a separate binding for each...

    Code:
        <rabbit:headers-exchange name="foo">
        	<rabbit:bindings>
        		<rabbit:binding queue="si.test.queue" key="foo" value="bar" />
        		<rabbit:binding queue="si.test.queue" key="baz" value="qux" />
           	</rabbit:bindings>
        </rabbit:headers-exchange>
    Thanks - it solves my problem for a while, but
    • Is the result exactly the same (there are 3 rows in the admin console)
    • how to support match-x all?


    Thank you in advance for your answer

  4. #4
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,036

    Default

    Good point - no, the parser doesn't support that; please go ahead and open an 'Improvement' issue: https://jira.springsource.org/browse/AMQP

    In the meantime, you can use <bean/> definitions to achieve what you want...

    Code:
        <rabbit:headers-exchange name="bar" />
        
        <bean class="org.springframework.amqp.rabbit.config.BindingFactoryBean">
        	<property name="exchange" value="bar" />
        	<property name="destinationQueue" ref="si.test.queue" />
        	<property name="arguments">
        		<util:map>
        			<entry key="foo" value="bar" />
        			<entry key="baz" value="qux" />
        			<entry key="x-match" value="all" />
        		</util:map>
        	</property>
        </bean>
    (Note: x-match:all is the default)
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  5. #5
    Join Date
    Nov 2012
    Posts
    3

    Default

    Thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •