8.16. Channel Fail-Over
The HelloWorld Service can listen to multiple protocols. Here we have added a JMS channel:
... <service category="FirstServiceESB" name="SimpleListener" description="Hello World"> <listeners> <jms-listener name="helloWorld" busidref="quickstartEsbChannel" maxThreads="1"/> <jms-listener name="helloWorld2" busidref="quickstartFtpChannel2" maxThreads="1"/> </listeners> ...
The service is simultaneously listening to two JMS queues which can be provided by JMS providers on different physical boxes. This makes a JMS connection between two services redundant. You can also mix protocols in this configuration. For instance, this code show how to add an FTP listener.
... <service category="FirstServiceESB" name="SimpleListener" description="Hello World"> <listeners> <jms-listener name="helloWorld" busidref="quickstartEsbChannel" maxThreads="1"/> <jms-listener name="helloWorld2" busidref="quickstartJmsChannel2" maxThreads="1"/> <ftp-listener name="helloWorld3" busidref="quickstartFtpChannel3" maxThreads="1"/> <ftp-listener name="helloWorld4" busidref="quickstartFtpChannel3" maxThreads="1"/> </listeners> ...
Note
When the ServiceInvoker tries to deliver a message to the Service it will get a choice of eight end-point references (four EPRs from Node1 and four EPRs from Node2). To define which one will be used, configure a load-balancing policy.