java - 用于切换不同连接的 Jboss wildfly 21/Jboss EAP 7.3 配置
问题描述
我要求客户可以拥有 2 个 Jboss 集群(SYSTEM1、SYSTEM2)。每个集群可以包含 2 个 Jboss EAP 7.3 实例。系统 1 节点 1,节点 2 系统 2 节点 3,节点 4
我的客户进行远程查找以连接远程 Jboss 实例。当 UI 启动时,系统组合框会显示给用户以选择系统。如果用户选择 SYSTEM1,客户端对 Node1、Node2 进行 ejb 调用。如果用户选择 SYSTEM2,客户端对 Node3、Node4 进行 ejb 调用。我能够通过 jboss-ejb-client.properties 提供此功能。
customer.system.names=PROD,QUALITY
remote.clusters=ejb
remote.cluster.ejb.clusternode.selector=com.client.NodeSelector
remote.cluster.ejb.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.cluster.ejb.connect.options.org.xnio.Options.SSL_ENABLED=false
remote.cluster.ejb.username=test
remote.cluster.ejb.password=password
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=PROD1,PROD2
remote.connection.PROD1.host=localhost
remote.connection.PROD1.port = 8080
remote.connection.PROD1.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.connection.PROD2.host=localhost
remote.connection.PROD2.port = 8180
remote.connection.PROD2.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.connection.QUALITY1.host=localhost
remote.connection.QUALITY1.port = 8280
remote.connection.QUALITY1.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.connection.QUALITY2.host=localhost
remote.connection.QUALITY2.port = 8380
remote.connection.QUALITY2.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
根据用户选择,我正在设置连接正确系统的属性
EJBClientConfiguration cc = new PropertiesBasedEJBClientConfiguration(prop);
ContextSelector<EJBClientContext> selector = new ConfigBasedEJBClientContextSelector(cc);
EJBClientContext.setSelector(selector)
现在这个逻辑不适用于 Jboss EAP7.3。Wildfy Config 是为 ejb 客户端处理而实现的。但是我找不到一种方法来为新的 Jboss 版本提供相同的功能。它不提供聚类功能
解决方案
推荐阅读
- excel - 在 Excel 中过滤和发送电子邮件
- javascript - 如何将 DOM 元素移动到 React 中的单独组件中?
- video-streaming - gst-rtspserver 不能同时流式传输超过 3 个流,最大会话问题?
- sql - Bigquery SQL如何更新行和插入新数据
- html - 使用输入滑块更改图像的不透明度。jQuery
- node.js - Express.js - 将数据插入数据库后如何重新加载页面
- android - Socket.Close() 不返回
- python - 如何在 Linux 中找到 USB 设备端口?
- angular - 试图在 Angular 中导出到 Pdf 文件?
- typescript - 如何确保 window.onerror 触发所有错误?