简体   繁体   English

如何防止生产者接收发送到主题的消息?

[英]How can I prevent a producer to receive a message sent to a topic?

I am using ActiveMQ topics. 我正在使用ActiveMQ主题。 My applications create some topics, and create a producer and a consumer on theses topics. 我的应用程序创建了一些主题,并在这些主题上创建了生产者和消费者。

When a producer send something, it will receive back the message because there is also a consumer on this topic in the same topic. 当生产者发送东西时,它将收到消息,因为同一主题中也有该主题的消费者。

There is a topic dedicated for each application (different code, for different computer running it) and there is a main central core process that will join each topic to process messages, and will then reply to the topic where the request message have been posted. 有一个专门用于每个应用程序的主题(不同的代码,用于运行它的不同计算机),并且有一个主要的核心核心流程,它将结合每个主题来处理消息,然后回复已发布请求消息的主题。

Some topics are "general purpose" topics, where some messages won't have a reply, but that many process will take into account. 一些主题是“通用”主题,其中一些消息不会得到答复,但是会考虑很多过程。

Is there something in ActiveMQ that can prevents the producer to receive back what it sends ? ActiveMQ中是否有某些东西可以阻止生产者收回其发送的内容?

Edit : please note that I am quite a newbie with ActiveMQ, I am using it not so long ago, and with very basic settings : no persistence, as simple application bus 编辑:请注意,我是ActiveMQ的新手,不久前就使用它,并且具有非常基本的设置:没有持久性,就像简单的应用程序总线

When you create your consumer you can specify a message selector to exclude messages with your producer's unique ID. 创建消费者时 ,可以指定消息选择器以排除具有生产者唯一ID的消息。 Your producer can set its ID in a message property when creating its messages. 生产者可以在创建消息时在消息属性中设置其ID。

暂无
暂无

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

相关问题 当订阅者在Mqtt主题Java中处于非活动状态时,如何获取生产者发送的所有数据(未保留或最后一条消息) - How to get all the data sent by producer when subscriber is inactive in Mqtt topic Java(not retained or last message) 生产者如何访问消息代理发送的确认? - How producer can access the acknowledgement sent by message broker? 如何确保通过Kinesis Producer库发送的消息得到传递 - How to ensure that sent message with Kinesis Producer Library get delivered 如何为生产者确保 kafka 主题? - How to secure kafka topic for producer? 当生产者停止在 Java/Spring 中发送消息时,我如何在 windowedBy+aggregate 中接收最后一个窗口化的 Kafka 消息? - How I receive the last windowed Kafka message in a windowedBy+aggregate when producer stops to send messages in Java/Spring? 我怎么能阻止LogCat接收所有使我的移动设备? - How I can prevent LogCat receive everything that makes my mobile? 如果最近发送了通知,如何防止再次发送该通知? - How can I prevent a notification from sending again if it was recently sent? 套接字服务器,我没有收到服务器发送的消息 - Socket server, I don't receive the message sent by my Server 卡夫卡制作人。 消息未发送 - Kafka producer. The message is not being sent 如果在生产者之后启动,Kafka 消费者不会读取生产者发送的消息 - Kafka consumer is not reading message sent by producer if started after producer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM