Hi Andy If I've understood Romain well, setting a time to wait won't solve the problem.
ActiveMQ server-slave failover works like that: the first server becomes the master and serves, the slave server acquire a lock in the DB and waits for the master server to release the lock to take over. This may be forever if the master server never stops. The problem here is that TomEE assumes (or it seems to assume) that if the embedded JMS instance is not started, then it cannot start the container itself, and it simply hangs forever during the initialization. So, actually, the slave is somewhat started, because it's just waiting for a lock, but somehow, I think this is not what TomEE considers to be a "ready" state. I'll have to change the current architecture to start these master-slave JMS servers outside TomEE, although, I'd like to keep it simpler. :-( [] Leo On Sat, Oct 25, 2014 at 6:45 AM, Andy Gumbrecht <[email protected]> wrote: > And I'd suggest replacing 'tcp' with 'nio' for better performance. > > Andy. > > > On 24/10/2014 22:47, Romain Manni-Bucau wrote: > >> I don't think so, we want to fail is broker doesn't start in general >> Romain Manni-Bucau >> Twitter: @rmannibucau >> Blog: http://rmannibucau.wordpress.com/ >> LinkedIn: http://fr.linkedin.com/in/rmannibucau >> Github: https://github.com/rmannibucau >> >> >> >> 2014-10-24 22:37 GMT+02:00 Leonardo K. Shikida <[email protected]>: >> >>> is there any property I can set to let tomee start regardless its >>> embedded >>> jms acquires the lock or not? >>> >>> [] >>> >>> Leo >>> >>> On Fri, Oct 24, 2014 at 6:04 PM, Romain Manni-Bucau < >>> [email protected]> >>> wrote: >>> >>> It is not shocking if second broker is configured as a slave. >>>> >>>> Most of the time such config are done with an external amq to keep tomee >>>> stateless >>>> Le 24 oct. 2014 21:37, "Leonardo K. Shikida" <[email protected]> a >>>> écrit : >>>> >>>> well, I am using BrokerXmlConfig=xbean:file... to get the properties >>>>> file >>>>> >>>>> but then, here's the problem. While the first tomee starts, the second >>>>> >>>> one >>>> >>>>> seems to wait for its embedded JMS to start. Since it will be a slave >>>>> server, waiting for a lock, whole tomee also waits for it to start... >>>>> >>>>> so tomee does not start. >>>>> >>>>> is that the expected behavior? >>>>> >>>>> >>>>> >>>>> [] >>>>> >>>>> Leo >>>>> >>>>> On Fri, Oct 24, 2014 at 3:39 PM, Leonardo K. Shikida < >>>>> [email protected]> >>>>> wrote: >>>>> >>>>> Hi >>>>>> >>>>>> I can run 2 tomee's using 2 external JMS servers in the failover mode, >>>>>> using a tomee.xml like this >>>>>> >>>>>> <Resource id="MyJmsResourceAdapter" >>>>>> >>>>> type="ActiveMQResourceAdapter"> >>>> >>>>> BrokerXmlConfig = >>>>>> ServerUrl = >>>>>> failover:(tcp://s1:61616,tcp://s2:61616)?randomize=false >>>>>> </Resource> >>>>>> >>>>>> >>>>>> If I want to start two embedded JMS servers, one in each tomee, in a >>>>>> failover mode, what's the syntax? I've been trying this >>>>>> >>>>>> <Resource id="MyJmsResourceAdapter" >>>>>> >>>>> type="ActiveMQResourceAdapter"> >>>> >>>>> BrokerXmlConfig = broker:(tcp://s1:61616)?persistent=true >>>>>> ServerUrl = >>>>>> failover:(tcp://s1:61616,tcp:/s2:61616)?randomize=false >>>>>> DataSource = MyJmsDataSource >>>>>> </Resource> >>>>>> >>>>>> where MyJmsDataSource points to some JDBC resource (must be the same >>>>>> >>>>> for >>>> >>>>> both). Of course, the other tomee declares its broker in the >>>>>> "BrokerXmlConfig" >>>>>> >>>>>> But something is not right. I feel I am missing something. Is this the >>>>>> right syntax? >>>>>> >>>>>> TIA >>>>>> >>>>>> Leo >>>>>> >>>>>> >> >> -- >> Andy Gumbrecht >> https://twitter.com/AndyGeeDe >> http://www.tomitribe.com >> >
