You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by wallace <wa...@yahoo.com> on 2007/06/11 22:52:04 UTC

Master/Slave on Weblogic

I am using activemq4.1.1 and weblogic 9.2.

I integrated activemq into the war of my application. It is running fine in
a standalone application. And I tried to deploy in a clustered env (2
servers)and configure the activemq to use JDBC Master/Slave (they both use
same JDBC datasource). I expected the apps to run as follows:

- Both applications run in parallel
- one bundled activemq server runs as mater and aother runs as slave.

But turned out, the first application ran through and the bundled activemq
server ran as Master. The second activemq server was waiting to acquire
database lock to become master. It is expected. BUT it blocked the sec
application from running. The server never reachec running mode, until I
kill the other app and let the activemq server became master.

Anyone has experienced this? What is the best practise to solve it?

Thanks,
-Wallace Wong
-- 
View this message in context: http://www.nabble.com/Master-Slave-on-Weblogic-tf3904036s2354.html#a11068583
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Master/Slave on Weblogic

Posted by James Strachan <ja...@gmail.com>.
On 6/13/07, wallace <wa...@yahoo.com> wrote:
>
> Thanks Eric and James.
>
> I tried to deploy activemq as another web app (different app-deployment
> entry in config.xml). The other app did finish initialization. But
> apparently the activemq app blocked the server from  entering running mode.
> So both apps would not run.  Is there any other way to workaround this?

Run the broker in another JVM?

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

Re: Master/Slave on Weblogic

Posted by wallace <wa...@yahoo.com>.
Thanks Eric and James.

I tried to deploy activemq as another web app (different app-deployment
entry in config.xml). The other app did finish initialization. But
apparently the activemq app blocked the server from  entering running mode.
So both apps would not run.  Is there any other way to workaround this?

And would this happen in resource adapter deployment too? Though seems like
activemq resource adapter is not working till 4.2
(http://www.nabble.com/Re%3A-Activemq-4.0.2-integration-problem%28Now-i-am-getting-another-notserializable-exception%29-p8298628s2354.html)

Thanks for the help,
-Wallace

-- 
View this message in context: http://www.nabble.com/Master-Slave-on-Weblogic-tf3904036s2354.html#a11090593
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Master/Slave on Weblogic

Posted by James Strachan <ja...@gmail.com>.
On 6/11/07, eta <er...@ultracode.com> wrote:
>
> I've been messing with the JDBC database locker code recently, and yes, it
> will work as you described.  The default database locker service start()
> method will not return until it has acquired the lock, indicating that it is
> the master broker.
>
> I'm not sure what the recommended way around this would be, but what I would
> do would be to run the BrokerService.start() method in a separate thread
> from my servlet init() or service() methods.  This will at least allow the
> servlet to fully deploy even though the broker has not yet fully initialized
> because it is a slave.

Eric's exactly right; currnently the starting of a broker in
master/slave is synchronous which would block the calling thread (such
as a web app or Spring configuration) until it becomes the master.

We need a way to allow the starting of the broker to be asynchronous
to avoid blocking the calling thread. I've created a JIRA for this
https://issues.apache.org/activemq/browse/AMQ-1273

In the mean time; another work around is to run the broker as a
separate deployment unit in your server (e.g. in a separate web app)

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

Re: Master/Slave on Weblogic

Posted by eta <er...@ultracode.com>.
I've been messing with the JDBC database locker code recently, and yes, it
will work as you described.  The default database locker service start()
method will not return until it has acquired the lock, indicating that it is
the master broker.

I'm not sure what the recommended way around this would be, but what I would
do would be to run the BrokerService.start() method in a separate thread
from my servlet init() or service() methods.  This will at least allow the
servlet to fully deploy even though the broker has not yet fully initialized
because it is a slave.

-Eric


wallace wrote:
> 
> I am using activemq4.1.1 and weblogic 9.2.
> 
> I integrated activemq into the war of my application. It is running fine
> in a standalone application. And I tried to deploy in a clustered env (2
> servers)and configure the activemq to use JDBC Master/Slave (they both use
> same JDBC datasource). I expected the apps to run as follows:
> 
> - Both applications run in parallel
> - one bundled activemq server runs as mater and aother runs as slave.
> 
> But turned out, the first application ran through and the bundled activemq
> server ran as Master. The second activemq server was waiting to acquire
> database lock to become master. It is expected. BUT it blocked the sec
> application from running. The server never reachec running mode, until I
> kill the other app and let the activemq server became master.
> 
> Anyone has experienced this? What is the best practise to solve it?
> 
> Thanks,
> -Wallace Wong
> 

-- 
View this message in context: http://www.nabble.com/Master-Slave-on-Weblogic-tf3904036s2354.html#a11070252
Sent from the ActiveMQ - User mailing list archive at Nabble.com.