activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Davies (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (AMQ-1698) AMQ Threads prevent clean jvm termination
Date Wed, 30 Apr 2008 06:48:43 GMT

     [ https://issues.apache.org/activemq/browse/AMQ-1698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Rob Davies resolved AMQ-1698.
-----------------------------

    Fix Version/s: 5.2.0
       Resolution: Fixed

Fixed by SVN revision 652303

> AMQ Threads prevent clean jvm termination
> -----------------------------------------
>
>                 Key: AMQ-1698
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1698
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.0.0
>         Environment: Any
>            Reporter: Dominic Tulley
>            Assignee: Rob Davies
>             Fix For: 5.2.0
>
>
> A java process using the AMQ client and connecting to a broker will end up with a couple
of threads running called "InactivityMonitor WriteCheck" and "InactivityMonitor ReadCheck".
> When the main jvm thread finishes and the jvm tries to exit, these two threads have not
stopped running and, because they are not daemon threads, the jvm is not able to exit.  The
process ends up hanging - mostly shut down but not quite.
> This is easily reproduced with the most trivial of messaging code (See below) which will
not terminate.
> Changing the creation of these two threads (which arise from the instantiation of Timers
really) to make them daemons resolves the problem.
> Sample Code
> -------------------
> public static void main(String [] args)
> {
>    ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("","","tcp://localhost:61616");
>    Connection connection = connectionFactory.createConnection();
>    connection.start();
>    // Create the session
>    Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
>    Destination destination = session.createQueue("TEST_QUEUE");
>    // Create the producer.
>    MessageProducer producer = session.createProducer(destination);
>    producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
>    TextMessage message = session.createTextMessage("Hello");
>    producer.send(message);
>           
>    producer.close();
>    session.close();
>    connection.close();
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message