You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Pverdier <pi...@choregie.fr> on 2013/11/14 17:01:48 UTC

Is my karaf server fully started ?

Hi,
Sorry if the subject has already been treated, I searched in the historic
but didn't find a complete answer...

*I'm looking for a way to determine if my karaf server is fully started (i.e
all my routes operational).*

I've been adviced to build a special "log-route" just to indicate "your
server is started" and to raise its start-level to 99 (all others routes are
@start-level=80). Thus, when "your server is started" appears in karaf log,
the server is censed to be fully operational.
But most of my other complex routes take almost a whole minute to start, and
even if the log-route begin its start after the others, the finish_log
appears before the others routes have finished their startup.

How is it possible to indicate to my log-route to begin its start AFTER the
end of all other routes startup ?

Or is there another way to be sure that all routes are fully active ?

Thank you for your ideas :-)



--
View this message in context: http://karaf.922171.n3.nabble.com/Is-my-karaf-server-fully-started-tp4030314.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Is my karaf server fully started ?

Posted by David Bosschaert <da...@gmail.com>.
Or alternatively you can also write an little OSGi bundle that talks
directly to the MBean Server via
ManagementFactory.getPlatformMBeanServer() and does whatever it wants
to do when the desired state has been reached.

BTW do note that when using this with Karaf 3 you need to provide
login credentials.

Cheers,

David

[1] http://docs.oracle.com/javase/6/docs/api/java/lang/management/ManagementFactory.html#getPlatformMBeanServer()

On 14 November 2013 16:34, Pverdier <pi...@choregie.fr> wrote:
> Thanks a lot !
>
> Best regards,
> Pierre.
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Is-my-karaf-server-fully-started-tp4030314p4030318.html
> Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Is my karaf server fully started ?

Posted by Pverdier <pi...@choregie.fr>.
Thanks a lot !

Best regards,
Pierre.



--
View this message in context: http://karaf.922171.n3.nabble.com/Is-my-karaf-server-fully-started-tp4030314p4030318.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Is my karaf server fully started ?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Pierre,

The JMX client can be "hardcoded", but you have a bunch of monitoring 
solution that provide JMX client (nagios, zabbix, etc).

Eventually, you can install jolokia in Karaf (just install the 
jolokia-osgi bundle): it will "wrap" the MBeans with REST services. So 
you need a simple HTTP/REST client in that case.

Regards
JB

On 11/14/2013 05:18 PM, Pverdier wrote:
> Thank you for your answer Jean-Baptiste,
> I'm going to dig in that direction with a JMX Client and I'll be back here
> for feedbacks :)
>
> Best regards,
> Pierre.
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Is-my-karaf-server-fully-started-tp4030314p4030316.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Is my karaf server fully started ?

Posted by Pverdier <pi...@choregie.fr>.
Thank you for your answer Jean-Baptiste,
I'm going to dig in that direction with a JMX Client and I'll be back here
for feedbacks :)

Best regards,
Pierre.



--
View this message in context: http://karaf.922171.n3.nabble.com/Is-my-karaf-server-fully-started-tp4030314p4030316.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Is my karaf server fully started ?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

why not simply use the MBeans with a JMX client ?

You can check the status of the different routes, features, bundles, etc.

So you can check the status of Karaf and the deployed applications.

Regards
JB

On 11/14/2013 05:01 PM, Pverdier wrote:
> Hi,
> Sorry if the subject has already been treated, I searched in the historic
> but didn't find a complete answer...
>
> *I'm looking for a way to determine if my karaf server is fully started (i.e
> all my routes operational).*
>
> I've been adviced to build a special "log-route" just to indicate "your
> server is started" and to raise its start-level to 99 (all others routes are
> @start-level=80). Thus, when "your server is started" appears in karaf log,
> the server is censed to be fully operational.
> But most of my other complex routes take almost a whole minute to start, and
> even if the log-route begin its start after the others, the finish_log
> appears before the others routes have finished their startup.
>
> How is it possible to indicate to my log-route to begin its start AFTER the
> end of all other routes startup ?
>
> Or is there another way to be sure that all routes are fully active ?
>
> Thank you for your ideas :-)
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Is-my-karaf-server-fully-started-tp4030314.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com