Is that possible one web client block connecting 2 different middleware block?

Hi team,

For example, a user management system, we deploy one middleware block for companyA and another one for CompanyB. Now, i want to have a web client block(vaddin generic UI), user could select to connect companyA instance or B instance.

Is there a simplest way to achieve this? like change cuba.connectionUrlList dynamically by code?

thank you

Hi,

There is StaticServerSelector bean defined in CUBA web module with cuba_ServerSelector id, see https://github.com/cuba-platform/cuba/blob/05615301bfdfa430f0d1e8b832262acde2481c77/modules/web/src/com/haulmont/cuba/web-spring.xml#L84

You can provide your own ServerSelector in your project, see for example how it is done in CUBA ZooKeeper integration add-on: https://github.com/cuba-platform/cuba-zk/blob/master/modules/global/src/com/haulmont/addon/zookeeper/discovery/ZkServerSelector.java

Regards,
Konstantin