activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Tully <gary.tu...@gmail.com>
Subject Re: null BROKER_NAME to be expected?
Date Thu, 09 Aug 2012 09:53:38 GMT
The LeaseDatabaseLocker does use the BROKER_NAME column, but the
default jdbc locker does not. Old threads would refer to the default
locker.

The LeaseDatabaseLocker will null out the broker name when it releases
the lease.

Have a peek at the statements that manipulate the lock table in:
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/Statements.java?view=markup

Also, possibly try setting the leaseHolderId attribute on the locker.

On 9 August 2012 02:26, Gaurav Sharma <gaurav.cs.sharma@gmail.com> wrote:
> In the ACTIVEMQ_LOCK table, is the null value in BROKER_NAME to be
> expected? I read some old threads about this but couldn't find a definitive
> answer from one of the committers. While it is a minor inconvenience for
> us, at runtime, without scanning logs of the broker machines, there is a no
> way to figure who the master is. So, if we have a column that is expected
> to contain the master node's name, it might be easier if we can just fix
> it. It might not matter but just for the record, my test datastore is mysql
> and I do have the brokerName attribute specified in the broker entity in
> activemq.xml and this snippet from LeaseDatabaseLocker class should work
> okay:
>     public String getLeaseHolderId() {
>         if (leaseHolderId == null) {
>             if (persistenceAdapter.getBrokerService() != null) {
>                 leaseHolderId =
> persistenceAdapter.getBrokerService().getBrokerName();
>             }
>         }
>         return leaseHolderId;
>     }
>
> Thanks in advance for helping figure where the ghost is that's nulling the
> broker name in lock table.
> -gaurav



-- 
http://fusesource.com
http://blog.garytully.com

Mime
View raw message