Hi Kalyani,
as Buddhima Suggest to implement the custom inbound[1] first start with
sample [2] inbound and then try to implement basic NIO operations[3].   and
refer existing file inbound[4] working flow it guide you to get better
understand about Inbound.


[1]
http://isurur.blogspot.com/2014/12/inbound-endpoints-in-wso2-esb-490.html
[2]
http://wso2experience.blogspot.com/2015/08/getting-started-with-simple-wso2-esb_22.html
[3] http://www.ibm.com/developerworks/java/tutorials/j-nio/j-nio.html
[4]
https://github.com/wso2/carbon-mediation/tree/master/components/inbound-endpoints/org.wso2.carbon.inbound.endpoint/src/main/java/org/wso2/carbon/inbound/endpoint/protocol/file

On Mon, Sep 28, 2015 at 2:28 PM, Malaka Silva <[email protected]> wrote:

> Hi Kalyani,
>
> In this case it'll be busy waiting. Therefore it's not purely listening.
>
> Also we have to provide coordination support for this as well.
>
> Considering the above best would be to do it as a polling transport and
> implement the logic as one time task.
>
> Similar is done in MQTT inbound. [1]
>
> [1]
> https://github.com/wso2/carbon-mediation/tree/master/components/inbound-endpoints/org.wso2.carbon.inbound.endpoint/src/main/java/org/wso2/carbon/inbound/endpoint/protocol/mqtt
>
> On Mon, Sep 28, 2015 at 12:34 PM, Kalyani Yogeswaranathan <
> [email protected]> wrote:
>
>> Hi All,
>>
>> I had discussion with Buddhima about Local File Inbound/Connector. He
>> suggested some resources on Custom Inbound.
>>
>> Please find the discussion in above mail.
>>
>> Thanks
>>
>> On Mon, Sep 28, 2015 at 12:28 PM, Kalyani Yogeswaranathan <
>> [email protected]> wrote:
>>
>>>
>>> ---------- Forwarded message ----------
>>> From: Buddhima Wijeweera <[email protected]>
>>> Date: Mon, Sep 28, 2015 at 10:33 AM
>>> Subject: Re: Custom Inbound
>>> To: Kalyani Yogeswaranathan <[email protected]>
>>>
>>>
>>> Hi Kalyani,
>>>
>>> The resource you found is correct. I basically contains 2 methods.
>>> init()- should contain the logic you have to do (reading, etc.)
>>> destroy() - should contain any thing you need to clean when destroying
>>> the inbound. for ex. close directory references.
>>>
>>> If you have any parameters to consider, in addition to default ones, get
>>> them at constructor.
>>>
>>> Sample implementation of such an inbound can be found at :
>>>
>>> https://github.com/wso2/carbon-mediation/blob/master/components/inbound-endpoints/org.wso2.carbon.inbound.endpoint.ext.wsrm/src/main/java/org/wso2/carbon/inbound/endpoint/ext/wsrm/InboundRMHttpListener.java
>>>
>>> The thing I'm not clear about is , how to identify which files should be
>>> copy, move etc.
>>>
>>> *Can you let me know on that, and how should inbound configuration
>>> should look like?*
>>>
>>> Sample config for the InboundRMHttpListener is:
>>>
>>> https://docs.wso2.com/display/ESB490/CXF+WS-RM+Inbound+Protocol --> Sample
>>> CXF WS-RM Inbound
>>>
>>> Thanks,
>>> Buddhima
>>>
>>>
>>>
>>> On Mon, Sep 28, 2015 at 10:08 AM, Kalyani Yogeswaranathan <
>>> [email protected]> wrote:
>>>
>>>> Hi Buddhima,
>>>>
>>>> This Local File Inbound/Connector should be *listening* inbound.
>>>> Already existing File inbound is *Polling* inbound.
>>>>
>>>> In Local File Inbound it should process the files within the hard disk
>>>> (local files). Use case of this inbound is using *NIO* will be
>>>> optimising the local files process.
>>>>
>>>> So here we are going to do as *listening inbound*. And I found
>>>> https://github.com/wso2-docs/ESB/blob/master/ESB-Artifacts/inbound/custom_inbound_listening/src/main/java/org/wso2/carbon/inbound/custom/listening/SampleListeningEP.java.
>>>> <https://github.com/wso2-docs/ESB/blob/master/ESB-Artifacts/inbound/custom_inbound_listening/src/main/java/org/wso2/carbon/inbound/custom/listening/SampleListeningEP.java>
>>>>
>>>> *Methods*
>>>>
>>>>    -
>>>>
>>>>    Create : Creates a file or directory.
>>>>    -
>>>>
>>>>    Copy : Copies a file.
>>>>    -
>>>>
>>>>    Read : Reads content from a file.
>>>>    -
>>>>
>>>>    Rename : Renames a file or folder.
>>>>    -
>>>>
>>>>    Delete : Deletes a file or directory.
>>>>    -
>>>>
>>>>    Move : Move a files or directory.
>>>>    -
>>>>
>>>>    search : Finds a file based on a file pattern.(xml/text)
>>>>    -
>>>>
>>>>    isFileExist : Checks the existence of a file.
>>>>
>>>>
>>>> Any guide on this?
>>>>
>>>> Thanks
>>>>
>>>> On Sat, Sep 26, 2015 at 11:55 PM, Kalyani Yogeswaranathan <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Thanks for your reply. I'll go through it.
>>>>>
>>>>> Thanks.
>>>>>
>>>>> On Sat, Sep 26, 2015 at 11:51 PM, Buddhima Wijeweera <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> Hi Kalyani,
>>>>>>
>>>>>> I assume through "Local File Inbound/Connector", will fetch the
>>>>>> files from a given location.
>>>>>> If so, then you need to implement a *polling inbound*.
>>>>>> In ESB 4.9.0 docs,
>>>>>> https://docs.wso2.com/display/ESB490/Custom+Inbound+Endpoint shows
>>>>>> about implementing a custom inbound.
>>>>>> By looking at the sample given in doc, you will see
>>>>>>
>>>>>> https://github.com/wso2-docs/ESB/blob/master/ESB-Artifacts/inbound/custom_inbound/src/main/java/org/wso2/carbon/inbound/custom/poll/SamplePollingClient.java
>>>>>>
>>>>>> In that class, the *poll()* method of the parent has overwritten
>>>>>> with custom logic. Similarly at that point, you can implement your logic.
>>>>>>
>>>>>> You can use constructor of that class to initialize any additional
>>>>>> settings required for this inbound, other than generic ones.
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> On Sat, Sep 26, 2015 at 11:27 PM, Kalyani Yogeswaranathan <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>> Hi Buddhima,
>>>>>>>
>>>>>>> I am going to develop Local File Inbound/Connector.  I heard that
>>>>>>> you were developed some custom inbounds. May I get some samples on 
>>>>>>> custom
>>>>>>> inbound?
>>>>>>>
>>>>>>> Thanks
>>>>>>> --
>>>>>>>
>>>>>>> *Kalyani Yogeswaranathan*
>>>>>>>
>>>>>>> *Associate software engineer*
>>>>>>> *WSO2 Inc.*
>>>>>>>
>>>>>>> *Mobile: 0776390284 <0776390284>*
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Buddhima Wijeweera
>>>>>> Software Engineer; WSO2 Inc.; http://wso2.com ,
>>>>>>
>>>>>> Mobile: +94 71 427 9966
>>>>>> Email: [email protected]
>>>>>> Blog:   https://buddhimawijeweera.wordpress.com
>>>>>> GitHub Profile: https://github.com/Buddhima
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> *Kalyani Yogeswaranathan*
>>>>>
>>>>> *Associate software engineer*
>>>>> *WSO2 Inc.*
>>>>>
>>>>> *Mobile: 0776390284 <0776390284>*
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> *Kalyani Yogeswaranathan*
>>>>
>>>> *Associate software engineer*
>>>> *WSO2 Inc.*
>>>>
>>>> *Mobile: 0776390284 <0776390284>*
>>>>
>>>
>>>
>>>
>>> --
>>> Buddhima Wijeweera
>>> Software Engineer; WSO2 Inc.; http://wso2.com ,
>>>
>>> Mobile: +94 71 427 9966
>>> Email: [email protected]
>>> Blog:   https://buddhimawijeweera.wordpress.com
>>> GitHub Profile: https://github.com/Buddhima
>>>
>>>
>>>
>>> --
>>>
>>> *Kalyani Yogeswaranathan*
>>>
>>> *Associate software engineer*
>>> *WSO2 Inc.*
>>>
>>> *Mobile: 0776390284 <0776390284>*
>>>
>>
>>
>>
>> --
>>
>> *Kalyani Yogeswaranathan*
>>
>> *Associate software engineer*
>> *WSO2 Inc.*
>>
>> *Mobile: 0776390284 <0776390284>*
>>
>
>
>
> --
>
> Best Regards,
>
> Malaka Silva
> Senior Tech Lead
> M: +94 777 219 791
> Tel : 94 11 214 5345
> Fax :94 11 2145300
> Skype : malaka.sampath.silva
> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
> Blog : http://mrmalakasilva.blogspot.com/
>
> WSO2, Inc.
> lean . enterprise . middleware
> http://www.wso2.com/
> http://www.wso2.com/about/team/malaka-silva/
> <http://wso2.com/about/team/malaka-silva/>
>
> Save a tree -Conserve nature & Save the world for your future. Print this
> email only if it is absolutely necessary.
>
> _______________________________________________
> Architecture mailing list
> [email protected]
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>
>


-- 
Thank you
Best Regards

*Rajjaz HM*
Associate Software Engineer
WSO2 Inc. <http://wso2.com/>
lean | enterprise | middleware
Mobile | +94752833834
Email   | [email protected]
LinkedIn | Blogger | WSO2 Profile
<http://wso2.com/about/team/mohammer_rajjaz/>
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to