Hi, As per the doc, we have to provide either chunkSize or numberOfLines. The provided sample request [1] consists of chunkSize along with the xpathExpression.
If we don't have to provide the chunkSize, shall we update the sample request documentation? [1] https://docs.wso2.com/display/ESBCONNECTORS/Working+ with+the+File+Connector#WorkingwiththeFileConnector-splitFile Thanks On Mon, Apr 2, 2018 at 5:06 PM, Keerthika Mahendralingam <[email protected] > wrote: > Hi Aditya, > > If you need to split the file based on the xpath expression, you don't > need to provide the chunkSize. If you provide the chunkSize, files will be > splitted in to files with the chunkSize. So could you please only pass > xpath expression and check. > > Thanks, > Keerthika. > > On Wed, Mar 28, 2018 at 10:49 AM, aditya shivankar < > [email protected]> wrote: > >> Respected Madam/Sir, >> >> Using below proxy I am able to split the file . But splitting in not done >> proper. >> >> Even though in the proxy configuration I have provided the structure >> which needs to be maintained in each file , using Xpath Expression >> "<property name="xpathExpression" scope="default" type="STRING" >> value="//catalog/book"/>" >> >> Still file gets ended randomly without even maintaining the proper >> structure.Like below >> >> </book> >> <book id="bk102"> >> <author>Ralls Kim</author> >> <title>Midnight Rain</title> >> <genre>Fantasy</genre> >> <price>5.95</price> >> <publish_date>2000-12 >> >> Attaching Input file(books1000.xml) and 2 files which are produced as the >> result of the split (books1000.xml0 and books1000.xml1). >> >> Proxy which I am using is. >> >> <?xml version="1.0" encoding="UTF-8"?> >> <proxy name="FileConnectorProxy" startOnLoad="true" transports="http >> https" xmlns="http://ws.apache.org/ns/synapse"> >> <target> >> <inSequence> >> <property name="destination" scope="default" type="STRING" >> value="file:///C:/Flatfile/FileConnOutput"/> >> <property name="source" scope="default" type="STRING" >> value="file:///C:/Flatfile/FileConnInput/books1000.xml"/> >> <property name="xpathExpression" scope="default" >> type="STRING" value="//catalog/book"/> >> <fileconnector.splitFile> >> <source>{$ctx:source}</source> >> <destination>{$ctx:destination}</destination> >> <chunkSize>4096</chunkSize> >> <xpathExpression>{$ctx:xpathExpression}</xpathExpression> >> </fileconnector.splitFile> >> <respond/> >> </inSequence> >> <outSequence/> >> <faultSequence/> >> </target> >> </proxy> >> >> I am expecting each file to start with structure like below : >> >> <?xml version="1.0"?> >> <catalog> >> <book id="bk101"> >> >> and each file end with structure like below : >> >> </book> >> </catalog> >> >> Please guide . >> >> >> With Regards, >> Aditya >> >> On Wed, Mar 28, 2018 at 9:25 AM, Chanika Geeganage <[email protected]> >> wrote: >> >>> Hi Aditya, >>> >>> This proxy service will not poll files iteratively, like vfs transport. >>> Have you invoked the proxy service to do the file operation (ie. split) >>> over HTTP/HTTPS? >>> >>> Thanks >>> >>> On Wed, Mar 28, 2018 at 8:52 AM, Shakila Sasikaran <[email protected]> >>> wrote: >>> >>>> Hi Aditya, >>>> >>>> Could you please attach the source file and the log file >>>> (repository/logs/wso2carbon.log) for the investigation? >>>> >>>> Thanks >>>> >>>> On Tue, Mar 27, 2018 at 10:26 PM, aditya shivankar < >>>> [email protected]> wrote: >>>> >>>>> Respected Madam/Sir, >>>>> >>>>> Pointed the source to the file " file:///C:/Flatfile/FileConnIn >>>>> put/inputfor_writeToDb1.xml " . But still the file is not getting >>>>> processed. Please guide. >>>>> >>>>> <?xml version="1.0" encoding="UTF-8"?> >>>>> <proxy name="FileConnectorProxy" startOnLoad="true" transports="http >>>>> https" xmlns="http://ws.apache.org/ns/synapse"> >>>>> <target> >>>>> <inSequence> >>>>> <property name="destination" scope="default" type="STRING" >>>>> value="file:///C:/Flatfile/FileConnOutput"/> >>>>> <property name="source" scope="default" type="STRING" >>>>> value="file:///C:/Flatfile/FileConnInput/inputfor_writeToDb1.xml"/> >>>>> <property name="xpathExpression" scope="default" >>>>> type="STRING" value="//catalog/book"/> >>>>> <fileconnector.splitFile> >>>>> <source>{$ctx:source}</source> >>>>> <destination>{$ctx:destination}</destination> >>>>> <chunkSize>4096</chunkSize> >>>>> <xpathExpression>{$ctx:xpathEx >>>>> pression}</xpathExpression> >>>>> </fileconnector.splitFile> >>>>> <respond/> >>>>> </inSequence> >>>>> <outSequence/> >>>>> <faultSequence/> >>>>> </target> >>>>> </proxy> >>>>> >>>>> With Regards, >>>>> Aditya >>>>> >>>>> >>>>> On Mon, Mar 26, 2018 at 6:02 PM, Shakila Sasikaran <[email protected]> >>>>> wrote: >>>>> >>>>>> Hi Aditya, >>>>>> >>>>>> Please point the file as the source. For example >>>>>> *"source":"/home/vive/Desktop/file/outTest/sample.txt"*. >>>>>> >>>>>> Thanks >>>>>> >>>>>> On Mon, Mar 26, 2018 at 3:49 PM, aditya shivankar < >>>>>> [email protected]> wrote: >>>>>> >>>>>>> Respected Madam/Sir, >>>>>>> >>>>>>> Changed the transport from 'vfs' to "http https". Still the proxy >>>>>>> is not able to poll the file from source location. Please guide. >>>>>>> I have placed a file at C:/Flatfile/FileConnInput . but it is not >>>>>>> getting polled and not triggereing the flow. >>>>>>> >>>>>>> <?xml version="1.0" encoding="UTF-8"?> >>>>>>> <proxy name="FileConnectorProxy" startOnLoad="true" transports="http >>>>>>> https" xmlns="http://ws.apache.org/ns/synapse"> >>>>>>> <target> >>>>>>> <inSequence> >>>>>>> <property name="destination" scope="default" >>>>>>> type="STRING" value="file:///C:/Flatfile/ "/> >>>>>>> <property name="source" scope="default" type="STRING" >>>>>>> value="file:///C:/Flatfile/FileConnInput"/> >>>>>>> <property name="xpathExpression" scope="default" >>>>>>> type="STRING" value="//catalog/book"/> >>>>>>> <fileconnector.splitFile> >>>>>>> <source>{$ctx:source}</source> >>>>>>> <destination>{$ctx:destination}</destination> >>>>>>> <chunkSize>4096</chunkSize> >>>>>>> <xpathExpression>{$ctx:xpathEx >>>>>>> pression}</xpathExpression> >>>>>>> </fileconnector.splitFile> >>>>>>> <respond/> >>>>>>> </inSequence> >>>>>>> <outSequence/> >>>>>>> <faultSequence/> >>>>>>> </target> >>>>>>> </proxy> >>>>>>> >>>>>>> With Regards, >>>>>>> Aditya >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Mon, Mar 26, 2018 at 2:16 PM, Chanika Geeganage <[email protected] >>>>>>> > wrote: >>>>>>> >>>>>>>> Hi Aditya, >>>>>>>> >>>>>>>> The error has come from VFSTransportListener as you have set the >>>>>>>> transport as 'vfs', but there are no vfs endpoint configured. Since >>>>>>>> you are >>>>>>>> using file connector, you can use transports such as http/ https. A >>>>>>>> sample >>>>>>>> can be found from [1] >>>>>>>> >>>>>>>> [1] https://docs.wso2.com/display/ESBCONNECTORS/Working+with+the >>>>>>>> +File+Connector#WorkingwiththeFileConnector-sampleconfigurat >>>>>>>> ionSampleconfiguration >>>>>>>> >>>>>>>> Thanks >>>>>>>> >>>>>>>> On Mon, Mar 26, 2018 at 1:58 PM, aditya shivankar < >>>>>>>> [email protected]> wrote: >>>>>>>> >>>>>>>>> Respected Sir, >>>>>>>>> >>>>>>>>> Please find the screenshot of Faulty proxy service in console. >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> With Regards, >>>>>>>>> Aditya >>>>>>>>> >>>>>>>>> >>>>>>>>> On Mon, Mar 26, 2018 at 1:47 PM, aditya shivankar < >>>>>>>>> [email protected]> wrote: >>>>>>>>> >>>>>>>>>> >>>>>>>>>> Respected Sir, >>>>>>>>>> >>>>>>>>>> I am trying to split a file using file connector >>>>>>>>>> >>>>>>>>>> Below is my FileConnector Proxy : >>>>>>>>>> >>>>>>>>>> <?xml version="1.0" encoding="UTF-8"?> >>>>>>>>>> <proxy name="FileConnectorProxy" startOnLoad="true" >>>>>>>>>> transports="vfs" xmlns="http://ws.apache.org/ns/synapse"> >>>>>>>>>> <target> >>>>>>>>>> <inSequence> >>>>>>>>>> <property name="destination" scope="default" >>>>>>>>>> type="STRING" value="file:///C:/Flatfile/ "/> >>>>>>>>>> <property name="source" scope="default" type="STRING" >>>>>>>>>> value="file:///C:/Flatfile/FileConnInput"/> >>>>>>>>>> <property name="xpathExpression" scope="default" >>>>>>>>>> type="STRING" value="//catalog/book"/> >>>>>>>>>> <fileconnector.splitFile> >>>>>>>>>> <source>{$ctx:source}</source> >>>>>>>>>> <destination>{$ctx:destination}</destination> >>>>>>>>>> <chunkSize>4096</chunkSize> >>>>>>>>>> <xpathExpression>{$ctx:xpathEx >>>>>>>>>> pression}</xpathExpression> >>>>>>>>>> </fileconnector.splitFile> >>>>>>>>>> </inSequence> >>>>>>>>>> <outSequence/> >>>>>>>>>> <faultSequence/> >>>>>>>>>> </target> >>>>>>>>>> </proxy> >>>>>>>>>> >>>>>>>>>> I added the fileconnector following below link in wso2ei server. >>>>>>>>>> https://docs.wso2.com/display/ESB490/Managing+Connectors+in+ >>>>>>>>>> Your+ESB+Instance >>>>>>>>>> >>>>>>>>>> To add a connector: >>>>>>>>>> On the Main tab in the ESB Management Console, under Connectors >>>>>>>>>> click Add. >>>>>>>>>> Click Browse, specify the ZIP file, and click Open. >>>>>>>>>> Click Upload. >>>>>>>>>> The connector will now appear in the Connectors list and is ready >>>>>>>>>> to be enabled in your ESB instance. >>>>>>>>>> >>>>>>>>>> To enable a connector: >>>>>>>>>> On the Main tab in the ESB Management Console, under Connectors >>>>>>>>>> click List to view the uploaded connectors. >>>>>>>>>> Click Enable next to a connector you want to enable, and then >>>>>>>>>> confirm that you want to change its status. Repeat this step for each >>>>>>>>>> connector you want to enable. >>>>>>>>>> >>>>>>>>>> While deploying the application it is giving me the following >>>>>>>>>> error. >>>>>>>>>> >>>>>>>>>> [2018-03-26 13:29:10,334] [EI-Core] ERROR - VFSTransportListener >>>>>>>>>> Unable to stop service : FileConnectorProxy - unable to find the >>>>>>>>>> corresponding protocol endpoint >>>>>>>>>> >>>>>>>>>> and the application gets deployed as the faulty application . >>>>>>>>>> >>>>>>>>>> [2018-03-26 13:29:10,533] [EI-Core] INFO - ApplicationManager >>>>>>>>>> Successfully Deployed Carbon Application : >>>>>>>>>> FileConnectorAppCompositeApplication_1.0.0 >>>>>>>>>> {super-tenant} >>>>>>>>>> >>>>>>>>>> It is not able to pick the file from "FileConnInput" folder. >>>>>>>>>> Please find attached error logs. >>>>>>>>>> Please guide. >>>>>>>>>> >>>>>>>>>> With Regards, >>>>>>>>>> Aditya >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>>>>> Dev mailing list >>>>>>>>> [email protected] >>>>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> Best Regards.. >>>>>>>> >>>>>>>> Chanika Geeganage >>>>>>>> +94773522586 <+94%2077%20352%202586> >>>>>>>> WSO2, Inc.; http://wso2.com >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Dev mailing list >>>>>>> [email protected] >>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Shakila Sasikaran >>>>>> Software Engineer >>>>>> Mobile :+94 (0) 77 526 6848 <+94%2077%20526%206848> >>>>>> [email protected] >>>>>> WSO2, Inc. >>>>>> lean . enterprise . middleware >>>>>> http://www.wso2.com/ >>>>>> >>>>> >>>>> >>>> >>>> >>>> -- >>>> Shakila Sasikaran >>>> Software Engineer >>>> Mobile :+94 (0) 77 526 6848 <+94%2077%20526%206848> >>>> [email protected] >>>> WSO2, Inc. >>>> lean . enterprise . middleware >>>> http://www.wso2.com/ >>>> >>> >>> >>> >>> -- >>> Best Regards.. >>> >>> Chanika Geeganage >>> +94773522586 <+94%2077%20352%202586> >>> WSO2, Inc.; http://wso2.com >>> >>> >> >> _______________________________________________ >> Dev mailing list >> [email protected] >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > <[email protected]> > Keerthika Mahendralingam > Senior Software Engineer > Mobile :+94 (0) 776 121144 <+94%2077%20612%201144> > [email protected] > WSO2, Inc. > lean . enterprise . middleware > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Shakila Sasikaran Software Engineer Mobile :+94 (0) 77 526 6848 [email protected] WSO2, Inc. lean . enterprise . middleware http://www.wso2.com/
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
