简体   繁体   English

Wildfly 上的 MicroProfile LRA - 如何在 WildFly 上运行的客户端应用程序上设置 LRA 协调器主机和端口

[英]MicroProfile LRA on Wildfly - How to setup LRA coordinator host and port on client application runing on WildFly

I have introduced LRA on a MicroProfile application already running on WildFly AS.我已经在已经在 WildFly AS 上运行的 MicroProfile 应用程序上引入了 LRA。

To get the LRA working I have added the following depedency on my application pom.xml为了让 LRA 正常工作,我在我的应用程序 pom.xml 中添加了以下依赖项

<dependency>
    <groupId>org.jboss.narayana.rts</groupId>
    <artifactId>narayana-lra</artifactId>
    <version>5.10.6.Final</version>
</dependency>

and I have created an LRA coordinator running on the same host ad listening on port 8080.并且我已经创建了一个 LRA 协调器,该协调器在同一主机上运行并侦听端口 8080。

The application works as expected.该应用程序按预期工作。

Now I want to move LRA coordinator on a remote host, but I'm not able to configure my application to point to it (on new host and port).现在我想在远程主机上移动 LRA 协调器,但我无法将我的应用程序配置为指向它(在新主机和端口上)。

I have tried to put in my microprofile-config.properties the following parameters:我试图在我的 microprofile-config.properties 中添加以下参数:

mp.lra.http.host=<new_host>

mp.lra.http.port=<new_port>

but without effect.但没有效果。

Can anyone suggest me hot to configure LRA coordinator host and port on client application?谁能建议我在客户端应用程序上配置 LRA 协调器主机和端口?

Thanks in advance提前致谢

Narayana doesn't support MicroProfile Config yet even if it is something that it probably should. Narayana 尚不支持 MicroProfile Config,即使它可能应该支持。 The properties you want to set are defined only as system properties (ie, read with System.getProperty(String, String) .您要设置的属性仅定义为系统属性(即,使用System.getProperty(String, String)读取。

Another issue is that the properties you are looking for are defined as lra.http.host and lra.http.port respectively.另一个问题是您要查找的属性分别定义为lra.http.hostlra.http.port MP LRA made a deliberate decision to remove all coordinator references from the specification to not specify the implementation architectures (saga can also be implemented as an orchestration pattern). MP LRA 有意决定从规范中删除所有协调器引用,以不指定实现架构(saga 也可以作为编排模式实现)。

So you need to set these system properties for instance when you are starting the WildFly server:因此,您需要在启动 WildFly 服务器时设置这些系统属性:

bin/standalone.sh -Dlra.http.host=lra-coordinator.com -Dlra.http.port=7777

Finally, if you ever move to the latest Narayana releases, these properties were merged only into single property lra.coordinator.url which is however still read only from system properties.最后,如果您移动到最新的 Narayana 版本,这些属性只会合并到单个属性lra.coordinator.url中,但是仍然只能从系统属性中读取。

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

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