You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Woonsan Ko <wo...@yahoo.com> on 2012/03/09 05:48:25 UTC

JCR Consumer?

Hi,

I tried to use jcr component as consumer, expecting jcr observation event listener like behavior, but I realized that it's not supported yet. The current jcr component supports producer only. So, I'm considering to implement JcrConsumer and possibly contribute it in a new CAMEL JIRA issue later. 
My idea is as follows:
i) the uri format is the same. e.g. 'jcr://user:password@repository/absolute/path/from/node'; the node path is used for javax.jcr.observation.ObservationManager#addEventListener(..., absPath, ...).
ii) additionally, we need parameters for eventTypes, isDeep, uuid[], nodeTypeName[], noLocal parameters (See #addEventListener() for detail).
    For example, we may probably use somethings like 'jcr://user:password@repository/absolute/path/from/node?nodeTypeName=demo:news&eventTypes=3&isDeep=true.
iii) JcrConsumer registers JCR observation event listener from the specified uri information.
iv) When events notified, I think it can simply return a list of javax.jcr.observation.Event objects in IN message.

Any advice or thought?

Regards,

Woonsan

Re: JCR Consumer?

Posted by Woonsan Ko <wo...@yahoo.com>.
Hi Claus,

I've attached a patch with a comment in the issue:
https://issues.apache.org/jira/browse/CAMEL-5155


Cheers,

Woonsan



>________________________________
> From: Woonsan Ko <wo...@yahoo.com>
>To: "users@camel.apache.org" <us...@camel.apache.org> 
>Sent: Saturday, March 10, 2012 4:19 AM
>Subject: Re: JCR Consumer?
> 
>Thank you very much for the valuable input!
>Yes, JCR has an API to unregister listener, so I will need to do proper clean ups.
>I'll keep you updated.
>
>Cheers,
>
>Woonsan
>
>
>
>>________________________________
>> From: Claus Ibsen <cl...@gmail.com>
>>To: users@camel.apache.org 
>>Sent: Friday, March 9, 2012 12:33 AM
>>Subject: Re: JCR Consumer?
>> 
>>Hi Woonsan
>>
>>This sounds like a really good idea.
>>
>>We love contributions, and would look very much forward to your help
>>with this component.
>>http://camel.apache.org/contributing.html
>>
>>I like the fact if the uri can be the same / almost the same.
>>
>>Also when registering listeners in JCR, then remember to cleanup when
>>the JcrConsumer stops, in the doStop method.
>>There should be some API in JCR to unregister the listener as well.
>>
>>
>>
>>On Fri, Mar 9, 2012 at 5:48 AM, Woonsan Ko <wo...@yahoo.com> wrote:
>>> Hi,
>>>
>>> I tried to use jcr component as consumer, expecting jcr observation event listener like behavior, but I realized that it's not supported yet. The current jcr component supports producer only. So, I'm considering to implement JcrConsumer and possibly contribute it in a new CAMEL JIRA issue later.
>>> My idea is as follows:
>>> i) the uri format is the same. e.g. 'jcr://user:password@repository/absolute/path/from/node'; the node path is used for javax.jcr.observation.ObservationManager#addEventListener(..., absPath, ...).
>>> ii) additionally, we need parameters for eventTypes, isDeep, uuid[], nodeTypeName[], noLocal parameters (See #addEventListener() for detail).
>>>     For example, we may probably use somethings like 'jcr://user:password@repository/absolute/path/from/node?nodeTypeName=demo:news&eventTypes=3&isDeep=true.
>>> iii) JcrConsumer registers JCR observation event listener from the specified uri information.
>>> iv) When events notified, I think it can simply return a list of javax.jcr.observation.Event objects in IN message.
>>>
>>> Any advice or thought?
>>>
>>> Regards,
>>>
>>> Woonsan
>>
>>
>>
>>-- 
>>Claus Ibsen
>>-----------------
>>FuseSource
>>Email: cibsen@fusesource.com
>>Web: http://fusesource.com
>>Twitter: davsclaus, fusenews
>>Blog: http://davsclaus.blogspot.com/
>>Author of Camel in Action: http://www.manning.com/ibsen/
>>
>>
>>
>
>

Re: JCR Consumer?

Posted by Woonsan Ko <wo...@yahoo.com>.
Thank you very much for the valuable input!
Yes, JCR has an API to unregister listener, so I will need to do proper clean ups.
I'll keep you updated.

Cheers,

Woonsan



>________________________________
> From: Claus Ibsen <cl...@gmail.com>
>To: users@camel.apache.org 
>Sent: Friday, March 9, 2012 12:33 AM
>Subject: Re: JCR Consumer?
> 
>Hi Woonsan
>
>This sounds like a really good idea.
>
>We love contributions, and would look very much forward to your help
>with this component.
>http://camel.apache.org/contributing.html
>
>I like the fact if the uri can be the same / almost the same.
>
>Also when registering listeners in JCR, then remember to cleanup when
>the JcrConsumer stops, in the doStop method.
>There should be some API in JCR to unregister the listener as well.
>
>
>
>On Fri, Mar 9, 2012 at 5:48 AM, Woonsan Ko <wo...@yahoo.com> wrote:
>> Hi,
>>
>> I tried to use jcr component as consumer, expecting jcr observation event listener like behavior, but I realized that it's not supported yet. The current jcr component supports producer only. So, I'm considering to implement JcrConsumer and possibly contribute it in a new CAMEL JIRA issue later.
>> My idea is as follows:
>> i) the uri format is the same. e.g. 'jcr://user:password@repository/absolute/path/from/node'; the node path is used for javax.jcr.observation.ObservationManager#addEventListener(..., absPath, ...).
>> ii) additionally, we need parameters for eventTypes, isDeep, uuid[], nodeTypeName[], noLocal parameters (See #addEventListener() for detail).
>>     For example, we may probably use somethings like 'jcr://user:password@repository/absolute/path/from/node?nodeTypeName=demo:news&eventTypes=3&isDeep=true.
>> iii) JcrConsumer registers JCR observation event listener from the specified uri information.
>> iv) When events notified, I think it can simply return a list of javax.jcr.observation.Event objects in IN message.
>>
>> Any advice or thought?
>>
>> Regards,
>>
>> Woonsan
>
>
>
>-- 
>Claus Ibsen
>-----------------
>FuseSource
>Email: cibsen@fusesource.com
>Web: http://fusesource.com
>Twitter: davsclaus, fusenews
>Blog: http://davsclaus.blogspot.com/
>Author of Camel in Action: http://www.manning.com/ibsen/
>
>
>

Re: JCR Consumer?

Posted by Claus Ibsen <cl...@gmail.com>.
Hi Woonsan

This sounds like a really good idea.

We love contributions, and would look very much forward to your help
with this component.
http://camel.apache.org/contributing.html

I like the fact if the uri can be the same / almost the same.

Also when registering listeners in JCR, then remember to cleanup when
the JcrConsumer stops, in the doStop method.
There should be some API in JCR to unregister the listener as well.



On Fri, Mar 9, 2012 at 5:48 AM, Woonsan Ko <wo...@yahoo.com> wrote:
> Hi,
>
> I tried to use jcr component as consumer, expecting jcr observation event listener like behavior, but I realized that it's not supported yet. The current jcr component supports producer only. So, I'm considering to implement JcrConsumer and possibly contribute it in a new CAMEL JIRA issue later.
> My idea is as follows:
> i) the uri format is the same. e.g. 'jcr://user:password@repository/absolute/path/from/node'; the node path is used for javax.jcr.observation.ObservationManager#addEventListener(..., absPath, ...).
> ii) additionally, we need parameters for eventTypes, isDeep, uuid[], nodeTypeName[], noLocal parameters (See #addEventListener() for detail).
>     For example, we may probably use somethings like 'jcr://user:password@repository/absolute/path/from/node?nodeTypeName=demo:news&eventTypes=3&isDeep=true.
> iii) JcrConsumer registers JCR observation event listener from the specified uri information.
> iv) When events notified, I think it can simply return a list of javax.jcr.observation.Event objects in IN message.
>
> Any advice or thought?
>
> Regards,
>
> Woonsan



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/