Announcement Announcement Module
Collapse
No announcement yet.
HeadersExchangeParser argumets support? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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>

    Comment


    • #3
      Does it work for match-x all?

      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

      Comment


      • #4
        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)

        Comment


        • #5
          Thank you.

          Comment

          Working...
          X