简体   繁体   English

Rabbitmq的Consumer和Producer可以作为单个Web应用程序部署在tomcat上吗?

[英]Can Consumer and Producer for rabbitmq be deployed as a single web application on tomcat?

I am using java as back end and wants to integrate rabbitmq for scalability. 我使用Java作为后端,并希望集成Rabbitmq以实现可伸缩性。

My aim here is that . 我的目的是。

I have (web application 1)server 1 which will push some message in rabbitmq(ie act as a producer). 我有(Web应用程序1)服务器1,它将在Rabbitmq中推送一些消息(即充当生产者)。

Then i will have some other application 2 deployed on same tomcat that will consume the messages and 然后,我将在同一tomcat上部署一些其他应用程序2,这将消耗消息并

In some cases the consumer itself will have to produce messages to another queue and server 1 again will consume those messages from another queue(server 1 acting as a consumer). 在某些情况下,使用者本身将不得不向另一个队列生成消息,而服务器1将再次从另一个队列(服务器1充当使用者)中使用那些消息。

So here Server 1 is acting both as a consumer and a producer. 因此,这里的服务器1既充当消费者又充当生产者。

Is this possible? 这可能吗?

The simple answer; 简单的答案; yes. 是。 The longer answer; 更长的答案; still yes. 仍然是。

You might not get to reach its full potential, but if your throughput is not that demanding, then you can use this setup. 您可能无法充分发挥其潜能,但是如果您的吞吐量不那么苛刻,则可以使用此设置。

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

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