You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Marco Buss (JIRA)" <ji...@apache.org> on 2007/12/27 08:58:26 UTC

[jira] Created: (AMQ-1529) The blob of a blob-message will never be deleted

The blob of a blob-message will never be deleted
------------------------------------------------

                 Key: AMQ-1529
                 URL: https://issues.apache.org/activemq/browse/AMQ-1529
             Project: ActiveMQ
          Issue Type: Bug
          Components: Message Store
    Affects Versions: 5.0.0, 5.1.0, 5.2.0
         Environment: Windows vista, java 6
            Reporter: Marco Buss
         Attachments: patch.txt

In a blob-message you can specify that the broker can delete the blob if the message is delivered or outdated.
But actual onle the message with the reference to the blob is deletet, the use-data in the repository not. The problem is the separation of the blob from the message itself.

My idea is to extend the persistence store to check at delete if it is a blob message and then delete the blob from the repository. I have done this in the jdbc- and kaha message store (see patch).

JDBC message store:
- created a new table with all blob url`s which must be delete if the message is deleted
| ID (primary Key) | MSGID (reference to ID in MESSAGE table) | URL |
- on message add check if it is a blob-message and if the broker must delete the message add the information to the new table
- in cleanup a query on that table finds all urls with no existing reference in the MESSAGE table (becaus the message is deleted) and then deletes this blobs

KAHA message store:
- TopicSubAck has a new attribute remotBlobUrl
- on message add check if it is a blob-message and if the broker must delete the message add the url to the TopicSubAck
- on acknowledge at delete check if the attribute is set an if it is set delete the blob

THINGS TO DO
- add a similar mechanism to the other message stores
- only the first delete is successfull, every other delete request ends in an 500 errorcode from the server

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


[jira] Commented: (AMQ-1529) The blob of a blob-message will never be deleted

Posted by "Vesna Djurdjevic (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=58138#action_58138 ] 

Vesna Djurdjevic commented on AMQ-1529:
---------------------------------------

I have checked the error 500 in the activemq-fileserver. 
The problem is that streams are not closed when the file is uploaded on the server.

this would fix the problem
{code:title=org.apache.activemq.util.RestFilter.java}
    protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        // some code missing here...

        FileOutputStream out = new FileOutputStream(file);
        try {
            IO.copy(request.getInputStream(), out);
        } catch (IOException e) {
            Log.warn(Log.EXCEPTION, e); // is this obsolete?
            throw e;
        }finally{
            out.close();
        }

        response.setStatus(HttpURLConnection.HTTP_NO_CONTENT); // we return no
                                                                // content
    }
{code}

Also in KahaMessageStore.java should be added removing the blob files when the message is removed.


> The blob of a blob-message will never be deleted
> ------------------------------------------------
>
>                 Key: AMQ-1529
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1529
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Message Store
>    Affects Versions: 5.0.0, 5.1.0, 5.2.0
>         Environment: Windows vista, java 6
>            Reporter: Marco Buss
>            Assignee: Rob Davies
>             Fix For: 5.4.0
>
>         Attachments: patch.txt
>
>
> In a blob-message you can specify that the broker can delete the blob if the message is delivered or outdated.
> But actual onle the message with the reference to the blob is deletet, the use-data in the repository not. The problem is the separation of the blob from the message itself.
> My idea is to extend the persistence store to check at delete if it is a blob message and then delete the blob from the repository. I have done this in the jdbc- and kaha message store (see patch).
> JDBC message store:
> - created a new table with all blob url`s which must be delete if the message is deleted
> | ID (primary Key) | MSGID (reference to ID in MESSAGE table) | URL |
> - on message add check if it is a blob-message and if the broker must delete the message add the information to the new table
> - in cleanup a query on that table finds all urls with no existing reference in the MESSAGE table (becaus the message is deleted) and then deletes this blobs
> KAHA message store:
> - TopicSubAck has a new attribute remotBlobUrl
> - on message add check if it is a blob-message and if the broker must delete the message add the url to the TopicSubAck
> - on acknowledge at delete check if the attribute is set an if it is set delete the blob
> THINGS TO DO
> - add a similar mechanism to the other message stores
> - only the first delete is successfull, every other delete request ends in an 500 errorcode from the server

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


[jira] Commented: (AMQ-1529) The blob of a blob-message will never be deleted

Posted by "Marco Buss (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40926 ] 

Marco Buss commented on AMQ-1529:
---------------------------------

The error 500 occours due to the fact that is an lock on the file.
I think this happens on jetty becaus the server holds the connection for a time. And so when the message is consumed and a GET is invoked for this file the lock ois set until the connection will be closed.

> The blob of a blob-message will never be deleted
> ------------------------------------------------
>
>                 Key: AMQ-1529
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1529
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Message Store
>    Affects Versions: 5.0.0, 5.1.0, 5.2.0
>         Environment: Windows vista, java 6
>            Reporter: Marco Buss
>            Assignee: Rob Davies
>         Attachments: patch.txt
>
>
> In a blob-message you can specify that the broker can delete the blob if the message is delivered or outdated.
> But actual onle the message with the reference to the blob is deletet, the use-data in the repository not. The problem is the separation of the blob from the message itself.
> My idea is to extend the persistence store to check at delete if it is a blob message and then delete the blob from the repository. I have done this in the jdbc- and kaha message store (see patch).
> JDBC message store:
> - created a new table with all blob url`s which must be delete if the message is deleted
> | ID (primary Key) | MSGID (reference to ID in MESSAGE table) | URL |
> - on message add check if it is a blob-message and if the broker must delete the message add the information to the new table
> - in cleanup a query on that table finds all urls with no existing reference in the MESSAGE table (becaus the message is deleted) and then deletes this blobs
> KAHA message store:
> - TopicSubAck has a new attribute remotBlobUrl
> - on message add check if it is a blob-message and if the broker must delete the message add the url to the TopicSubAck
> - on acknowledge at delete check if the attribute is set an if it is set delete the blob
> THINGS TO DO
> - add a similar mechanism to the other message stores
> - only the first delete is successfull, every other delete request ends in an 500 errorcode from the server

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


[jira] Assigned: (AMQ-1529) The blob of a blob-message will never be deleted

Posted by "Rob Davies (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-1529?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rob Davies reassigned AMQ-1529:
-------------------------------

    Assignee: Rob Davies

> The blob of a blob-message will never be deleted
> ------------------------------------------------
>
>                 Key: AMQ-1529
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1529
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Message Store
>    Affects Versions: 5.0.0, 5.1.0, 5.2.0
>         Environment: Windows vista, java 6
>            Reporter: Marco Buss
>            Assignee: Rob Davies
>         Attachments: patch.txt
>
>
> In a blob-message you can specify that the broker can delete the blob if the message is delivered or outdated.
> But actual onle the message with the reference to the blob is deletet, the use-data in the repository not. The problem is the separation of the blob from the message itself.
> My idea is to extend the persistence store to check at delete if it is a blob message and then delete the blob from the repository. I have done this in the jdbc- and kaha message store (see patch).
> JDBC message store:
> - created a new table with all blob url`s which must be delete if the message is deleted
> | ID (primary Key) | MSGID (reference to ID in MESSAGE table) | URL |
> - on message add check if it is a blob-message and if the broker must delete the message add the information to the new table
> - in cleanup a query on that table finds all urls with no existing reference in the MESSAGE table (becaus the message is deleted) and then deletes this blobs
> KAHA message store:
> - TopicSubAck has a new attribute remotBlobUrl
> - on message add check if it is a blob-message and if the broker must delete the message add the url to the TopicSubAck
> - on acknowledge at delete check if the attribute is set an if it is set delete the blob
> THINGS TO DO
> - add a similar mechanism to the other message stores
> - only the first delete is successfull, every other delete request ends in an 500 errorcode from the server

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