Topic
  • 6 replies
  • Latest Post - ‏2016-04-07T23:17:58Z by HermannSW
SystemAdmin
SystemAdmin
6772 Posts

Pinned topic tcp ... timeout vallue with dp url open

‏2013-01-24T17:48:29Z |
Hi,
We're utilizing dp:url-open and doing a tcp connection to connect to one of the backend system. We're specifying timeout value.
This value means closing the connection after like say if the value was 30 sec...it closes after 30 seconds. but this doesn't mean that even through we got the response well before 30 seconds ..hold it until 30 sec and then send the response ?. It isn't like that right ?. That value is not to hold the response ( as soon as we get the resp we send it to client ) but wait until that timeout value and close the connection after that time. Please let me know.

Thanks!
Salla
Updated on 2013-01-25T14:17:11Z at 2013-01-25T14:17:11Z by SystemAdmin
  • swlinn
    swlinn
    1396 Posts

    Re: tcp ... timeout vallue with dp url open

    ‏2013-01-24T19:29:25Z  
    Hi Salla,
    You're correct, the url-open timeout will not "hold" any response. If you don't have a response in that time, the url-open will time out and you'll get an error in your url-open response data.

    Regards,
    Steve
  • SystemAdmin
    SystemAdmin
    6772 Posts

    Re: tcp ... timeout vallue with dp url open

    ‏2013-01-25T14:17:11Z  
    • swlinn
    • ‏2013-01-24T19:29:25Z
    Hi Salla,
    You're correct, the url-open timeout will not "hold" any response. If you don't have a response in that time, the url-open will time out and you'll get an error in your url-open response data.

    Regards,
    Steve
    Thanks so much Steve!

    Regards,
    Salla
  • jainnitin10
    jainnitin10
    2 Posts

    Re: tcp ... timeout vallue with dp url open

    ‏2016-04-07T08:23:08Z  

    I am giving timeout too. But looks like its not working. I have specified 5 seconds, and we intentionally down the target URL, still we are getting error within a seconds. Looks like, datapower is not using timeout value. Here is my request: 

     

    <dp:url-open target="{$CallURL}" 
                                         response="xml" 
                                         data-type="xml" 
                                         http-method="post" 
                                         content-type = "text/plain; charset=utf-8"
                                         timeout="5">
                                                                            
                                         <xsl:copy-of select="/" />
            </dp:url-open>
                      
           
    
  • HermannSW
    HermannSW
    6379 Posts

    Re: tcp ... timeout vallue with dp url open

    ‏2016-04-07T12:29:40Z  

    I am giving timeout too. But looks like its not working. I have specified 5 seconds, and we intentionally down the target URL, still we are getting error within a seconds. Looks like, datapower is not using timeout value. Here is my request: 

     

    <pre dir="ltr" style="color: rgb(0, 0, 0); line-height: normal; word-wrap: break-word; white-space: pre-wrap;"><dp:url-open target="{$CallURL}" response="xml" data-type="xml" http-method="post" content-type = "text/plain; charset=utf-8" timeout="5"> <xsl:copy-of select="/" /> </dp:url-open> </pre>

    Hi,

    DataPower does use timeout value, but it does check the connection before it even tries to execute the <dp:url-open> and aborts in your case.

    For testing the timeout go against a URL that does not answer.
    In the past my samples did uswe "http://1.2.3.4" as URL -- until I realized that this IP belongs to an Australian Google server.
    Since then I do use "http://255.255.255.254" in order to get a @timeout long XSLT delay:
    https://www.ibm.com/developerworks/community/blogs/HermannSW/entry/adding_latency_during_service_development_for_backend_simulation94

    Please do that only for dev+test, not for production.


    Hermann.

  • jainnitin10
    jainnitin10
    2 Posts

    Re: tcp ... timeout vallue with dp url open

    ‏2016-04-07T12:54:42Z  
    • HermannSW
    • ‏2016-04-07T12:29:40Z

    Hi,

    DataPower does use timeout value, but it does check the connection before it even tries to execute the <dp:url-open> and aborts in your case.

    For testing the timeout go against a URL that does not answer.
    In the past my samples did uswe "http://1.2.3.4" as URL -- until I realized that this IP belongs to an Australian Google server.
    Since then I do use "http://255.255.255.254" in order to get a @timeout long XSLT delay:
    https://www.ibm.com/developerworks/community/blogs/HermannSW/entry/adding_latency_during_service_development_for_backend_simulation94

    Please do that only for dev+test, not for production.


    Hermann.

    Thanks Herman for looking into this. You always are very helpful and doing really a good job.

     

    However, the way which you suggested, it will add latency and as you said, on production it is not recommended at all.

     

    Although, I am very curious, there should definitely a way to hold transaction for some second, so that if backend is not reachable in first go, after some retry, connection might be established. this "timeout" tag is defined in the request example given by IBM itself. So is there any way, if we want to wait for 5 second and then timed out.

  • HermannSW
    HermannSW
    6379 Posts

    Re: tcp ... timeout vallue with dp url open

    ‏2016-04-07T23:17:58Z  

    Thanks Herman for looking into this. You always are very helpful and doing really a good job.

     

    However, the way which you suggested, it will add latency and as you said, on production it is not recommended at all.

     

    Although, I am very curious, there should definitely a way to hold transaction for some second, so that if backend is not reachable in first go, after some retry, connection might be established. this "timeout" tag is defined in the request example given by IBM itself. So is there any way, if we want to wait for 5 second and then timed out.

    <dp:url-open> aborts if no connection is possible before start -- you have to do the retry in error rule.

    Hermann.