activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AMQ-5748) Add the ability to get Message Size from a Message Store
Date Tue, 07 Jul 2015 22:57:04 GMT

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

ASF GitHub Bot commented on AMQ-5748:
-------------------------------------

GitHub user cshannon opened a pull request:

    https://github.com/apache/activemq/pull/128

    https://issues.apache.org/jira/browse/AMQ-5748

    Fixing a potential Null pointer exception in  MemoryMessageStore

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/cshannon/activemq AMQ-5748-fix

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/activemq/pull/128.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #128
    
----
commit bd28c3b0ba317c3f07329c083d7097c12beee5b8
Author: Christopher L. Shannon <christopher.l.shannon@gmail.com>
Date:   2015-07-07T22:54:06Z

    https://issues.apache.org/jira/browse/AMQ-5748
    
    Fixing a potential Null pointer exception in  MemoryMessageStore

----


> Add the ability to get Message Size from a Message Store
> --------------------------------------------------------
>
>                 Key: AMQ-5748
>                 URL: https://issues.apache.org/jira/browse/AMQ-5748
>             Project: ActiveMQ
>          Issue Type: New Feature
>          Components: Broker
>    Affects Versions: 5.11.1
>            Reporter: Christopher L. Shannon
>            Assignee: Timothy Bish
>            Priority: Minor
>             Fix For: 5.12.0
>
>
> Currently, the {{MessageStore}} interface supports getting a count for messages ready
to deliver using the {{getMessageCount}} method.  It would also be very useful to be able
to retrieve the message sizes for those counts as well for keeping track of metrics.
> I've created a pull request to address this that adds a {{getMessageSize}} method that
focuses specifically on KahaDB and the Memory store.  The KahaDB store uses the same strategy
as the existing {{getMessageCount}} method, which is to iterate over the index and total up
the size of the messages.  There are unit tests to show the size calculation and a unit test
that shows a store based on version 5 working with the new version (the index is rebuilt)
> One extra issue is that the size was not being serialized to the index (it was not included
in the marshaller) so that required making a slight change and adding a new marshaller for
{{Location}} to store the size in the location index of the store.  Without this change, the
size computation would not work when the broker was restarted since the size was not serialized.
> Note that I wasn't sure the best way to handle the new marshaller and version compatibilities
so I incremented the KahaDB version from 5 to 6. If an old version of the index is loaded,
the index should be detected as corrupted and be rebuilt with the new format.  If there is
a better way to handle this upgrade let me know and the patch can certainly be updated.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message