How to get the response delivered to Subscriber back to the Producer

蹲街弑〆低调 提交于 2019-12-31 05:22:07

问题


I have implemented a model using google pubsub where the producer sends in the message and the subscriber processes the message and sends the response to the subscription. But how do I map the response to the publisher which sent the request?

Are there any filters that can be put on the subscription so that the response can be tracked? or is there another way of implementing this?


回答1:


There is no way in Cloud Pub/Sub for the publisher to know that the subscriber processed the message. One of the main goals with the pub/sub paradigm is to separate the publisher from the subscriber and having this kind of dependency tends to break that separation. Once the publish succeeds, then it knows that interested subscribers will receive the message.

If the publisher needs to know that the subscriber completed the processing of the message, then one way to accomplish this is to use a second Pub/Sub topic that sends those messages. The subscriber on the original topic because the publisher and the original publisher becomes the subscriber.



来源:https://stackoverflow.com/questions/48954530/how-to-get-the-response-delivered-to-subscriber-back-to-the-producer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!