You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Samuel Liard <sa...@net-liard.com> on 2009/03/30 15:37:58 UTC

Slave but worker !

Hi,

I use Shared File System Master Slave configuration in two JVM with Spring.

It's works well but I would like add consumer in the Slave JVM.
I try :

<bean id="jmsFactory"
class="org.apache.activemq.pool.PooledConnectionFactory"
destroy-method="stop">
  <property name="connectionFactory">
    <bean class="org.apache.activemq.ActiveMQConnectionFactory">
      <property name="brokerURL">
        <value>failover://(tcp://master:61616,vm:localhost)</value>
      </property>
    </bean>
  </property>
</bean>

And the broker :

<bean id="broker" class="org.apache.activemq.xbean.BrokerFactoryBean" >
  <property name="config" value="classpath:activemqSlave.xml" />
  <property name="start" value="true" />
</bean>

In this case, the slave wait for take the lock on share files and the JMS
consumer never start until the master dead.

How have an activeMQ Slave embeded in my JVM without block all other bean ?

Thanks

Samuel
-- 
View this message in context: http://www.nabble.com/Slave-but-worker-%21-tp22782932p22782932.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Slave but worker !

Posted by Samuel Liard <sa...@net-liard.com>.

Gary Tully wrote:
> 
> you would need to manage the slave broker start in another bean and
> thread.
> set the start property to false and inject the broker bean into another
> bean
> where the broker.start() can be called in another thread.
> 

Very good idee !

Unfortunately the property start of
org.apache.activemq.xbean.BrokerFactoryBean didn't work. (true or false
broker start)

It's not "broker.start();" that start broker but the line 85 :
context = new ResourceXmlApplicationContext(config, parentContext);

Maybe because I use the config property like :
<property name="config" value="classpath:activemqSlave.xml" />

So I put all code of afterPropertiesSet() in another thread and it's work
well !

Thanks a lot

Samuel
-- 
View this message in context: http://www.nabble.com/Slave-but-worker-%21-tp22782932p22825174.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Slave but worker !

Posted by Gary Tully <ga...@gmail.com>.
you would need to manage the slave broker start in another bean and thread.
set the start property to false and inject the broker bean into another bean
where the broker.start() can be called in another thread.

2009/3/30 Samuel Liard <sa...@net-liard.com>

>
> Of course ! :)
> But it's not my question. Ok, slave broker is waiting... but why other
> stuff
> declare in my spring configuration are waiting to ?
>
> I just want in the same JVM (same spring configuration) a slave broker (do
> nothing, just wait master dead) and a consumer connect to the master node.
>
> But maybe it's not possible ;)
>
> Samuel
>
>
> Joe Fernandez wrote:
> >
> > A slave broker will not accept connections from clients or other brokers
> > until it becomes a master.
> >
> > Joe
> > Get a free ActiveMQ user guide at http://www.ttmsolutions.com
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Slave-but-worker-%21-tp22782932p22784453.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 
http://blog.garytully.com

Open Source SOA
http://FUSESource.com

Re: Slave but worker !

Posted by Samuel Liard <sa...@net-liard.com>.
Of course ! :)
But it's not my question. Ok, slave broker is waiting... but why other stuff
declare in my spring configuration are waiting to ?

I just want in the same JVM (same spring configuration) a slave broker (do
nothing, just wait master dead) and a consumer connect to the master node.

But maybe it's not possible ;)

Samuel


Joe Fernandez wrote:
> 
> A slave broker will not accept connections from clients or other brokers
> until it becomes a master. 
> 
> Joe
> Get a free ActiveMQ user guide at http://www.ttmsolutions.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Slave-but-worker-%21-tp22782932p22784453.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Slave but worker !

Posted by Joe Fernandez <jo...@ttmsolutions.com>.
A slave broker will not accept connections from clients or other brokers
until it becomes a master. 

Joe
Get a free ActiveMQ user guide at http://www.ttmsolutions.com


Samuel Liard wrote:
> 
> Hi,
> 
> I use Shared File System Master Slave configuration in two JVM with
> Spring.
> 
> It's works well but I would like add consumer in the Slave JVM.
> I try :
> 
> <bean id="jmsFactory"
> class="org.apache.activemq.pool.PooledConnectionFactory"
> destroy-method="stop">
>   <property name="connectionFactory">
>     <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>       <property name="brokerURL">
>         <value>failover://(tcp://master:61616,vm:localhost)</value>
>       </property>
>     </bean>
>   </property>
> </bean>
> 
> And the broker :
> 
> <bean id="broker" class="org.apache.activemq.xbean.BrokerFactoryBean" >
>   <property name="config" value="classpath:activemqSlave.xml" />
>   <property name="start" value="true" />
> </bean>
> 
> In this case, the slave wait for take the lock on share files and the JMS
> consumer never start until the master dead.
> 
> How have an activeMQ Slave embeded in my JVM without block all other bean
> ?
> 
> Thanks
> 
> Samuel
> 

-- 
View this message in context: http://www.nabble.com/Slave-but-worker-%21-tp22782932p22783127.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.