We are using camel version 2.20.1.

One more interesting thing I found.

When I use the camel salesforce component in routes, everything works fine.

from("salesforce:createJob")
.to("salesforce:createBatch")
.to("salesforce:getAllBatches")
.dowhile()   ==> to check if the getBatch for all batches yields the
batches with completed status.
.to("salesforce:getBatch")
.to("salesforce:getResults")
.to("salesforce:closeJob")


When I use the Producer Template with in, it fails.

@Component
class SomeRouteBuilder extends RouterBuilder{
    @Override
    public void configure() throws Exception {
    from(..).
    .to(..).
    .to("salesforce:getAllBatches").process(new Processor(Exchange e) {
            List<BatchInfo> batches = exchange.getIn().getBody(List.class);
            BatchInfo batchInfo = batches.get(0);
           do {
             ProducerTemplate template =
e.getContext().createProducerTemplate();
             batchInfo = template.requestBody("salesforce:getBatch",
batchInfo, BatchInfo.class) <== THIS FAILS WITH TIMEOUT.
           }while(batchInfo.getState != BatchStateEnum.COMPLETED)
    })
    .to(..);
}

I was thinking if it is not correct to call the getBatch using the producer
template from with in a route.  Not sure what the issue is.


Regards,

Satya

On Fri, Mar 2, 2018 at 9:15 AM, Claus Ibsen <claus.ib...@gmail.com> wrote:

> Hi
>
> What version of Camel do you use?
>
>
> On Thu, Mar 1, 2018 at 9:12 AM, satyanarayana katta
> <saty.pra...@gmail.com> wrote:
> > Hi,
> >
> > I was trying to use the Camel Salesforce Component for doing the Bulk
> > Upload.  All the steps of the bulk upload works fine like
> > 1. salesforce:createJob - Works fine
> > 2. salesforce:createBatch  - Works fine
> > 3. salesforce:getAllBatches - Works fine
> > 4. salesforce:getBatch - Always FAILS
> > 5. salesforce:getResults - Works fine
> >
> > Currently we are skipping the step 4 step and always using the step 3 to
> > get all the batches to see the status.
> >
> > After a little debugging found that getBatch is always failing with time
> > outs
> >
> > I am using the producerTemplate to send the request and the code is
> simple
> >
> > template.requestBody("salesforce:getBatch", batchInfo, BatchInfo.class);
> >
> > Please help.
> >
> > Regards,
> >
> > Satya
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>

Reply via email to