在Websphere自由映像中部署资源适配器和应用程序

时间:2020-04-27 17:59:28

标签: docker websphere-liberty

我需要创建一个Spring Boot应用程序,并通过dtpraUnisys JCA适配器将其连接到EIS。流量是

应用-> ADapter RAR-> EIS

我想使用Websphere自由映像,然后将rar和应用程序jar文件捆绑在一起

我应该在哪里提供rar文件的位置,应用程序jar文件的详细信息。

有没有可以基于docker image引用的示例

1 个答案:

答案 0 :(得分:1)

我对官方没有任何了解,但是我确实通过IBM MQ on my Github经历了类似的事情(但是使用Java EE而不是Spring Boot)。

基本思想是,对于Open Liberty,通常将资源适配器和其他共享适配器放置在/ opt / ol / wlp / usr / shared / resources /中,对于WebSphere Liberty,则将其放置在/ opt / ibm / wlp / usr / shared / resources中。我在Dockerfile中做到这一点:

RUN mkdir /opt/ol/wlp/usr/shared/resources/wmq/ && chown -R 1001:0 /opt/ol/wlp/usr/shared/resources/wmq/
COPY --chown=1001:0 docker/wmq.jmsra.rar /opt/ol/wlp/usr/shared/resources/wmq/

然后使用shared.resource.dir变量在server.xml中引用它们:

<resourceAdapter id="mqJmsRa" location="${shared.resource.dir}/wmq/wmq.jmsra.rar">
   <classloader apiTypeVisibility="spec, ibm-api, api, third-party"/>
</resourceAdapter>

从那里,您可能必须创建一些配置项。我不确定EIS需要什么,但是完整的server.xml语法已记录在on the Open Liberty website中(这也适用于WebSphere Liberty),因此您可以找到所需的内容。通常,您需要引用资源适配器以使用properties.<adaptorName>元素在其上设置属性。

这适用于Liberty上的任何类型的应用程序。部署spring boot应用程序可能需要一些额外的步骤。有一个很好的指南,可以在Docker on the Open Liberty guides site的Liberty上部署spring boot应用程序。