You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Dejan Bosanac (JIRA)" <ji...@apache.org> on 2010/04/15 15:57:45 UTC

[jira] Resolved: (AMQ-2696) DefaultJDBCAdapter returns incorrect value that prevents ActiveMQ from starting.

     [ https://issues.apache.org/activemq/browse/AMQ-2696?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dejan Bosanac resolved AMQ-2696.
--------------------------------

    Resolution: Fixed

This should be fixed on now with svn revision 934408.

JDBC store postpones deleting messages with min last seq id to the next iteration cycle. Also getting last broker sequence id procedure is also made resilient on these cases as they can still happen due to expired messages.

> DefaultJDBCAdapter returns incorrect value that prevents ActiveMQ from starting.
> --------------------------------------------------------------------------------
>
>                 Key: AMQ-2696
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2696
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Message Store
>    Affects Versions: 5.3.1
>         Environment: Vista 64bit
>            Reporter: Andy
>            Assignee: Dejan Bosanac
>            Priority: Critical
>             Fix For: 5.4.0
>
>
> org.apache.activemq.store.jdbcJDBCPersistenceAdapter.getLastMessageBrokerSequenceId() calls:
> org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter:
> The call to doGetLastMessageStoreSequenceId will return the max acks table id if the max msgs id is less.
> The result is used to seed the sequenceGenerator:
> long seq =  getAdapter().doGetLastMessageStoreSequenceId(c);
> sequenceGenerator.setLastSequenceId(seq);
> However the next call to set the brokerSeq variable will fail if the seq variable has been seeded with the max acks id, as 'doGetMessageById' expects a valid msgs id.
> long brokerSeq = 0;
>             if (seq != 0) {
>             	Message last = (Message)wireFormat.unmarshal(new ByteSequence(getAdapter().doGetMessageById(c, seq)));
>             	brokerSeq = last.getMessageId().getBrokerSequenceId();
>             }
>             return brokerSeq;
> If 'seq' is not a valid msgs id (I presume because the message has expired and/or been removed) then this causes a NullPointerException in ByteSequence, which is not caught, and this leads to a complete failure to start ActiveMQ.
> The solution is not simple if the tables are in production, and is compounded even further by durable subscribers that cannot simply be deleted from the acks table.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira