[英]Should i implement JMS server and client in one or two projects?
I have a test assignment where i need to implement communication between web client and server. 我有一个测试作业,需要在其中实现Web客户端和服务器之间的通信。 WebClient is a simple web application that receives user's requests and then pushes them to ActiveMQ, so Server can handle those requests and push response back to ActiveMQ.
WebClient是一个简单的Web应用程序,它接收用户的请求,然后将其推送到ActiveMQ,因此Server可以处理这些请求并将响应推送回ActiveMQ。
As i am new to JMS, my question is: should i implement client and server in one project, or decouple them? 当我刚接触JMS时,我的问题是:我应该在一个项目中实现客户端和服务器,还是将它们分离?
这取决于您,但在现实世界中,甚至将由两个不同的团队来创建服务器和客户端。
If you imagine a scenario where you have 2 different components interacting, I would implement client and server in two different projects deployed inside 2 different EAR projects. 如果您设想有两个不同的组件交互的场景,那么我将在两个不同的EAR项目中部署的两个不同的项目中实现客户端和服务器。
However in Java Enterprise applications you can use JMS to implement parallelism: you can deploy many consumers and consume concurrently the message produced by the client, achieving parallelism. 但是,在Java Enterprise应用程序中,您可以使用JMS来实现并行性:您可以部署许多使用者并同时使用客户端产生的消息,从而实现并行性。 In this case I think a single project for both client and server it's suitable even in real world applications.
在这种情况下,我认为针对客户端和服务器的单个项目即使在现实世界的应用程序中也是合适的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.