简体   繁体   English

WSO2 ESB到Message Broker故障转移

[英]WSO2 ESB to Message Broker failover

I have WSO2ESB cluster (ESB1 and ESB2 workers) and I'm configuring WSO2MB cluster with shared database MSSQL (MB1 and MB2 brokers). 我有WSO2ESB群集(ESB1和ESB2工作人员),并且正在使用共享数据库MSSQL(MB1和MB2代理)配置WSO2MB群集。 ESB servers will write and read messages from the brokers in WSO2MB cluster. ESB服务器将从WSO2MB群集中的代理写入和读取消息。 What I want to achieve is that ESB1 will read/write messages to broker MB1 and ESB2 will read/write messages to broker MB2. 我要实现的是,ESB1将向代理MB1读取/写入消息,而ESB2将向代理MB2读取/写入消息。 In case of failure for example MB2 both ESB servers will read/write messages to MB1. 例如在MB2发生故障的情况下,两个ESB服务器都将向MB1读取/写入消息。 In documentation I only see round-robin version of failure strategy, that means ESB servers will randomly connect to MB brokers. 在文档中,我仅看到轮询策略的循环版本,这意味着ESB服务器将随机连接到MB代理。 There is singlebroker strategy but is that applicable in my situation or I have to implement my own FailoverMethod interface? 有单一经纪人策略,但是该策略适用于我的情况还是我必须实现自己的FailoverMethod接口? I need priority or weight based failover strategy and I only see that in ActiveMQ. 我需要基于优先级或权重的故障转移策略,而我只能在ActiveMQ中看到。 Thnx for any reply. 谢谢。

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. 即使wso2 mb目前没有加权故障转移策略,您也可以尝试通过上述配置实现类似的行为。

As far as I understand in 2 node Broker cluster(in your usecase), prioritising a broker(weighted failover strategy) is not a valid case. 据我了解,在2节点Broker集群中(在您的用例中),对Broker进行优先级排序(加权故障转移策略)不是有效的情况。 For example, if MB1 is down only available option for failover is MB2 and vice-versa. 例如,如果MB1关闭,则故障转移的唯一可用选项是MB2,反之亦然。 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. 如果您不想将ESB1连接到MB2(而MB1不可用),只需从ESB1的“ jndi.properties”文件的代理列表中删除MB2的连接URL。 Further, you need to vary "cycle count","retries","connection delay" in MB1 broker url in order to retry until MB1 is available again. 此外,您需要在MB1代理url中更改“周期数”,“重试”和“连接延迟”,以便重试直到MB1再次可用。 Therefore, this usecase can be achieved easily by "round-robin" strategy. 因此,可以通过“循环”策略轻松实现该用例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM