Options to communicate between WARs in the same EAR

后端 未结 4 499
南方客
南方客 2021-01-12 22:41

What options do you have to communicate between the WARs in an EAR? We have several WARs providing different webservices deployed within one EAR. For their tasks they need

4条回答
  •  粉色の甜心
    2021-01-12 22:55

    Since your edit seems to imply that the communications are not actually required between WARS, but both need to access the same shared resources. The simplest solution would be to put the jars for this resource in the EAR and add the dependency for those jars to both web projects so they are using the shared resource.

    If there is stateful code in both web projects that need to be updated, then your only option is to make a call to the servlet for the web project (assuming the stateful code is contained within the web project).

    Just remember that the shared resource must be threadsafe.

    Similar question here.

提交回复
热议问题