You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Hervé BARRAULT <he...@gmail.com> on 2012/01/24 13:36:09 UTC

Sop Karaf on bundle Failure

Hi,
is there a way in Karaf to define a bundle as "critical" ?. If this
bundle fails, the whole container shall stop/restart.

I can use a listener as in a previous question f(Starting/Stopping
Programmatically Bundles) to check the state of the bundle.

The idea is : I have an embedded broker and my bundles communicate
through JMS. If the broker fails, i am useless so I should try to
restart (at least the broker but i have seen after failure that only
restarting the broker is sometimes not enough).

Regards

Hervé

Re: Sop Karaf on bundle Failure

Posted by Hervé BARRAULT <he...@gmail.com>.
Hi

So i will implement it manually.

Thanks for the answer and the information about auto-reconnection.

On 1/24/12, Guillaume Nodet <gn...@gmail.com> wrote:
> Well you can implement that manually provided you can detect issues.
>   bundleContext.getBundle(id).stop()
>   bundleContext.getBundle(id).start()
> But there's nothing out of the box in karat.
>
> Note that for AMQ, you also have some automatic reconnection features:
>   http://activemq.apache.org/how-can-i-support-auto-reconnection.html
>
> On Tue, Jan 24, 2012 at 15:30, Hervé BARRAULT <he...@gmail.com>
> wrote:
>> Hi,
>> thanks for answer.
>>
>> The component could wait the service but the service will not come
>> back automatically as the activemq bundle does not restart
>> automatically.
>>
>> I am looking for a way to say a bundle shall restart in case of error.
>>
>> Regards.
>> Hervé
>>
>>
>> On 1/24/12, Guillaume Nodet <gn...@gmail.com> wrote:
>>> If you retrieve the JMS connection factory using an OSGi service then
>>> your bundle will easily know that the service is not available
>>> anymore, so the bundle should put itself in a state where it will wait
>>> until the service come up again.
>>>
>>> On Tue, Jan 24, 2012 at 13:36, Hervé BARRAULT <he...@gmail.com>
>>> wrote:
>>>> Hi,
>>>> is there a way in Karaf to define a bundle as "critical" ?. If this
>>>> bundle fails, the whole container shall stop/restart.
>>>>
>>>> I can use a listener as in a previous question f(Starting/Stopping
>>>> Programmatically Bundles) to check the state of the bundle.
>>>>
>>>> The idea is : I have an embedded broker and my bundles communicate
>>>> through JMS. If the broker fails, i am useless so I should try to
>>>> restart (at least the broker but i have seen after failure that only
>>>> restarting the broker is sometimes not enough).
>>>>
>>>> Regards
>>>>
>>>> Hervé
>>>
>>>
>>>
>>> --
>>> ------------------------
>>> Guillaume Nodet
>>> ------------------------
>>> Blog: http://gnodet.blogspot.com/
>>> ------------------------
>>> FuseSource, Integration everywhere
>>> http://fusesource.com
>>>
>
>
>
> --
> ------------------------
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> FuseSource, Integration everywhere
> http://fusesource.com
>

Re: Sop Karaf on bundle Failure

Posted by Guillaume Nodet <gn...@gmail.com>.
Well you can implement that manually provided you can detect issues.
  bundleContext.getBundle(id).stop()
  bundleContext.getBundle(id).start()
But there's nothing out of the box in karat.

Note that for AMQ, you also have some automatic reconnection features:
  http://activemq.apache.org/how-can-i-support-auto-reconnection.html

On Tue, Jan 24, 2012 at 15:30, Hervé BARRAULT <he...@gmail.com> wrote:
> Hi,
> thanks for answer.
>
> The component could wait the service but the service will not come
> back automatically as the activemq bundle does not restart
> automatically.
>
> I am looking for a way to say a bundle shall restart in case of error.
>
> Regards.
> Hervé
>
>
> On 1/24/12, Guillaume Nodet <gn...@gmail.com> wrote:
>> If you retrieve the JMS connection factory using an OSGi service then
>> your bundle will easily know that the service is not available
>> anymore, so the bundle should put itself in a state where it will wait
>> until the service come up again.
>>
>> On Tue, Jan 24, 2012 at 13:36, Hervé BARRAULT <he...@gmail.com>
>> wrote:
>>> Hi,
>>> is there a way in Karaf to define a bundle as "critical" ?. If this
>>> bundle fails, the whole container shall stop/restart.
>>>
>>> I can use a listener as in a previous question f(Starting/Stopping
>>> Programmatically Bundles) to check the state of the bundle.
>>>
>>> The idea is : I have an embedded broker and my bundles communicate
>>> through JMS. If the broker fails, i am useless so I should try to
>>> restart (at least the broker but i have seen after failure that only
>>> restarting the broker is sometimes not enough).
>>>
>>> Regards
>>>
>>> Hervé
>>
>>
>>
>> --
>> ------------------------
>> Guillaume Nodet
>> ------------------------
>> Blog: http://gnodet.blogspot.com/
>> ------------------------
>> FuseSource, Integration everywhere
>> http://fusesource.com
>>



-- 
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
FuseSource, Integration everywhere
http://fusesource.com

Re: Sop Karaf on bundle Failure

Posted by Hervé BARRAULT <he...@gmail.com>.
Hi,
thanks for answer.

The component could wait the service but the service will not come
back automatically as the activemq bundle does not restart
automatically.

I am looking for a way to say a bundle shall restart in case of error.

Regards.
Hervé


On 1/24/12, Guillaume Nodet <gn...@gmail.com> wrote:
> If you retrieve the JMS connection factory using an OSGi service then
> your bundle will easily know that the service is not available
> anymore, so the bundle should put itself in a state where it will wait
> until the service come up again.
>
> On Tue, Jan 24, 2012 at 13:36, Hervé BARRAULT <he...@gmail.com>
> wrote:
>> Hi,
>> is there a way in Karaf to define a bundle as "critical" ?. If this
>> bundle fails, the whole container shall stop/restart.
>>
>> I can use a listener as in a previous question f(Starting/Stopping
>> Programmatically Bundles) to check the state of the bundle.
>>
>> The idea is : I have an embedded broker and my bundles communicate
>> through JMS. If the broker fails, i am useless so I should try to
>> restart (at least the broker but i have seen after failure that only
>> restarting the broker is sometimes not enough).
>>
>> Regards
>>
>> Hervé
>
>
>
> --
> ------------------------
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> FuseSource, Integration everywhere
> http://fusesource.com
>

Re: Sop Karaf on bundle Failure

Posted by Guillaume Nodet <gn...@gmail.com>.
If you retrieve the JMS connection factory using an OSGi service then
your bundle will easily know that the service is not available
anymore, so the bundle should put itself in a state where it will wait
until the service come up again.

On Tue, Jan 24, 2012 at 13:36, Hervé BARRAULT <he...@gmail.com> wrote:
> Hi,
> is there a way in Karaf to define a bundle as "critical" ?. If this
> bundle fails, the whole container shall stop/restart.
>
> I can use a listener as in a previous question f(Starting/Stopping
> Programmatically Bundles) to check the state of the bundle.
>
> The idea is : I have an embedded broker and my bundles communicate
> through JMS. If the broker fails, i am useless so I should try to
> restart (at least the broker but i have seen after failure that only
> restarting the broker is sometimes not enough).
>
> Regards
>
> Hervé



-- 
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
FuseSource, Integration everywhere
http://fusesource.com