felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerome.moli...@gmail.com
Subject Re: Weird problem with EventAdmin:blacklisting
Date Wed, 25 Jan 2012 17:07:23 GMT
Hi carsten thanks for the explanation I did not read the whole source code....understood
The code works nice in equinox with the same eventadmin bundle deployed inside...
I know this plugin and it s installed the event is on the correct topic and the servlet listens
this topic but is never notified....
The event contains a pojo containing data necessary for the asynchronous reaction

I will raise the log level to try to get more info

Thanks a lot
---- Envoyé avec BlackBerry® d'Orange ----

-----Original Message-----
From: Carsten Ziegeler <cziegeler@apache.org>
Date: Wed, 25 Jan 2012 18:01:43 
To: <dev@felix.apache.org>
Reply-To: dev@felix.apache.org
Subject: Re: Weird problem with EventAdmin:blacklisting


for your previous question: the code is a little bit tricky. It's
correct that just the sync handler gets the configuration. But the
async handler does not deliver events by itself. It uses internally
the async handler as well. Therefore timeout handling applies here as

The blacklisting is there because according to the spec event handlers
should not take too much time for processing (see OSGi Compendium
113.8.2). And you can turn it off :)
Even with blacklisting turned on, your handler should be invoked at
least once. If it doesn't get an event at all, there might be a
problem with the topics or the event sending?
The web console has also a plugin for the event admin, do you see your
events listed there?
For which topic is your handler subscribed?


2012/1/25 jerome moliere <jerome.moliere@gmail.com>:
> My current problems are :
> - why such blacklisting ?
> - how this blacklisting may affect my communication because with the
> webconsole and log service I can see my message present in the right
> topic , but it's  never dequeued ... it's stuck on the topic,
> handleEvent() callback is never invoked in my servlet while it's
> correctly set up (I've got the reference displayed as an Eventhandler
> for my servlet bundle)
> Thanks for your help
> Jerome
> J.MOLIERE - Mentor/J
> auteur Eyrolles
> blog: http://romjethoughts.blogspot.com
> 2012/1/25 jerome moliere <jerome.moliere@gmail.com>:
>> Hi once again,
>> I just had a look to the source code and I'd like you to drop me a
>> terrible confusion...
>> In my code I am using the postEvent() method...This is the
>> asynchronous sending of message isn't it ?
>> But as far as I understand while reading the source ,timeouts are set
>> for Synchronous delivery not asychronous one as stated in the next
>> code excerpt:
>> public EventAdminImpl(final HandlerTasks managers,
>>            final DefaultThreadPool syncPool,
>>            final DefaultThreadPool asyncPool,
>>            final int timeout,
>>            final String[] ignoreTimeout)
>>    {
>>        checkNull(managers, "Managers");
>>        checkNull(syncPool, "syncPool");
>>        checkNull(asyncPool, "asyncPool");
>>        m_managers = managers;
>>        m_sendManager = new SyncDeliverTasks(syncPool,
>>                (timeout > 100 ? timeout : 0),
>>                ignoreTimeout);
>>        m_postManager = new AsyncDeliverTasks(asyncPool, m_sendManager);
>>    }
>> So using these properties should have no impact in my case where I am
>> using postEvent rather than sendEvent ...
>> Kind regards
>> J.MOLIERE - Mentor/J
>> auteur Eyrolles
>> blog: http://romjethoughts.blogspot.com
>> 2012/1/25 jerome moliere <jerome.moliere@gmail.com>:
>>> Thanks for your help Carsten I'll do some tests ....
>>> I must read the source code to figure out with accuracy what kind of
>>> timeouts is used ...
>>> I don't see any valuable reason for my servlet not respond in 5seconds!!!
>>> It's present at startup with a runlevel 2 ...
>>> let me know more about the mechanisms used
>>> thanks a lot
>>> Jerome
>>> J.MOLIERE - Mentor/J
>>> auteur Eyrolles
>>> blog: http://romjethoughts.blogspot.com
>>> 2012/1/25 Carsten Ziegeler <cziegeler@apache.org>:
>>>> Hi,
>>>> the Felix event admin by default blacklists event handlers if they
>>>> take more than 5 secs. With the setting you mentioned, you turn off
>>>> the timeout for all event handlers.
>>>> If you want a more fine grained setting, you can use the property
>>>> org.apache.felix.eventadmin.IgnoreTimeout to disable timeout handling
>>>> for specific handlers or java packages (see
>>>> http://felix.apache.org/site/apache-felix-event-admin.html)
>>>> I assume the Equinox implementation does no blacklisting by default
>>>> Carsten
>>>> 2012/1/25 jerome moliere <jerome.moliere@gmail.com>:
>>>>> I'll try a test with the following property setted to 0 :
>>>>> org.apache.felix.eventadmin.Timeout
>>>>> I'll let you know results of such experiments
>>>>> regards
>>>>> J.MOLIERE - Mentor/J
>>>>> auteur Eyrolles
>>>>> blog: http://romjethoughts.blogspot.com
>>>>> 2012/1/25 jerome moliere <jerome.moliere@gmail.com>:
>>>>>> Hi all,
>>>>>> I 've one part of my application that used equinox to run with a
>>>>>> Tomcat 6 and Spring-DM, it was really very clever so I dropped all
>>>>>> this stuff and replaced all this spaghetti plate with a simple felix
>>>>>> with jetty http service.
>>>>>> This works excepted that for the case where a servlet declaares itself
>>>>>> (in one activator) as a consumer for events coming on a topic....
>>>>>> I 'm using eventadmin 1.2.14 version...
>>>>>> It seems (I've got some logs) that emitter from the event is
>>>>>> blacklisted by the EventAdmin service (due to timeout)
>>>>>> I don't understand why this works at 100% cases with equinox and
>>>>>> in 100% cases with Felix ?
>>>>>> I watched the source code and I've seen the culprit with
>>>>>> BlackListingHandlerTasks class ...
>>>>>> What can I do to avoid this ? Can I use some magic config to shunt
>>>>>> this mecanism ? Can I prevent this module to blacklist a bundle ?
>>>>>> Thanks for your help
>>>>>> any tip is wlecome
>>>>>> J.MOLIERE - Mentor/J
>>>>>> auteur Eyrolles
>>>>>> blog: http://romjethoughts.blogspot.com
>>>> --
>>>> Carsten Ziegeler
>>>> cziegeler@apache.org

Carsten Ziegeler
View raw message