Hi Amal,

As you suggested I did the modification in pom file and the service got
registered successfully and the messages are getting published. But in the
subscription end, no nodes are getting subscribed, hence no messages are
received. I debugged the code and found that execute() method in
CacheInvalidationSubscriber is never getting called. And therefore
subscribe() method is not getting called.

Are we missing some other dependent components for this to work?

Shazni Nazeer

Senior Software Engineer

Mob : +94 715 440 607
LinkedIn : http://lk.linkedin.com/in/shazninazeer
Blog : http://shazninazeer.blogspot.com


On Sun, May 18, 2014 at 1:14 PM, Amal Gunatilake <am...@wso2.com> wrote:

> Hi Shazni,
>
> I just recalled a modification I did on friday when testing. When I
> installed the clustering bundle in the osgi console, I noticed the the
> bundle is not getting started due to some import error. So for testing
> purposes I modified the clustering pom locally by removing the import
> bundles and left the *<Import-Package></Import-Package>* empty to let it
> import the dependant packages dynamically at run-time. I hope doing the
> same should solve your current issue.
>
> Thank you  & Best regards,
>
> *Amal Gunatilake*
>  Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
>
> On Sun, May 18, 2014 at 10:25 AM, Amal Gunatilake <am...@wso2.com> wrote:
>
>> Hi Shazni,
>>
>> Yes, the bundle started without a problem when I tried it out. This
>> behavior happens when the osgi service couldn't resolve any dynamic import.
>> Please check whether you have loaded all dependent jars. The javax.cache
>> (CacheInvalidator interface) and clustering jar (CoordinatedActivity
>> interface) should be there to resolve the interface dependencies. Please
>> cross check with the component pom.xml
>>
>> Thank you  & Best regards,
>>
>> *Amal Gunatilake*
>>  Software Engineer
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>>
>> On Sat, May 17, 2014 at 10:19 PM, Shazni Nazeer <sha...@wso2.com> wrote:
>>
>>> Hi Amal,
>>>
>>> I built the carbon5 and and built the cache invalidation and registry.
>>> It seems now the bundle is not getting activated. I debugged the code and
>>> found the bundle restarting again and again at the following while creating
>>> the subscriber.
>>>
>>> subscriber = new CacheInvalidationSubscriber();
>>>
>>> Note the clustering jar is now placed in the
>>> repository/components/dropins directory.
>>>
>>> Was the bundle starting successfully when you tested?
>>>
>>>
>>> Shazni Nazeer
>>>
>>> Senior Software Engineer
>>>
>>> Mob : +94 715 440 607
>>> LinkedIn : http://lk.linkedin.com/in/shazninazeer
>>> Blog : http://shazninazeer.blogspot.com
>>>
>>>
>>> On Sat, May 17, 2014 at 7:33 AM, Amal Gunatilake <am...@wso2.com> wrote:
>>>
>>>> Hi All,
>>>>
>>>> I have implemented the notification based mechanism. Using the
>>>> org.wso2.carbon.clustering.api.CoordinatedActivity interface in Carbon
>>>> 5.0.0 [1]
>>>> The updates are @ [2]
>>>>
>>>> Hi Shazni,
>>>> Please take the updates and run the tests.
>>>>
>>>> [1]
>>>> https://github.com/wso2/carbon-kernel/tree/development/modules/clustering/src/main/java/org/wso2/carbon/clustering/api
>>>> [2]
>>>> https://github.com/amalhub/carbon4-kernel/commit/268cce34583242ab969f21a5c394057c8705b995
>>>>
>>>>
>>>>
>>>> Thank you  & Best regards,
>>>>
>>>> Amal Gunatilake
>>>> Software Engineer
>>>> WSO2 Inc.; http://wso2.com
>>>> lean.enterprise.middleware
>>>>
>>>> On Thu, May 15, 2014 at 11:06 AM, Shazni Nazeer <sha...@wso2.com>
>>>> wrote:
>>>> >
>>>> > Yeah. Notification based method would be ideal for this. The method
>>>> which checks whether "I'm the coordinator" would work, but since the check
>>>> happens between a specified interval, there is also a chance that an update
>>>> would go unnoticed if that happens when the coordinator goes down and
>>>> before the next coordinator is being detected.
>>>> >
>>>> > +1 for notification based mechanism.
>>>> >
>>>> > Shazni Nazeer
>>>> >
>>>> > Senior Software Engineer
>>>> >
>>>> > Mob : +94 715 440 607
>>>> > LinkedIn : http://lk.linkedin.com/in/shazninazeer
>>>> > Blog : http://shazninazeer.blogspot.com
>>>> >
>>>> > On Wed, May 14, 2014 at 11:05 AM, Amal Gunatilake <am...@wso2.com>
>>>> wrote:
>>>> >>
>>>> >> Hi Shazni,
>>>> >>
>>>> >> Let's go with the notification based mechanism as Azeez suggested.
>>>> >>
>>>> >> Hi Azeez,
>>>> >>
>>>> >> Please let me know where is the interface located and which
>>>> dataholder holds the osgi service.
>>>> >>
>>>> >> Thank you  & Best regards,
>>>> >>
>>>> >> Amal Gunatilake
>>>> >> Software Engineer
>>>> >> WSO2 Inc.; http://wso2.com
>>>> >> lean.enterprise.middleware
>>>> >>
>>>> >> On Tue, May 13, 2014 at 6:07 PM, Shazni Nazeer <sha...@wso2.com>
>>>> wrote:
>>>> >>>
>>>> >>> Hi Amal,
>>>> >>>
>>>> >>> Messages are not getting received after this modification. I
>>>> noticed very less number of messages getting published too. No modification
>>>> on registry kernel side is made.
>>>> >>>
>>>> >>> Shazni Nazeer
>>>> >>>
>>>> >>> Senior Software Engineer
>>>> >>>
>>>> >>> Mob : +94 715 440 607
>>>> >>> LinkedIn : http://lk.linkedin.com/in/shazninazeer
>>>> >>> Blog : http://shazninazeer.blogspot.com
>>>> >>>
>>>> >>> On Tue, May 13, 2014 at 6:04 PM, Afkham Azeez <az...@wso2.com>
>>>> wrote:
>>>> >>>>
>>>> >>>>
>>>> >>>>
>>>> >>>> On Tue, May 13, 2014 at 4:30 PM, Amal Gunatilake <am...@wso2.com>
>>>> wrote:
>>>> >>>>>
>>>> >>>>> Hi All,
>>>> >>>>>
>>>> >>>>> Following updates has been discussed on $subject.
>>>> >>>>>
>>>> >>>>> 1) The isCoordinator check is not necessary for publishing the
>>>> cache invalidation message.
>>>> >>>>> 2) Separate the implementation of publisher and subscriber into 2
>>>> classes.
>>>> >>>>> 3) Alter the implementation to support, when the isCoordinator
>>>> node goes down; the next coordinator node should get auto subscribe to the
>>>> topic.
>>>> >>>>>
>>>> >>>>> The 3rd point was discussed to implement as follows:
>>>> >>>>>
>>>> >>>>> The osgi service implementation bundle will be present at all
>>>> nodes. So it will check whether "Am I the coordinator?" in a given time
>>>> interval (This time interval can be configured in cache.xml). When one node
>>>> goes down then the next coordinator will become the coordinator. At this
>>>> point "Am I the coordinator?" will get the response and it will subscribe
>>>> it-self to the topic.
>>>> >>>>
>>>> >>>> There is a better way of implementing this. When a node becomes a
>>>> coordinator, it would notify all OSGi services which implement that
>>>> interface. I already have this implemented in C5 kernel (must check). We
>>>> need to bring that back in. Rather than have a task that checks whether I
>>>> am the coordinator, we should use this notification based mechanism.
>>>> >>>>
>>>> >>>>>
>>>> >>>>> Please update the thread if there are any further updates.
>>>> >>>>>
>>>> >>>>> Thank you  & Best regards,
>>>> >>>>>
>>>> >>>>> Amal Gunatilake
>>>> >>>>> Software Engineer
>>>> >>>>> WSO2 Inc.; http://wso2.com
>>>> >>>>> lean.enterprise.middleware
>>>> >>>>
>>>> >>>>
>>>> >>>> --
>>>> >>>> Afkham Azeez
>>>> >>>> Director of Architecture; WSO2, Inc.; http://wso2.com
>>>> >>>> Member; Apache Software Foundation; http://www.apache.org/
>>>> >>>>
>>>> >>>> email: az...@wso2.com cell: +94 77 3320919
>>>> >>>> blog: http://blog.afkham.org
>>>> >>>> twitter: http://twitter.com/afkham_azeez
>>>> >>>> linked-in: http://lk.linkedin.com/in/afkhamazeez
>>>> >>>>
>>>> >>>> Lean . Enterprise . Middleware
>>>> >>
>>>> >
>>>>
>>>>
>>>>
>>>> --
>>>> Thank you  & Best regards,
>>>>
>>>> *Amal Gunatilake*
>>>>  Software Engineer
>>>> WSO2 Inc.; http://wso2.com
>>>> lean.enterprise.middleware
>>>>
>>>>
>>>
>>
>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to