简体   繁体   English

我应该在一个或两个项目中实施JMS服务器和客户端吗?

[英]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.

相关问题 客户端JMS配置-JMS群集-仅连接到一台服务器 - Client Side JMS Configuration - JMS Cluster - Connets to only one server 客户端 - 服务器代码应该写在一个“项目”还是两个? - Should client-server code be written in one “project” or two? 实施远程JMS服务器 - Implement remote JMS server 我应该在什么级别集成两个服务(客户端与服务器) - At what level should i integrate two services (client vs server) 如何将两个单独的项目(客户端和服务器端)部署到同一Google App Engine项目? - How can i deploy two separate projects (client and server side) to the same Google App Engine project? 我应该在同一个类中实现这两个接口吗? - Should I implement the two interfaces in the same class? 我应该在客户端/服务器应用程序中使用套接字? - Should I use sockets in client/server application? 我应该如何运行服务器/客户端代码? - How should I run a Server/Client Code? 同一服务器上具有不同端口但客户端(Angular 6)上的两个项目无法调用服务器(Spring Boot) - Two projects on same server with different ports but client (Angular 6) can't call server (Spring Boot) 我应该考虑在我的情况下使用JMS吗? - Should I consider to use JMS in my case?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM