Skip to Content
0

How to use Router in HCI

Jan 23, 2017 at 03:08 AM

1k

avatar image

Hi Experts,

This is my scenario:

The Process Call will call a local process that would call a RESTful GET web service. The response of the web service is either HTTP Status 200 or 206. Hence, I used the following condition in my Router: ${header.CamelHttpResponseCode} = '200' for OK. NOT OK is the default since the initial call always ends up in this status so I have to loop the call again until it becomes 200 / OK.

When I try deploy the iFlow, I'm not getting any errors but it's not getting deployed.

If I remove the Router and simply routes the Reply to the End event, it's getting deployed successfully.

Any ideas why? Did I use the router here incorrectly? I've also tried using it in the parent process but to no avail.

Thanks in advance!

capture.png (70.3 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
Sriprasad Shivaram Bhat Jan 23, 2017 at 07:05 AM
0

Hello Mark,

There is a way to do it.Its not required to have Router in this Location Integration Process.

I guess you want to loop this Local Integration Process to make sure you will go ahead once you get the status code 200 OK.You can right click on the Process Call and make it as Looping Process.When you get a HTTP Response Code as 206 looping process will get triggered again and when it returns you 200 call will get completed sending back the data to main integration process.

Regards,

Sriprasad Shivaram Bhat


Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Sriprasad,

Thanks for the info. Yep, I've actually tried that as well as shown in the snapshot but it doesn't seem to iterate. Since the first call always ends up in 206, I'm expecting the Process Call to trigger the Local Integration Process but it just moves forward to the last Modifier right away.

capture3.png (88.3 kB)
0
Sriprasad Shivaram Bhat Jan 23, 2017 at 05:18 AM
0

Hello Mark,

Could you please check in your Component status overview once ,if Integration project in error could you please share the tail log.

Regards,

Sriprasad Shivaram Bhat

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Sriprasad,

The Runtime Status is 'started' and Sync Status is 'synchronized'. But in the deployed artifact, the Deployed On time is never updated.

0

Hi Sriprasad,

If I point the Router to both End Events, then I can deploy the iFlow successfully. So I guess it's not possible to assign the Router to a Request Reply Service call. In that case, how can I make a loop to trigger the GET request while it's still not 200?

capture2.png (24.2 kB)
0
Sriprasad Shivaram Bhat Jan 23, 2017 at 07:28 AM
0

Hello Mark,

I have tried the above one it worked fine for me it works like While() loop.Could you please share the output after the Process Call I think it should have both 200 and 206 status code response.

Regards,

Sriprasad Shivaram Bhat

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Sriprasad,

Would I see this in the Trace? In the final Content Modifier, I created a body that will be filled with the status code.

And everytime I run it, I always get 206.

capture4.png (92.4 kB)
result.png (2.8 kB)
0
Sriprasad Shivaram Bhat Jan 23, 2017 at 07:55 AM
0

Hello Mark,

Yes I got your point it works as While() loop not Do..While () .I can see 2 messages just before Request Reply can you verify whether it contains both 200 and 206 responses,can you just verify those.?

If both the status messages are present Looping Process works fine and it will return the messages which satisfied the condition and it will not return when condition gets failed.

Let me check on the earlier solution which you proposed and revert back with my findings or any options.

Regards,

Sriprasad Shivaram Bhat

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Sriprasad,

Oh yeah it's working. I tried again and there are 100 messages in the trace. The status is still 206 after 100 iterations. Guess I need to add some script to delay/sleep since it takes a while until a request gets 200 status.

Thanks!

0

Hello Mark.

Good to hear that i think you can change that no of iterations to 99999( Max Value ),so that it will be looped till you get 200 status code.

Regards,

Sriprasad Shivaram Bhat

0