0

I have WSO2ESB cluster (ESB1 and ESB2 workers) and I'm configuring WSO2MB cluster with shared database MSSQL (MB1 and MB2 brokers). ESB servers will write and read messages from the brokers in WSO2MB cluster. What I want to achieve is that ESB1 will read/write messages to broker MB1 and ESB2 will read/write messages to broker MB2. In case of failure for example MB2 both ESB servers will read/write messages to MB1. In documentation I only see round-robin version of failure strategy, that means ESB servers will randomly connect to MB brokers. There is singlebroker strategy but is that applicable in my situation or I have to implement my own FailoverMethod interface? I need priority or weight based failover strategy and I only see that in ActiveMQ. Thnx for any reply.

Community
  • 1
  • 1

1 Answers1

0

Round-robin is NOT a random algorithm which connects to brokers. It will prioritise brokers in given order in broker list from first to last. With configurable "cycle count","retries","connection delay" properties you can minimise retries to low priority brokers as well. Even though wso2 mb doesn't have weighted failover strategy at the moment you can try to achieve similar behavior through above configurations.

As far as I understand in 2 node Broker cluster(in your usecase), prioritising a broker(weighted failover strategy) is not a valid case. For example, if MB1 is down only available option for failover is MB2 and vice-versa. IF you do not want to connect ESB1 to MB2 (while MB1 is not available) simply remove MB2's connection url from broker list in "jndi.properties" file of ESB1. Further, you need to vary "cycle count","retries","connection delay" in MB1 broker url in order to retry until MB1 is available again. Therefore, this usecase can be achieved easily by "round-robin" strategy.

plr
  • 511
  • 3
  • 5
  • 15
  • Yes, we analized the source code of the failover interface and it's working as You mentioned. The only question now is - when MB1 is back to life does the failover switch to it after some time? In other words does the connection resets after each transaction and checks the list of brokers again? In my example MB1 is down, so round-robin strategy switches to MB2 and after MB1 is up again we need ESB1 to work with it again. – Michał Grzelak Oct 11 '16 at 07:14