I do not know the existing widely available implementations, but if you allow me, I would suggest a very simple general implementation using a proxy , where:
- manufacturers write to the proxy / topic queue
- the proxy is redirected to the initial queue / topic until the proxy server reads the barrier message , after which:
- the proxy server can notify subscribers of barriers to forward the barrier message to the original subject or
- The proxy server can notify subscribers of the barrier queue :
- periodically publish barrier messages until the barrier is cleared; this does not guarantee that all consumers will receive exactly one notification, although all will eventually clear the barrier (some of them can receive 0 notifications, others> 1 notifications - all depending on the type of scheduler used to distribute messages to consumers, for example, roundrobin )
- using the dedicated section to notify each consumer exactly once per barrier
- the proxy stops the redirection of any messages from the proxy queue until the barrier is cleared, that is, until the original queue is empty and / or all consumers confirm all messages in the queue / subject (if any) leading to a barrier
- proxy resumes forwarding
UPDATE
Thanking Miklos for the fact that in JMS the structure does not provide confirmation for asynchronous deliveries (what is called "confirmations" in JMS is a purely consumer concept and is not a proxy server as such).
So, under JMS , an existing implementation (which will be adapted for barriers) may already provide application-level confirmations through a "confirmation queue" (as opposed to the original queue - which will be a "request queue".) Consumers would have to acknowledge the execution of requests by sending messages confirmations to the proxy confirmation queue; the proxy server will use confirmation messages to track when the barrier has been cleared after it also redirected confirmation messages to the manufacturer.
If the existing implementation (which will be adapted for barriers) does not already provide application level confirmation through the "confirmation queue", you can either:
- use
QueueBrowser , , which the:- you are dealing with queueus not events that
- you want to synchronize upon delivery not confirmation of completion, but
- normally synchronize with first delivery, even if the request was actually aborted and needs to be resent (even after the barrier has been cleared.) I think Miklos already indicated this problem from IIRC.
- otherwise , add the confirmation queue consumed by the proxy server and adapt the consumers to write confirmations to it (essentially, the JMS scenario is higher, except that the proxy server should not forward confirmation messages to the producer if your manufacturer does not need functionality.)
source share