You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Andrew Kennedy (JIRA)" <ji...@apache.org> on 2011/03/07 17:19:59 UTC

[jira] Issue Comment Edited: (QPID-3109) Java client needs to implement the Delete option in address string

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

Andrew Kennedy edited comment on QPID-3109 at 3/7/11 4:18 PM:
--------------------------------------------------------------

Rajith,

In BasicMessageProducer_0_10#close() you make the assumption that _destination will hold a valid (non-null) destination. This is not always the case, as can be seen from the following code sample (taken from InvalidDestinationTest, which is currently failing in the java.0.10 profile):

sender = queueSession.createSender(null);
// ... try to send to invalid destination first
sender.send(validDestination, msg);
sender.close();

Obviously, the close call will now fail with a NullPointerException. I have not seen any other tests failing because of this, but this is most likely due to lack of coverage, since other methods in this commit assume a non-null _destination field also.

I believe the code sample above to be a valid JMS idiom.

Andrew.

      was (Author: andrew.kennedy):
    Rajith,

In BasicMessageProducer_0_10#close() you make the assumption that _destination will hold a valid (non-null) destination. This is not always the case, as can be seen from the following code sample (taken from InvaliDestinationTest, which is currently failing in the java.0.10 profile):

{code}
sender = queueSession.createSender(null);
// ... try to send to invalid destination first
sender.send(validDestination, msg);
sender.close();
{code}

Obviously, the close call will now fail with a NullPointerException. I have not seen any other tests failing because of this, but this is most likely due to lack of coverage, since other methods in this commit assume a non-null _destination field also.

I believe the code sample above to be a valid JMS idiom.

Andrew.
  
> Java client needs to implement the Delete option in address string
> ------------------------------------------------------------------
>
>                 Key: QPID-3109
>                 URL: https://issues.apache.org/jira/browse/QPID-3109
>             Project: Qpid
>          Issue Type: Improvement
>          Components: Java Client
>    Affects Versions: 0.8
>            Reporter: Rajith Attapattu
>            Assignee: Rajith Attapattu
>            Priority: Minor
>             Fix For: 0.9
>
>
> The address syntax defines a delete option with 4 possible values - {always, receiver, sender, never}.
> The default value is 'never'.
> if delete = 'always' or delete = 'sender', then when a sender is closed it should delete the queue.
> if delete = 'always' or delete = 'receiver', then when a receiver is closed it should delete the queue.
> Please note that the client will delete the queue irrespective of whether there are consumers on the queue or not.
> Also it will not take into account whether the queue is empty or not.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org