I tracked this behavior down to ARTEMIS-3525 [1]. On start the broker will
explicitly delete empty queues that are to be auto-deleted.

That said, if auto-creation is enabled and you're using a protocol where
auto-creation is supported then the queue should be re-created when a
message is sent to it or a consumer is created on it.

Is there a particular reason that you don't want to delete queues
immediately after failover when the queue auto-delete flag is set to true?
Have you considered setting the auto-delete flag to false so that this
doesn't happen?


Justin

[1] https://issues.apache.org/jira/browse/ARTEMIS-3525

On Wed, Oct 22, 2025 at 8:10 PM Illia <[email protected]> wrote:

> Hi Justin.
> I have prepared a Java app for you. The link -
> https://drive.google.com/file/d/1aLExH0nWTtWvdjFTw6KJIdid5wTXlJ9J/view?usp=sharing
> Steps to reproduce the issue:
> 1. Build Java app with *./mvnw clean package*
> 2. Start docker compose *docker compose up* which will start java client
> and 2 artemis nodes in replication mode (active and backup).
> 3. After the application is started, an address with the name
> "new-address" and a queue with the name "new-queue" are created.
> 4. Stop active node with *docker stop artemis-node-a*
> 5. Go to *http://localhost:8162/console/artemis
> <http://localhost:8162/console/artemis> *where you can observe that
> address was replicated and queue was not
> [image: image.png]
> [image: image.png]
>
> 6. The reason is that my queue is configured with autodelete:
> [image: image.png]
> 7. If you remove autoDelete and autoDeleteDeley lines and repeat
> everything from the beginning, you will notice that both address and queue
> are successfully replicated.
>
> My goal is to not delete queues immediately after failover when the queue
> auto delete flag is set to true. Is it even possible?
>
> Thanks! Best regards.
>
> ср, 22 окт. 2025 г. в 06:07, Justin Bertram <[email protected]>:
>
>> Nothing in the address-settings seems problematic. Can you work up some
>> instructions or ideally an automated reproducer so that I can observe the
>> same behavior that you described?
>>
>>
>> Justin
>>
>> On Tue, Oct 21, 2025 at 4:52 PM Illia <[email protected]> wrote:
>>
>> > Hi Justin.
>> > This my settings in broker.xml:
>> >
>> > <address-setting match="#">
>> >     <dead-letter-address>DLQ</dead-letter-address>
>> >     <expiry-address>ExpiryQueue</expiry-address>
>> >     <redelivery-delay>0</redelivery-delay>
>> >
>> >
>> >
>> <message-counter-history-day-limit>10</message-counter-history-day-limit>
>> >     <address-full-policy>PAGE</address-full-policy>
>> >     <auto-create-queues>true</auto-create-queues>
>> >     <auto-create-addresses>true</auto-create-addresses>
>> >     <auto-delete-queues>false</auto-delete-queues>
>> >     <auto-delete-addresses>false</auto-delete-addresses>
>> >
>> >     <!-- The size of each page file -->
>> >     <page-size-bytes>10M</page-size-bytes>
>> >
>> >     <!-- When we start applying the address-full-policy, e.g paging -->
>> >     <!-- Both are disabled by default, which means we will use the
>> > global-max-size/global-max-messages  -->
>> >     <max-size-bytes>-1</max-size-bytes>
>> >     <max-size-messages>-1</max-size-messages>
>> >
>> >     <!-- When we read from paging into queues (memory) -->
>> >
>> >     <max-read-page-messages>-1</max-read-page-messages>
>> >     <max-read-page-bytes>20M</max-read-page-bytes>
>> >
>> >     <!-- Limit on paging capacity before starting to throw errors -->
>> >
>> >     <page-limit-bytes>-1</page-limit-bytes>
>> >     <page-limit-messages>-1</page-limit-messages>
>> > </address-setting>
>> >
>> >
>> > ср, 22 окт. 2025 г. в 00:15, Justin Bertram <[email protected]>:
>> >
>> > > Can you provide the address settings that correspond to this queue?
>> > >
>> > > For what it's worth, setting the auto-delete message-count on the
>> queue
>> > to
>> > > -1 is not normal as that means the broker will delete the queue
>> > regardless
>> > > of the number of messages it contains. It might make sense depending
>> on
>> > > your use-case, but folks typically don't want to delete their messages
>> > > automatically.
>> > >
>> > >
>> > > Justin
>> > >
>> > > On Tue, Oct 21, 2025 at 3:28 PM Illia <[email protected]>
>> wrote:
>> > >
>> > > > Hi team. Could you please help me with the next issue.
>> > > >
>> > > > My cluster consists of two nodes with replication mode (live and
>> > backup)
>> > > > that are configured to auto delete queues.
>> > > >
>> > > > When my active node fails, I see that only addresses are replicated
>> to
>> > > the
>> > > > backup node but not queues. Seems that the reason is that my queues
>> are
>> > > > configured for auto delete. Queue replication works fine without the
>> > auto
>> > > > delete flag. I tried to set up an auto delete delay but it seems
>> that
>> > it
>> > > > still doesn’t work with failover.
>> > > >
>> > > > My goal is to not delete queues immediately after failover when the
>> > queue
>> > > > auto delete flag is set to true.
>> > > >
>> > > > Is there any way to do this?
>> > > >
>> > > > Here is my queue configuration in Java code:
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > > *final QueueConfiguration queueConfig =
>> > > >
>> > > >
>> > >
>> >
>> QueueConfiguration.of(queueName).setAddress(addressName).setRoutingType(RoutingType.ANYCAST).setAutoDelete(true).setAutoDeleteDelay(30000L).setAutoDeleteMessageCount(-1L).setPurgeOnNoConsumers(false).setNonDestructive(false);*
>> > > >
>> > > > Thanks! Best regards.
>> > > >
>> > >
>> >
>>
>

Reply via email to