ARTEMIS-3164 Support prefix to create temporary resources - #6591
ARTEMIS-3164 Support prefix to create temporary resources#6591anmol-saxena-14 wants to merge 1 commit into
Conversation
|
Link to earlier PR which got closed : #6378 |
|
There's a few issue with this PR at the moment:
|
4f57bf3 to
1462dea
Compare
Add temporaryAnycastPrefix/temporaryMulticastPrefix, mirroring the existing anycastPrefix/multicastPrefix. Implemented at the core session level so it works for all protocols (Core, AMQP, OpenWire, MQTT, STOMP), not just STOMP. Also fixes STOMP stripping the temp prefix before checking it, and a cleanup bug where prefixed temporary addresses weren't deleted on disconnect. Tested with new TemporaryPrefixTest and StompTemporaryPrefixTest, plus full StompTest/StompV12Test, CoreClientTest, AmqpDurableReceiverReconnectWithMulticastPrefixTest, ServerSessionImplTest, HangConsumerTest, OrphanedConsumerDefenseTest.
1462dea to
38d1b14
Compare
|
Adds temporaryAnycastPrefix/temporaryMulticastPrefix, matching how anycastPrefix/multicastPrefix already work. Any address/queue created under one of these prefixes is marked temporary and cleaned up when the connection closes. Implemented at the core session level, so it works for every protocol (Core, AMQP, OpenWire, MQTT, STOMP) instead of being STOMP-only. Main use case is STOMP clients migrating from ActiveMQ 5.x's hard-coded /temp-queue/ and /temp-topic/ prefixes. Example: Also fixes two bugs:
Verified with: TemporaryPrefixTest(new), StompTemporaryPrefixTest(new), full StompTest/StompV12Test, CoreClientTest, AmqpDurableReceiverReconnectWithMulticastPrefixTest, ServerSessionImplTest, HangConsumerTest, OrphanedConsumerDefenseTest |
|
@jbertram I have addressed the PR review comment, Please review. Thanks |
The broker already lets anycastPrefix/multicastPrefix control routing type for auto-created addresses and queues. This PR adds the same idea for lifecycle: temporaryAnycastPrefix/temporaryMulticastPrefix mark a matching address/queue as temporary, so it's deleted automatically when the connection that created it disconnects.
tcp://0.0.0.0:61616?protocols=STOMP;temporaryAnycastPrefix=/temp-queue/;temporaryMulticastPrefix=/temp-topic/
It's a core session feature (ServerSession), not STOMP-specific, so Core, AMQP, OpenWire, MQTT and STOMP all get it the same way. The motivating case is STOMP clients moving off ActiveMQ 5.x's hard-coded /temp-queue//temp-topic/ prefixes, but any protocol can use it.
Along the way this also fixes STOMP losing the temporary signal by stripping the prefix too early, and a disconnect-cleanup bug that could leave orphaned temporary addresses behind.
Covered by two new tests (TemporaryPrefixTest, StompTemporaryPrefixTest) plus regression across StompTest/StompV12Test, CoreClientTest, AmqpDurableReceiverReconnectWithMulticastPrefixTest, ServerSessionImplTest, HangConsumerTest and OrphanedConsumerDefenseTest.