Consuming 1 file at a time in camel route

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Consuming 1 file at a time in camel route

Hemant Pekhale
Hi,

I want to consume file one by one from a directory. Second file must not be
picked until the route completes the processing of first file.

Which approach I can use?
Regards,
Hemant Pekhale
Reply | Threaded
Open this post in threaded view
|

Re: Consuming 1 file at a time in camel route

Claus Ibsen-2
Hi

This is what happens today by default with the Camel file component.

On Mon, Apr 9, 2018 at 2:42 PM, Hemant Pekhale <[hidden email]> wrote:
> Hi,
>
> I want to consume file one by one from a directory. Second file must not be
> picked until the route completes the processing of first file.
>
> Which approach I can use?



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|

Re: Consuming 1 file at a time in camel route

Hemant Pekhale
Hi  Claus,

Thanks for the quick response. My route is picking a file and and posting
on a web service. What is happening is webservice taking time to return
response
and I don't want to send another request until the response of first
request is not received.

But this is not happening. Route is picking the file sending the request
and without waiting for response it is picking second file and posting it.



On Mon, Apr 9, 2018 at 6:57 PM, Claus Ibsen <[hidden email]> wrote:

> Hi
>
> This is what happens today by default with the Camel file component.
>
> On Mon, Apr 9, 2018 at 2:42 PM, Hemant Pekhale <[hidden email]>
> wrote:
> > Hi,
> >
> > I want to consume file one by one from a directory. Second file must not
> be
> > picked until the route completes the processing of first file.
> >
> > Which approach I can use?
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>
Regards,
Hemant Pekhale
Reply | Threaded
Open this post in threaded view
|

Re: Consuming 1 file at a time in camel route

Hemant Pekhale
FYI : I am using cxf to post on webservice

On Mon, Apr 9, 2018 at 7:12 PM, Hemant Pekhale <[hidden email]>
wrote:

> Hi  Claus,
>
> Thanks for the quick response. My route is picking a file and and posting
> on a web service. What is happening is webservice taking time to return
> response
> and I don't want to send another request until the response of first
> request is not received.
>
> But this is not happening. Route is picking the file sending the request
> and without waiting for response it is picking second file and posting it.
>
>
>
> On Mon, Apr 9, 2018 at 6:57 PM, Claus Ibsen <[hidden email]> wrote:
>
>> Hi
>>
>> This is what happens today by default with the Camel file component.
>>
>> On Mon, Apr 9, 2018 at 2:42 PM, Hemant Pekhale <[hidden email]>
>> wrote:
>> > Hi,
>> >
>> > I want to consume file one by one from a directory. Second file must
>> not be
>> > picked until the route completes the processing of first file.
>> >
>> > Which approach I can use?
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
>>
>
>
Regards,
Hemant Pekhale
Reply | Threaded
Open this post in threaded view
|

Re: Consuming 1 file at a time in camel route

Claus Ibsen-2
Set synchronous=true on the cxf endpoint

On Mon, Apr 9, 2018 at 3:43 PM, Hemant Pekhale <[hidden email]> wrote:

> FYI : I am using cxf to post on webservice
>
> On Mon, Apr 9, 2018 at 7:12 PM, Hemant Pekhale <[hidden email]>
> wrote:
>
>> Hi  Claus,
>>
>> Thanks for the quick response. My route is picking a file and and posting
>> on a web service. What is happening is webservice taking time to return
>> response
>> and I don't want to send another request until the response of first
>> request is not received.
>>
>> But this is not happening. Route is picking the file sending the request
>> and without waiting for response it is picking second file and posting it.
>>
>>
>>
>> On Mon, Apr 9, 2018 at 6:57 PM, Claus Ibsen <[hidden email]> wrote:
>>
>>> Hi
>>>
>>> This is what happens today by default with the Camel file component.
>>>
>>> On Mon, Apr 9, 2018 at 2:42 PM, Hemant Pekhale <[hidden email]>
>>> wrote:
>>> > Hi,
>>> >
>>> > I want to consume file one by one from a directory. Second file must
>>> not be
>>> > picked until the route completes the processing of first file.
>>> >
>>> > Which approach I can use?
>>>
>>>
>>>
>>> --
>>> Claus Ibsen
>>> -----------------
>>> http://davsclaus.com @davsclaus
>>> Camel in Action 2: https://www.manning.com/ibsen2
>>>
>>
>>



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|

Re: Consuming 1 file at a time in camel route

Hemant Pekhale
Hi Claus,

Thanks for the solution. It worked perfectly as expected.

Thanks!

On Mon, Apr 9, 2018 at 7:21 PM, Claus Ibsen <[hidden email]> wrote:

> Set synchronous=true on the cxf endpoint
>
> On Mon, Apr 9, 2018 at 3:43 PM, Hemant Pekhale <[hidden email]>
> wrote:
> > FYI : I am using cxf to post on webservice
> >
> > On Mon, Apr 9, 2018 at 7:12 PM, Hemant Pekhale <[hidden email]
> >
> > wrote:
> >
> >> Hi  Claus,
> >>
> >> Thanks for the quick response. My route is picking a file and and
> posting
> >> on a web service. What is happening is webservice taking time to return
> >> response
> >> and I don't want to send another request until the response of first
> >> request is not received.
> >>
> >> But this is not happening. Route is picking the file sending the request
> >> and without waiting for response it is picking second file and posting
> it.
> >>
> >>
> >>
> >> On Mon, Apr 9, 2018 at 6:57 PM, Claus Ibsen <[hidden email]>
> wrote:
> >>
> >>> Hi
> >>>
> >>> This is what happens today by default with the Camel file component.
> >>>
> >>> On Mon, Apr 9, 2018 at 2:42 PM, Hemant Pekhale <
> [hidden email]>
> >>> wrote:
> >>> > Hi,
> >>> >
> >>> > I want to consume file one by one from a directory. Second file must
> >>> not be
> >>> > picked until the route completes the processing of first file.
> >>> >
> >>> > Which approach I can use?
> >>>
> >>>
> >>>
> >>> --
> >>> Claus Ibsen
> >>> -----------------
> >>> http://davsclaus.com @davsclaus
> >>> Camel in Action 2: https://www.manning.com/ibsen2
> >>>
> >>
> >>
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>
Regards,
Hemant Pekhale