Thursday 8 September 2016

EMS BRIDGES


What are Bridges:

Bridge as the name suggests will bridge the messages from one queue/topic to other queue/topic.
So bridge will just route the message within the ems server. We can make use of message selectors if we want to use some selection criteria. For example I received message on queue "CitizenInfo.q" and i want to send messages whose age<20 to "teen.q" and whose age>20 to "adult.q" then i will just use the message selector as age and use it while creating the bridge.

Syntax:

create bridge source=<queue/topic>:<queue/topic name> target=<queue/topic>:<queue/topic name> selector=<selection criteria>

Example:

By taking the above example:

Creating bridge:
create bridge source=queue:CitizenInfo.q  target=queue:teen.q selector="age<20"
create bridge source=queue:CitizenInfo.q  target=queue:adult.q selector="age>20"

Browsing bridge:
show bridge source=queue:CitizenInfo.q
or show bridges

Deleting bridge:
No need for specify selector while deleting

delete bridge source=queue:CitizenInfo.q  target=queue:teen.q
.
Note : If you want to update any bridge, you got to recreate