Author |
Message
|
TonyD |
Posted: Tue Aug 22, 2006 12:34 pm Post subject: |
|
|
Knight
Joined: 15 May 2001 Posts: 540 Location: New Zealand
|
From HELP (HTTPRequest node):
Quote: |
Set the Request timeout value. This is the length of time that the node waits for a response from the Web service. If a response is received within this time, the reply is propagated through the out terminal to the rest of the message flow. If a response is not received within this time, the input message is propagated through the failure terminal, if it is connected. If the failure terminal is not connected, and a response is not received in this time, an exception is generated.
|
|
|
Back to top |
|
 |
dilse |
Posted: Tue Aug 22, 2006 1:15 pm Post subject: |
|
|
 Master
Joined: 24 Jun 2004 Posts: 270
|
Jeff,
Thanks a lot for your reply. This is what I was exactly asking for. I was under the same impression but just wanted to make sure with grand master
ydsk,
It will go thru the Failure terminal as TonyD suggested. But this railses an interesting question for me.
Quote: |
Message Broker times out on its TimeOut value and sends it to failure terminal but what happens
on the Web Service side. After its processing the request where will the message get sent(assume processing took long time than timeout). |
Please share your thoughts,
DilSe.. _________________ DilSe..
Take life as it comes.. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Aug 22, 2006 2:00 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
As far as the web service provider is concerned, it's just an HTTP connection. So whatever happens when an HTTP connection closes before the request can be sent is whatever happens. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
dilse |
Posted: Tue Aug 22, 2006 2:46 pm Post subject: |
|
|
 Master
Joined: 24 Jun 2004 Posts: 270
|
Thank you Jeff. Things are clarified now. _________________ DilSe..
Take life as it comes.. |
|
Back to top |
|
 |
ydsk |
Posted: Wed Aug 30, 2006 12:44 pm Post subject: |
|
|
Chevalier
Joined: 23 May 2005 Posts: 410
|
Guys,
My Retry logic isn't working. We removed the webservice so that it doesn't respond when we send a HTTPRequest....and I have connected the Failure terminal of HTTPRequest node to a Compute node and the Out terminal of the Compute node back into the IN terminal of HTTPRequest node. The timeout value on the HTTPRequest node is 3 seconds.
Here is the code in the Compute node:
-------------------------------------------------------
CALL CopyEntireMessage();
SET OutputLocalEnvironment = InputLocalEnvironment ;
DECLARE Counter INTEGER CAST(Environment.Variables.RetryCount AS INT);
If Counter = 3 Then
RETURN FALSE;
Else
SET Environment.Variables.RetryCount = Counter + 1;
End If;
RETURN TRUE;
------------------------------------------------------
I initialized Environment.Variables.RetryCount to zero in a Compute node just before the HTTPRequest node.
I set the Compute Mode property to 'All' on all my compute nodes.
Am I doing something wrong here ? I am not getting any exception / error back.....pls help.
Thanks. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Aug 30, 2006 12:48 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You won't see any errors thrown here.
The flow will end when it's tried three times.
Because you told it to. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
ydsk |
Posted: Wed Aug 30, 2006 12:56 pm Post subject: |
|
|
Chevalier
Joined: 23 May 2005 Posts: 410
|
Jeff,
thanks for the response.
How can I make the flow try 3 times and then throw an exception ??
Please clarify.
Thank you.
ydsk |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Aug 30, 2006 1:47 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What does the line "RETURN FALSE;" do? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
ydsk |
Posted: Wed Aug 30, 2006 2:02 pm Post subject: |
|
|
Chevalier
Joined: 23 May 2005 Posts: 410
|
I know RETURN FALSE won't send the msg forward to the next node.
But I want the msgflow to throw an exception after trying say, 3 times. Can you pls suggest how I can achieve that ?
thank you. |
|
Back to top |
|
 |
ydsk |
Posted: Wed Aug 30, 2006 5:28 pm Post subject: |
|
|
Chevalier
Joined: 23 May 2005 Posts: 410
|
Since nobody responded here are my thoughts:
The HTTPRequest node terminals description in the manuals says ( seems to be different from the previous replies in this post by Dilse and Jeff):
1) FAILURE terminal - The output terminal to which the message is routed if a failure is detected during processing in the node.
2) ERROR terminal - The output terminal to which messages that include an HTTP status code that is not in the range 200 through 299, including redirection codes (3xx) if you have not set property Follow HTTP redirection.
Now can somebody please clarify the points I have been asking for ...
1) To what terminal does the original message go when a webservice isn't available ( Error/Failure - I need this info in order to code retry-logic) ?
2) And what all trees ( LocalEnvironment, ExceptionList, etc) go with it so we can access them ? ( LocalEnvironment has the URL populated in it so, do I need to copy it to OutputLocalEnvironment using a Compute node wired to Failure/Error terminals?).
3) Do we need to check for any specific HTTP return codes in HTTPResponseHeader when we code the retry-logic ?
4) When a HTTPRequest node doesn't get a response back from webservice within the configured time , is it considered a failure within the HTTPRequest node OR a failure outside ( i mean the webservice) ?
It's confusing me ... the more I read about them the more I am confused. Appreciate any explanation here. Appreciate any sample code too.
Thanks very much.
ydsk. |
|
Back to top |
|
 |
mgk |
Posted: Thu Aug 31, 2006 3:15 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1647
|
Hi,
The way to think of this is that the HTTPError terminal is only used if the remote server returns an HTTP error to you. For this to happen, you must have connected to the server, therefore it must be up and available. This means that network errors (server not found) or timeouts (did not respond in the allocated time) go to the failure terminal. The contents of the message trees at the failure terminal is the same for the failure terminal of all node, and I think the docs make it clear what that it. You can always try this and see what happens - simply set the URL to be a none existent server and place a trace node after thefailure terminal to see what is sent.
Regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
|