You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by dnn <Da...@ngc.com> on 2010/07/06 21:20:43 UTC

XBean 'start=false' not working?

Has anyone had problems with the XBean 'start=false' not actually disabling
the Broker startup on launch?  I am using Spring 2.5.5 and noticed that
@PostConstruct annotation on the BrokerService#start method does not take
the XBeanBrokerService#start flag into account.  After commenting out the
@PostConstruct annotation on BrokerService#start(), it worked as expected
and the broker was not started.

My problem is that I'm trying to use the shared filesystem master/slave
architecture and the JBoss main thread ends up calling BrokerService#start
(causing the method to block indefinitely waiting for the FS lock).  JBoss
doesn't seem to play nicely with its main thread blocked and will not shut
down gracefully.

Does anyone know of any other workarounds?

Thanks,
Dan

-- 
View this message in context: http://old.nabble.com/XBean-%27start%3Dfalse%27-not-working--tp29086727p29086727.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: XBean 'start=false' not working?

Posted by dnn <Da...@ngc.com>.

Gary Tully wrote:
> 
> can you raise a jira issue for this regression?
> 

Created https://issues.apache.org/activemq/browse/AMQ-2813.  Thanks for
looking into it.

My workaround for the time being is to comment out @PostConstruct on
BrokerService#start.  I could create a patch if you're interested, but that
might be more trouble than it's worth for a one-liner.

-- 
View this message in context: http://old.nabble.com/XBean-%27start%3Dfalse%27-not-working--tp29086727p29098890.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: XBean 'start=false' not working?

Posted by Gary Tully <ga...@gmail.com>.
That looks like a bug that was introduced in
http://svn.apache.org/viewvc?rev=908182&view=rev the postConstruct on
the start method does invalidate the
XBeanBrokerService#afterPropertiesSet()  smarts.

can you raise a jira issue for this regression?

On 7 July 2010 13:51, dnn <Da...@ngc.com> wrote:
>
>
> Gary Tully wrote:
>>
>> You may need to upgrade to 5.3.2, on trunk, the RAR broker start is
>> done in its own thread so it does not block the initiator. Also, the
>> PostConstruct does check the start flag in XBeanBrokerService.
>> What version are you using?
>>
>
> I'm using 5.3.1.  I'm not using the RAR (at least I don't think so) -- AMQ
> is being initialized via xbean in my Spring application context.
>
> The XBeanBrokerService#afterPropertiesSet() method DOES check the start flag
> and is annotated as @PostConstruct so it's called at startup.  However, the
> issue is with the BrokerService#start() method having the @PostConstruct
> annotation as well.  Unless I'm missing something, there is no way for the
> BrokerService class to check the 'start' flag in the XBeanBrokerService
> subclass.  Spring will call BOTH @PostConstruct methods.
> XBeanBrokerService#afterPropertiesSet() will check the 'start' flag and not
> start the broker.  When the BrokerService#start() method is called, however,
> the broker is started.
>
> Thanks for the quick reply!
>
> Dan
> --
> View this message in context: http://old.nabble.com/XBean-%27start%3Dfalse%27-not-working--tp29086727p29095726.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>



-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com

Re: XBean 'start=false' not working?

Posted by dnn <Da...@ngc.com>.

Gary Tully wrote:
> 
> You may need to upgrade to 5.3.2, on trunk, the RAR broker start is
> done in its own thread so it does not block the initiator. Also, the
> PostConstruct does check the start flag in XBeanBrokerService.
> What version are you using?
> 

I'm using 5.3.1.  I'm not using the RAR (at least I don't think so) -- AMQ
is being initialized via xbean in my Spring application context.

The XBeanBrokerService#afterPropertiesSet() method DOES check the start flag
and is annotated as @PostConstruct so it's called at startup.  However, the
issue is with the BrokerService#start() method having the @PostConstruct
annotation as well.  Unless I'm missing something, there is no way for the
BrokerService class to check the 'start' flag in the XBeanBrokerService
subclass.  Spring will call BOTH @PostConstruct methods. 
XBeanBrokerService#afterPropertiesSet() will check the 'start' flag and not
start the broker.  When the BrokerService#start() method is called, however,
the broker is started.

Thanks for the quick reply!

Dan
-- 
View this message in context: http://old.nabble.com/XBean-%27start%3Dfalse%27-not-working--tp29086727p29095726.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: XBean 'start=false' not working?

Posted by Gary Tully <ga...@gmail.com>.
You may need to upgrade to 5.3.2, on trunk, the RAR broker start is
done in its own thread so it does not block the initiator. Also, the
PostConstruct does check the start flag in XBeanBrokerService.
What version are you using?

On 6 July 2010 20:20, dnn <Da...@ngc.com> wrote:
>
> Has anyone had problems with the XBean 'start=false' not actually disabling
> the Broker startup on launch?  I am using Spring 2.5.5 and noticed that
> @PostConstruct annotation on the BrokerService#start method does not take
> the XBeanBrokerService#start flag into account.  After commenting out the
> @PostConstruct annotation on BrokerService#start(), it worked as expected
> and the broker was not started.
>
> My problem is that I'm trying to use the shared filesystem master/slave
> architecture and the JBoss main thread ends up calling BrokerService#start
> (causing the method to block indefinitely waiting for the FS lock).  JBoss
> doesn't seem to play nicely with its main thread blocked and will not shut
> down gracefully.
>
> Does anyone know of any other workarounds?
>
> Thanks,
> Dan
>
> --
> View this message in context: http://old.nabble.com/XBean-%27start%3Dfalse%27-not-working--tp29086727p29086727.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>



-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com