[ 
https://issues.apache.org/jira/browse/AMQ-9483?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17937949#comment-17937949
 ] 

Matthew Washburn commented on AMQ-9483:
---------------------------------------

[~mattrpav] I'm just trying to make daemon clients exit  when they are supposed 
to and non-daemon clients not exit during broker failover. Which executor are 
you referring to? If ActiveMQMessageConsumer:811, the current state is this 
thread pool will inherit the daemon property of the thread creating the JMS 
connection rather than respecting the daemon property of the connection. 
Because the core size is set to 1 it will not allow the JVM to exit if the 
connection is created on a non-daemon thread. I would be fine changing this to 
remain a single threaded executor service that respects the daemon config of 
the connection, but I thought it would be better to ensure any message that 
have been processed get acked before the JVM exits, hence forcing it to be 
non-daemon but only keeping it alive 5 seconds without work.  


As far as unit tests, 796 patch breaks some. 
boolean daemon = Boolean.parseBoolean((String) 
nestedExtraQueryOptions.get("daemon"));
Is there a better way to detect if the connection should be daemon? If you are 
good with this approach I will update the unit tests. 
 
thx for looking into this!

> Non Daemon Connection Keeping JVM alive when combined with 
> optimizedAckScheduledAckInterval
> -------------------------------------------------------------------------------------------
>
>                 Key: AMQ-9483
>                 URL: https://issues.apache.org/jira/browse/AMQ-9483
>             Project: ActiveMQ Classic
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.18.4
>            Reporter: Matthew Washburn
>            Assignee: Matt Pavlovich
>            Priority: Major
>             Fix For: 6.2.0, 5.19.1, 5.18.8
>
>         Attachments: 
> 0001-make-sure-the-executor-service-for-deliveryingAcknow.patch, 796.patch
>
>
> The thread used to send ack unacked messages when using the 
> optimizedAckScheduledAckInterval is not daemon even if the connection is set 
> to daemon. This is probably advantageous as you would not want a queue or 
> durable topic consumer to shutdown before it has finished acking a message 
> causing it to be redelivered on restart. On the other hand, it means that if 
> the optimized ack scheduler ever kicks in on a daemon connection the JVM will 
> never exit. Also the thread isn't uniquely named so it's hard to track down.
>  
> I'm not sure how to get in the situation where there are unacked messages 
> that are acked by the timer so I'm not sure how to create a simple repo 
> script but the attached patch fixes my application. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to