Uploaded image for project: 'JBoss A-MQ'
  1. JBoss A-MQ
  2. ENTMQ-2014

ActiveMQBlobMessage.setDeletedByBroker deletedByBroker flag does not cause broker to delete associated resource

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • JBoss A-MQ 6.2.1, JBoss A-MQ 6.3
    • broker
    • None
    • User Experience
    • Workaround Exists
    • Hide

      Manually delete the resource associated with the blob message using the ActiveMQBlobMessage deleteFile method as per the unit tests:

      assertTrue(uploaded.exists());
      ((ActiveMQBlobMessage)msg).deleteFile();
      assertFalse(uploaded.exists());

      Show
      Manually delete the resource associated with the blob message using the ActiveMQBlobMessage deleteFile method as per the unit tests: assertTrue(uploaded.exists()); ((ActiveMQBlobMessage)msg).deleteFile(); assertFalse(uploaded.exists());
    • Hide

      someActiveMQSession.createBlobMessage(someURL, true);
      or
      someActiveMQBlobMessage.setDeletedByBroker(true);

      Expectation set that broker will take care of resource removal but it does not.

      Show
      someActiveMQSession.createBlobMessage(someURL, true); or someActiveMQBlobMessage.setDeletedByBroker(true); Expectation set that broker will take care of resource removal but it does not.

    Description

      Looking at ActiveMQSession we see the following method signature:

           * @param deletedByBroker indicates whether or not the resource is deleted
           *                by the broker when the message is acknowledged
          public BlobMessage createBlobMessage(URL url, boolean deletedByBroker) throws JMSException {
      

      and inside we see:

              message.setDeletedByBroker(deletedByBroker);
      

      However as far as I can tell the deletedByBroker flag and the associated isDeletedByBroker() method is never used anywhere in the codebase outside of the actual setDeletedByBroker and createBlobMessage methods.

      Checking the associated blob tests they all pass, however upon closer inspection we see that they all do some variant of this:

              assertTrue(uploaded.exists());
              ((ActiveMQBlobMessage)msg).deleteFile();
              assertFalse(uploaded.exists());
      

      Which manually ensures deletion of the blob message file when required. Looking for existing issues we see AMQ-1529 and AMQ-2430. Reviewing these issues it appears that AMQ-1529 was erroneously closed when AMQ-2430 was resolved and that this AMQ-1529 comment is still relevant as the functionality still appears unimplemented.

      Attachments

        Issue Links

          Activity

            People

              gtully@redhat.com Gary Tully
              rhn-support-rkieley Roderick Kieley
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: