PageSourceSearch

https://www.rabbitmq.com/assets/js/53a935b5.5e54f64f.js

js rabbitmq.com collected 2026-09-24 06:07:18 UTC 5,105 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkrabbitmq_website=self.webpackChunkrabbitmq_website||[]).push([["20943"],{93804(e,n,t){t.r(n),t.d(n,{metadata:()=>i,default:()=>l,frontMatter:()=>s,contentTitle:()=>c,toc:()=>r,assets:()=>d});var i=JSON.parse('{"id":"e2e","title":"Exchange to Exchange Bindings","description":"\x3c!--","source":"@site/versioned_docs/version-4.3/e2e.md","sourceDirName":".","slug":"/e2e","permalink":"/docs/e2e","draft":false,"unlisted":false,"editUrl":"https://github.com/rabbitmq/rabbitmq-website/tree/main/versioned_docs/version-4.3/e2e.md","tags":[],"version":"4.3","frontMatter":{"title":"Exchange to Exchange Bindings"},"sidebar":"docsSidebar","previous":{"title":"Blocked Connection Notifications","permalink":"/docs/connection-blocked"},"next":{"title":"Alternate Exchanges","permalink":"/docs/ae"}}'),a=t(74848),o=t(28453);let s={title:"Exchange to Exchange Bindings"},c="Exchange to Exchange Bindings",d={},r=[{value:"Overview",id:"overview",level:2},{value:"Java Client Example",id:"java-example",level:2},{value:".NET Client Example",id:"dotnet-example",level:2}];function h(e){let n={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.header,{children:(0,a.jsx)(n.h1,{id:"exch
1ange-to-exchange-bindings",children:"Exchange to Exchange Bindings"})}),"\n",(0,a.jsx)(n.h2,{id:"overview",children:"Overview"}),"\n",(0,a.jsxs)(n.p,{children:["In ",(0,a.jsx)(n.a,{href:"/tutorials/amqp-concepts",children:"AMQP 0-9-1"})," the ",(0,a.jsx)(n.code,{children:"queue.bind"})," method binds a queue to an\nexchange so that messages flow (subject to various criteria)\nfrom the exchange (the ",(0,a.jsx)("em",{children:"source"}),") to the queue (the\n",(0,a.jsx)("em",{children:"destination"}),"). We have introduced an\n",(0,a.jsx)(n.code,{children:"exchange.bind"})," method which binds one\nexchange to another exchange. The binding is semantically\nidentical to exchange-to-queue bindings: unidirectional,\nbinding keys and exchange types operate as normal, but both\nendpoints (the source and destination) of the binding are\nexchanges. This allows far richer routing topologies to be\ncreated. Note the ",(0,a.jsx)(n.code,{children:"source"})," and\n",(0,a.jsx)(n.code,{children:"destination"})," fields in the\n",(0,a.jsx)(n.code,{children:"exchange.bind"})," method reflect the flow of\nmessages: from the exchange at the source, and to the\nexchange at the destination."]}),"\n",(0,a.jsxs)(n.p,{children:["Just like with ",(0,a.jsx)(n.code,{children:"queue.bind"}),", multiple distinct\nbindings can be created between the same\nbinding-endpoints. We detect and eliminate cycles during\nmessage delivery, and ensure that transitively, over any\nrouting topology, for every queue to which a given message\nis routed, each queue will receive exactly one copy of that\nmessage. Exchanges which are declared as\n",(0,a.jsx)(n.code,{children:"auto-delete"})," will still be removed when all\ntheir bindings are removed, regardless of whether those\nbindings are to queues or exchanges. Note that an\nauto-delete exchange will only be deleted when bindings for\nwhich the exchange is the ",(0,a.jsx)("em",{children:"source"})," are removed: if\nyou add exchange-to-exchange bindings for which the given\nexchange is the ",(0,a.jsx)("em",{children:"destination"})," then that exchange will\nnot be auto-deleted on removal of those bindings."]}),"\n",(0,a.jsx)(n.h2,{id:"java-example",children:"Java Client Example"}),"\n",(0,a.jsxs)(n.p,{children:["Use the ",(0,a.jsx)(n.code,{children:"Channel#exchangeBind"})," method.\nThe following example binds an exchange ",(0,a.jsx)(n.code,{children:'"destination"'}),"\nto ",(0,a.jsx)(n.code,{children:'"source"'})," with routing key ",(0,a.jsx)(n.code,{children:'"routingKey"'}),"."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-java",children:'Channel ch = conn.createChannel();\nch.exchangeBind("destination", "source", "routingKey");\n'})}),"\n",(0,a.jsx)(n.h2,{id:"dotnet-example",children:".NET Client Example"}),"\n",(0,a.jsxs)(n.p,{children:["Use the ",(0,a.jsx)(n.code,{children:"IModel#ExchangeBind"})," method.\nThe following example binds an exchange ",(0,a.jsx)(n.code,{children:'"destination"'}),"\nto ",(0,a.jsx)(n.code,{children:'"source"'})," with routing key ",(0,a.jsx)(n.code,{children:'"routingKey"'}),"."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-csharp",children:'var ch = conn.CreateModel();\nch.ExchangeBind("destination", "source", "routingKey");\n'})})]})}function l(e={}){let{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(h,{...e})}):h(e)}},28453(e,n,t){t.d(n,{R:()=>s,x:()=>c});var i=t(96540);let a={},o=i.createContext(a);function s(e){let n=i.useContext(o);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:s(e.components),i.createElement(o.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.