Pergunta

This scenario seems pretty ordinary, and yet, strangely, messaging systems (like Google Cloud PubSub and Task Queues and ActiveMQ) do not seem to support it -- they assume that topics/queues are long-lived.

  • A frontend webapp server sends a request to a backend server.
  • The backend server replies to this request with "expect to receive the messages on channel X" (The terminology in the async messaging system might be "queue" or "topic" rather than "channel".)
  • The backend server pumps out results onto X every few seconds for about 2 minutes.
  • The frontend server polls channel X to get these results.

So, the channel needs to exist for just the 2 minutes.

Am I misunderstanding how to do this? What is the right design approach?

Foi útil?

Solução

ActiveMQ does support this and it's a general feature of JMS. Here's a link pointing to a way of doing this.

I can't find the specific documentation at the moment but my recollection is that you can set up general queue configurations using wildcards like FOO.* Then you can write to FOO.BAR and ActiveMQ will create it. It will exist as long as there are unread messages on it. Once it is empty it will disappear after a timeout passes.

Licenciado em: CC-BY-SA com atribuição
scroll top