activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timothy Bish (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AMQ-4779) MessageConsumer.receive() should not throw JMSException if the current thread is interrupted
Date Thu, 31 Oct 2013 15:33:21 GMT

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

Timothy Bish commented on AMQ-4779:
-----------------------------------

I don't see anything in the spec that defines the correct behavior in this case.  You are
welcome to create a unit tests and even better provide a patch that provides some improvements
to the code.  

> MessageConsumer.receive() should not throw JMSException if the current thread is interrupted
> --------------------------------------------------------------------------------------------
>
>                 Key: AMQ-4779
>                 URL: https://issues.apache.org/jira/browse/AMQ-4779
>             Project: ActiveMQ
>          Issue Type: Improvement
>    Affects Versions: 5.8.0
>            Reporter: Christian Schlichtherle
>            Priority: Minor
>
> As a workaround with an issue in Open MQ 5.0 (see https://java.net/jira/browse/GLASSFISH-20836
), I have to interrupt the thread which runs {{MessageConsumer.receive()}}). Now when running
the workaround on ActiveMQ 5.8.0, I get a {{JMSException}} with a wrapped {{InterruptedException}}
as a response.
> I'm not sure this is the correct response. Interrupting a thread is more like saying
"Hey, watch your state" rather than saying "I want you to terminate". In that particular use
case, I am concurrently calling {{Connection.close()}} and I would prefer {{MessageConsumer.receive()}}
to simply pay attention to that, which it does when not interrupting the thread.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message