Active MQ 5.13.1 Slave node is getting stopped when database switch happens

I am using Active MQ 5.13.1 and Master/Slave Active MQ topology configured.
Slave node is getting stopped when database switch happens.

<-- Wrapper Stopped

Tried following auto reconnect configuration, from activemq.xml but no luck

     <persistenceAdapter>
                   			
    			<jdbcPersistenceAdapter dataDirectory="activemq-data" dataSource="#mssql-ds" lockKeepAlivePeriod="5000" > 
    				<locker>
    					<database-locker lockAcquireSleepInterval="30000" />
    				</locker>
    			</jdbcPersistenceAdapter>
    		</persistenceAdapter>

Open in new window

Jayabharath sadanagiriSoftware SpecialistAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Radek BaranowskiFull-stack Java DeveloperCommented:
Hello,

in https://issues.apache.org/jira/browse/AMQ-3654 they have suggested using

 
<databaseLocker>
      <lease-database-locker/>
</databaseLocker>

Open in new window


approach, did you try that ?
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jayabharath sadanagiriSoftware SpecialistAuthor Commented:
Yes, lease-database-locker with jDBCIOExceptionHandler resolved the issue.
1
Jayabharath sadanagiriSoftware SpecialistAuthor Commented:
I see a new issue after implementing lease-database-locker.
Issue: with new configurations, messages are piling up when we switch ActiveMQ nodes.
observations:
1. messages are getting accumulated in one particular queue only and dispatched queue section has pending messages.
2. not observed issues with other queues
3. tried with queuePrefetch = 1, but still observed pending messages in dispatch queue. Consumers were not processing msgs.
0
Radek BaranowskiFull-stack Java DeveloperCommented:
I suggest you close this question and open a new one for the sake of clarity.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
activeMq

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.