이 콘텐츠는 선택한 언어로 제공되지 않습니다.

4.10.6. Subscribe to a Headers Exchange


Changes
  • Updated April 2013.
  • Updated July 2013.
The following code creates a queue match-q, and subscribes it to the amq.match exchange using a binding key that matches messages that have a header key header1 with a value of value1:
AMQP 0-10

Python
rxheaders = ssn.receiver("match-q;{create: always, node: {type: queue}, link:{x-bindings:[{key: 'binding-name', exchange: 'amq.match', queue: 'match-q', arguments:{'x-match': 'any', 'header1': 'value1'}}]}}")
Copy to Clipboard Toggle word wrap

AMQP 1.0

C++
Receiver rxheaders = ssn.createReceiver("amq.match; {link: {name:match-q, filter:{value:{'x-match': 'any', 'header1': 'value1'}, name: headers, descriptor:'apache.org:legacy-amqp-headers-binding:map'}}}");
Copy to Clipboard Toggle word wrap

The x-match argument can take the values any, which matches messages with any of the key value pairs in the binding, or all, which matches messages that have all the key value pairs from the binding key in their header.
Note that you cannot match against multiple values for the same header. You can use multiple headers with different values, but only one value can be matched against a particular header.
AMQP 1.0 does not support link-scoped x-binding, and so a filter is used.
AMQP 0-10 uses a link-scoped x-binding. Note the x-bindings argument key. This argument creates a named handle for the binding, which is visible when running qpid-config exchanges -r. Without a handle, a binding cannot be deleted by name. A null key is valid, but in addition to not being able to be deleted by name, when a binding is created with a null handle, any further attempt to create a binding with a null handle on that exchange will be update the existing binding rather than create a new one.
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat