You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by ikbenben <be...@desato.com> on 2007/11/11 23:43:42 UTC

jdbcPersistence behaviour

hey all,

i've got a question regarding the behaviour of using the
jdbcPersistenceAdaptor.  i have deployed ActiveMQ into a clustered JBoss
4.0.5 environment.  I basically have 2 JBoss servers, each of which has the
ActiveMQ RAR deployed.  I've attached the broker xml file for reference: 
http://www.nabble.com/file/p13696937/broker.xml broker.xml 

When i start up the JBoss servers, the first server comes up correctly but
the second jboss instance hangs during start up while it is trying to get a
lock on the database (activemq).  when i shut down server one, the second
instance continues and finishes the start up.  is this how it should behave?

i added the 'useDatabaseLock="false"' attribute to the broker.xml but to me
this will result in both servers available to accept requests which is not
what is desired.

can someone confirm this is how it is expected to behave? 

the reason i'm asking was i intended to deploy a EAR file in the jboss
instance on each server which would use activemq tp send messages to other
applications.  however, if the second instance doesn't come up ever then
this won't work as i need to ensure i have clustering working on the EAR
level.

cheers and thanks ahead of time
ben


-- 
View this message in context: http://www.nabble.com/jdbcPersistence-behaviour-tf4787830s2354.html#a13696937
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: jdbcPersistence behaviour

Posted by jcgarrido <ju...@m-centric.com>.
Hi.

We are experiencing still this problem when trying to deploy ActiveMQ into a
clustered Tomcat 6.0.14 environment with MySQL for presistence, but the
issue you created shows this problem as solved.

Was the applied solution specific for JBoss and the problem still exists
when using Tomcat?

Many thanks.


Hiram Chirino wrote:
> 
> Looks like we should start the embedded broker async to avoid hanging
> the Jboss startup.
> 
> I created issue: https://issues.apache.org/activemq/browse/AMQ-1519
> to track.
> 
> On Nov 12, 2007 12:07 PM, James Strachan <ja...@gmail.com> wrote:
>> On 11/11/2007, ikbenben <be...@desato.com> wrote:
>> >
>> > hey all,
>> >
>> > i've got a question regarding the behaviour of using the
>> > jdbcPersistenceAdaptor.  i have deployed ActiveMQ into a clustered
>> JBoss
>> > 4.0.5 environment.  I basically have 2 JBoss servers, each of which has
>> the
>> > ActiveMQ RAR deployed.  I've attached the broker xml file for
>> reference:
>> > http://www.nabble.com/file/p13696937/broker.xml broker.xml
>> >
>> > When i start up the JBoss servers, the first server comes up correctly
>> but
>> > the second jboss instance hangs during start up while it is trying to
>> get a
>> > lock on the database (activemq).  when i shut down server one, the
>> second
>> > instance continues and finishes the start up.  is this how it should
>> behave?
>>
>> Yes - the first broker to start is the master, it locks the database -
>> the others are slaves.
>>
>> http://activemq.apache.org/jdbc-master-slave.html
>>
>> If you don't want the brokers to be a master/slave cluster, then just
>> use a different database for each broker; though then you probably
>> will want to network your brokers together to make a store and forward
>> network.
>>
>>
>> > the reason i'm asking was i intended to deploy a EAR file in the jboss
>> > instance on each server which would use activemq tp send messages to
>> other
>> > applications.  however, if the second instance doesn't come up ever
>> then
>> > this won't work as i need to ensure i have clustering working on the
>> EAR
>> > level.
>>
>> So either run your master/slave brokers separately to your jboss
>> servers (e.g. running the bin/activemq command) or try figure out how
>> to do an async start in jboss, or run the brokers in separate jboss
>> servers? Note that the RAR can connect to a remote broker - it doesn't
>> need to boot up an ActiveMQ broker
>>
>> --
>> James
>> -------
>> http://macstrac.blogspot.com/
>>
>> Open Source SOA
>> http://open.iona.com
>>
> 
> 
> 
> -- 
> Regards,
> Hiram
> 
> Blog: http://hiramchirino.com
> 
> Open Source SOA
> http://open.iona.com
> 
> 

-- 
View this message in context: http://www.nabble.com/jdbcPersistence-behaviour-tp13696937p19569833.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: jdbcPersistence behaviour

Posted by Hiram Chirino <hi...@hiramchirino.com>.
Looks like we should start the embedded broker async to avoid hanging
the Jboss startup.

I created issue: https://issues.apache.org/activemq/browse/AMQ-1519
to track.

On Nov 12, 2007 12:07 PM, James Strachan <ja...@gmail.com> wrote:
> On 11/11/2007, ikbenben <be...@desato.com> wrote:
> >
> > hey all,
> >
> > i've got a question regarding the behaviour of using the
> > jdbcPersistenceAdaptor.  i have deployed ActiveMQ into a clustered JBoss
> > 4.0.5 environment.  I basically have 2 JBoss servers, each of which has the
> > ActiveMQ RAR deployed.  I've attached the broker xml file for reference:
> > http://www.nabble.com/file/p13696937/broker.xml broker.xml
> >
> > When i start up the JBoss servers, the first server comes up correctly but
> > the second jboss instance hangs during start up while it is trying to get a
> > lock on the database (activemq).  when i shut down server one, the second
> > instance continues and finishes the start up.  is this how it should behave?
>
> Yes - the first broker to start is the master, it locks the database -
> the others are slaves.
>
> http://activemq.apache.org/jdbc-master-slave.html
>
> If you don't want the brokers to be a master/slave cluster, then just
> use a different database for each broker; though then you probably
> will want to network your brokers together to make a store and forward
> network.
>
>
> > the reason i'm asking was i intended to deploy a EAR file in the jboss
> > instance on each server which would use activemq tp send messages to other
> > applications.  however, if the second instance doesn't come up ever then
> > this won't work as i need to ensure i have clustering working on the EAR
> > level.
>
> So either run your master/slave brokers separately to your jboss
> servers (e.g. running the bin/activemq command) or try figure out how
> to do an async start in jboss, or run the brokers in separate jboss
> servers? Note that the RAR can connect to a remote broker - it doesn't
> need to boot up an ActiveMQ broker
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source SOA
> http://open.iona.com
>



-- 
Regards,
Hiram

Blog: http://hiramchirino.com

Open Source SOA
http://open.iona.com

Re: jdbcPersistence behaviour

Posted by ikbenben <be...@desato.com>.
bump :)


ikbenben wrote:
> 
> Hey James,
> 
> thanks for the feedback.  i had read the docs.  
> 
> just to be sure i am understanding correctly, suppose we have 2 jboss
> nodes in a cluster, both with activemq-ra.rar and jbossweb-tomcat55.sar
> deployed.  then, when the 1st node is started, both the activemq and
> tomcat modules will complete their startup correctly and be available. 
> however, when the 2nd node is started, it will hang indefinitely while it
> tries to get a db lock for active mq and the tomcat module will never be
> available.  this applies to any other services that have been deployed in
> the cluster (ie jndi, webservices, scheduling, etc...)
> 
> if this is true, then it seems like there is not any reason or advantage
> to embed activemq in a jboss cluster.
> 
> i would have thought it would behave similar to how ha-jms works in jboss. 
> all servers in the cluster complete their startup sequence completely but
> only a first node to be started in the cluster has the active jms
> provider.  the other nodes in the cluster have a proxy to that first node
> so any requests to the local jms gets redirected to the first node's jms
> provider.  in the end all the other deployed services on every jboss node
> are available.
> 
> am i understanding things correct?  what is the typical architecture then
> if i have a web application deployed in a jboss cluster that needs to use
> jms and i want that jms provider to be active mq?  
> 
> btw, the whole reason for this is that jbossMQ has issues and most people
> have migrated to activeMQ instead.
> 
> cheers
> ben
> 
> 
> James.Strachan wrote:
>> 
>> On 11/11/2007, ikbenben <be...@desato.com> wrote:
>>>
>>> hey all,
>>>
>>> i've got a question regarding the behaviour of using the
>>> jdbcPersistenceAdaptor.  i have deployed ActiveMQ into a clustered JBoss
>>> 4.0.5 environment.  I basically have 2 JBoss servers, each of which has
>>> the
>>> ActiveMQ RAR deployed.  I've attached the broker xml file for reference:
>>> http://www.nabble.com/file/p13696937/broker.xml broker.xml
>>>
>>> When i start up the JBoss servers, the first server comes up correctly
>>> but
>>> the second jboss instance hangs during start up while it is trying to
>>> get a
>>> lock on the database (activemq).  when i shut down server one, the
>>> second
>>> instance continues and finishes the start up.  is this how it should
>>> behave?
>> 
>> Yes - the first broker to start is the master, it locks the database -
>> the others are slaves.
>> 
>> http://activemq.apache.org/jdbc-master-slave.html
>> 
>> If you don't want the brokers to be a master/slave cluster, then just
>> use a different database for each broker; though then you probably
>> will want to network your brokers together to make a store and forward
>> network.
>> 
>> 
>>> the reason i'm asking was i intended to deploy a EAR file in the jboss
>>> instance on each server which would use activemq tp send messages to
>>> other
>>> applications.  however, if the second instance doesn't come up ever then
>>> this won't work as i need to ensure i have clustering working on the EAR
>>> level.
>> 
>> So either run your master/slave brokers separately to your jboss
>> servers (e.g. running the bin/activemq command) or try figure out how
>> to do an async start in jboss, or run the brokers in separate jboss
>> servers? Note that the RAR can connect to a remote broker - it doesn't
>> need to boot up an ActiveMQ broker
>> 
>> -- 
>> James
>> -------
>> http://macstrac.blogspot.com/
>> 
>> Open Source SOA
>> http://open.iona.com
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/jdbcPersistence-behaviour-tp13696937s2354p14298283.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: jdbcPersistence behaviour

Posted by ikbenben <be...@desato.com>.
Hey James,

thanks for the feedback.  i had read the docs.  

just to be sure i am understanding correctly, suppose we have 2 jboss nodes
in a cluster, both with activemq-ra.rar and jbossweb-tomcat55.sar deployed. 
then, when the 1st node is started, both the activemq and tomcat modules
will complete their startup correctly and be available.  however, when the
2nd node is started, it will hang indefinitely while it tries to get a db
lock for active mq and the tomcat module will never be available.  this
applies to any other services that have been deployed in the cluster (ie
jndi, webservices, scheduling, etc...)

if this is true, then it seems like there is not any reason or advantage to
embed activemq in a jboss cluster.

i would have thought it would behave similar to how ha-jms works in jboss. 
all servers in the cluster complete their startup sequence completely but
only a first node to be started in the cluster has the active jms provider. 
the other nodes in the cluster have a proxy to that first node so any
requests to the local jms gets redirected to the first node's jms provider. 
in the end all the other deployed services on every jboss node are
available.

am i understanding things correct?  what is the typical architecture then if
i have a web application deployed in a jboss cluster that needs to use jms
and i want that jms provider to be active mq?  

btw, the whole reason for this is that jbossMQ has issues and most people
have migrated to activeMQ instead.

cheers
ben


James.Strachan wrote:
> 
> On 11/11/2007, ikbenben <be...@desato.com> wrote:
>>
>> hey all,
>>
>> i've got a question regarding the behaviour of using the
>> jdbcPersistenceAdaptor.  i have deployed ActiveMQ into a clustered JBoss
>> 4.0.5 environment.  I basically have 2 JBoss servers, each of which has
>> the
>> ActiveMQ RAR deployed.  I've attached the broker xml file for reference:
>> http://www.nabble.com/file/p13696937/broker.xml broker.xml
>>
>> When i start up the JBoss servers, the first server comes up correctly
>> but
>> the second jboss instance hangs during start up while it is trying to get
>> a
>> lock on the database (activemq).  when i shut down server one, the second
>> instance continues and finishes the start up.  is this how it should
>> behave?
> 
> Yes - the first broker to start is the master, it locks the database -
> the others are slaves.
> 
> http://activemq.apache.org/jdbc-master-slave.html
> 
> If you don't want the brokers to be a master/slave cluster, then just
> use a different database for each broker; though then you probably
> will want to network your brokers together to make a store and forward
> network.
> 
> 
>> the reason i'm asking was i intended to deploy a EAR file in the jboss
>> instance on each server which would use activemq tp send messages to
>> other
>> applications.  however, if the second instance doesn't come up ever then
>> this won't work as i need to ensure i have clustering working on the EAR
>> level.
> 
> So either run your master/slave brokers separately to your jboss
> servers (e.g. running the bin/activemq command) or try figure out how
> to do an async start in jboss, or run the brokers in separate jboss
> servers? Note that the RAR can connect to a remote broker - it doesn't
> need to boot up an ActiveMQ broker
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source SOA
> http://open.iona.com
> 
> 

-- 
View this message in context: http://www.nabble.com/jdbcPersistence-behaviour-tf4787830s2354.html#a13807610
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: jdbcPersistence behaviour

Posted by James Strachan <ja...@gmail.com>.
On 11/11/2007, ikbenben <be...@desato.com> wrote:
>
> hey all,
>
> i've got a question regarding the behaviour of using the
> jdbcPersistenceAdaptor.  i have deployed ActiveMQ into a clustered JBoss
> 4.0.5 environment.  I basically have 2 JBoss servers, each of which has the
> ActiveMQ RAR deployed.  I've attached the broker xml file for reference:
> http://www.nabble.com/file/p13696937/broker.xml broker.xml
>
> When i start up the JBoss servers, the first server comes up correctly but
> the second jboss instance hangs during start up while it is trying to get a
> lock on the database (activemq).  when i shut down server one, the second
> instance continues and finishes the start up.  is this how it should behave?

Yes - the first broker to start is the master, it locks the database -
the others are slaves.

http://activemq.apache.org/jdbc-master-slave.html

If you don't want the brokers to be a master/slave cluster, then just
use a different database for each broker; though then you probably
will want to network your brokers together to make a store and forward
network.


> the reason i'm asking was i intended to deploy a EAR file in the jboss
> instance on each server which would use activemq tp send messages to other
> applications.  however, if the second instance doesn't come up ever then
> this won't work as i need to ensure i have clustering working on the EAR
> level.

So either run your master/slave brokers separately to your jboss
servers (e.g. running the bin/activemq command) or try figure out how
to do an async start in jboss, or run the brokers in separate jboss
servers? Note that the RAR can connect to a remote broker - it doesn't
need to boot up an ActiveMQ broker

-- 
James
-------
http://macstrac.blogspot.com/

Open Source SOA
http://open.iona.com