You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by gargankur007 <ga...@gmail.com> on 2015/06/04 16:44:06 UTC

Using loop EIP to solve a Usecase

Hi
 
I have a usecase in which I have a route which takes m number of rest URLS'
as input and then hits each of these URLS's n number of times each until
response code comes out to be 204.

So hit a URL until 204 is response code and if it returns 204 move on to
next URL and apply same procedure.

I tried to use loop EIP but it did not work.Please suggest.



--
View this message in context: http://camel.465427.n5.nabble.com/Using-loop-EIP-to-solve-a-Usecase-tp5767874.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Using loop EIP to solve a Usecase

Posted by gargankur007 <ga...@gmail.com>.
It worked fine.Thanks Claus..:)



--
View this message in context: http://camel.465427.n5.nabble.com/Using-loop-EIP-to-solve-a-Usecase-tp5767874p5767943.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Using loop EIP to solve a Usecase

Posted by gargankur007 <ga...@gmail.com>.
Hi Claus

If I am using a dynamic router to direct to same component from where
message originated it is going into infinite loop
Below is the log
23:29:13,492 | INFO  | E-URL.readQueue] | SLAEventNotifer                  |
142 - org.apache.camel.camel-core - 2.12.0.redhat-610379 | [Message
Id:ID:HC14-123-61966-1433526836329-5:8:1:1:1-1] From
:activemq://queue:RMHP.OUTBOUND_EDI_FLOW_LOOPER.CHECK.DATA-GET-MULTIPLE-URL.readQueue
To:
activemq://queue:RMHP.OUTBOUND_EDI_FLOW_LOOPER.CHECK.DATA-GET-MULTIPLE-URL.readQueue
23:29:26,761 | INFO  | E-URL.readQueue] | SLAEventNotifer                  |
142 - org.apache.camel.camel-core - 2.12.0.redhat-610379 | [Message
Id:ID:HC14-123-61966-1433526836329-5:8:1:1:1-1] From
:activemq://queue:RMHP.OUTBOUND_EDI_FLOW_LOOPER.CHECK.DATA-GET-MULTIPLE-URL.readQueue
To:
activemq://queue:RMHP.OUTBOUND_EDI_FLOW_LOOPER.CHECK.DATA-GET-MULTIPLE-URL.readQueue





--
View this message in context: http://camel.465427.n5.nabble.com/Using-loop-EIP-to-solve-a-Usecase-tp5767874p5767919.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Using loop EIP to solve a Usecase

Posted by gargankur007 <ga...@gmail.com>.
HI Claus

I have used dynamic router now.

It helped a lot..

Please help me solve
"http://camel.465427.n5.nabble.com/Document-Style-bare-WSDL-not-working-in-camel-cxf-td5767867.html"
as well



--
View this message in context: http://camel.465427.n5.nabble.com/Using-loop-EIP-to-solve-a-Usecase-tp5767874p5767904.html
Sent from the Camel - Users mailing list archive at Nabble.com.

AW: Using loop EIP to solve a Usecase

Posted by "Jan Matèrne (jhm)" <ap...@materne.de>.
Just a thought ...


from("direct:loop")
    .process(
        // set special header if loop should continue
    );
    .switch()
        .when( specialHeaderIsSet ).to("direct:loop")
        .otherwise("direct:nextStep")
;



Jan



> -----Ursprüngliche Nachricht-----
> Von: gargankur007 [mailto:gargankur007@gmail.com]
> Gesendet: Freitag, 5. Juni 2015 08:56
> An: users@camel.apache.org
> Betreff: Re: Using loop EIP to solve a Usecase
> 
> Can I stop the loop in between based on some condition?
> 
> So I fix the number of iterations to high number and then based on some
> condition terminate the loop early.
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/Using-
> loop-EIP-to-solve-a-Usecase-tp5767874p5767894.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Using loop EIP to solve a Usecase

Posted by gargankur007 <ga...@gmail.com>.
Can I stop the loop in between based on some condition?

So I fix the number of iterations to high number and then based on some
condition terminate the loop early.



--
View this message in context: http://camel.465427.n5.nabble.com/Using-loop-EIP-to-solve-a-Usecase-tp5767874p5767894.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Using loop EIP to solve a Usecase

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

The loop is for a fixed number of iterators, its not dynamic.

Instead you can take a look at dynamic router
http://camel.apache.org/dynamic-router.html

On Thu, Jun 4, 2015 at 4:44 PM, gargankur007 <ga...@gmail.com> wrote:
> Hi
>
> I have a usecase in which I have a route which takes m number of rest URLS'
> as input and then hits each of these URLS's n number of times each until
> response code comes out to be 204.
>
> So hit a URL until 204 is response code and if it returns 204 move on to
> next URL and apply same procedure.
>
> I tried to use loop EIP but it did not work.Please suggest.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Using-loop-EIP-to-solve-a-Usecase-tp5767874.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/