Channel Bindings
A binding maps a messagebus URI to a channel name.
A binding names a messagebus URI and the channel that receives it. The Servit subscribes to that channel in service.xml.
What a binding matches
| Piece | File | Example |
|---|---|---|
| Endpoint | contexts/messagebus/endpoints | endpoint1 on exchange kiosk.payment |
| URI | deploy.xml source or dest | messagebus://endpoint1/com/kiosk/${param:kiosk_id}/... |
| Channel | service.xml and deploy channel-name | payment-requested |
| Parameters | channel message-param | kiosk_id, payment_id, order_id |
<inbound group="checkout"
source="messagebus://endpoint1/com/kiosk/${param:kiosk_id}/payment/${param:payment_id}/requested">
<channel-name>payment-requested</channel-name>
</inbound>
<outbound dest="messagebus://endpoint1/com/kiosk/${param:kiosk_id}/payment/${param:payment_id}/accepted">
<channel-name>payment-accepted</channel-name>
</outbound>
Change a binding
- Add
<inbound>and<outbound>inconfig/services/<node>/deploy/<service>.xml. - Use the same
<channel-name>on the Servit inservice.xml. - Put every
${param:name}value on the message beforepublish. - Replace the deploy file and start the node again with
bin/launch.sh.