Though I set the timeout property to my pub.client:http, it still hangs.
Is there any param that I can set to make the program come out of http if it does not
respond to me in certain amount of time?
Though there are some threads that have this topic, I didn’t get the clear answer.
How to make my program not hang at the call to http and come out after certain defined time?
I have posted the same in “flow and java services section” , but didn’t receive response. So posting here again.
Are you doing http:post or get method??what are you trying to transfer xmlstring or largefile bytes/stream etc…??Are you sure that the target server connection/response working fine??Are you connecting outside dmz or internal to dmz??
Do you see any transient/networks errors in the audit/server logs during this hung??
If the server you are posting to is not down, but does not respond or acknowledge your post, then pub.client:http will block until the HTTP timeout limit is set (not sure what the watt.server.* property is for this).
One technique for dealing with this is to create a flow that does only the pub.client:http and then invoke that service on its own thread. The parent flow would use pub.sync:wait to retrieve the results returned by the child services pub.sync:notify call. A timeout can be set on pub.sync:wait that will throw an exception after the specified elapsed time has passed. By catching this “wait timed out” exception you can handle it specifically or simply let the parent service throw it if you don’t want to do anything unique with that exception.
Of course, it goes without saying that the root issue here is that the target server is not behaving properly. That error should be addressed with the provider of the web server first before writing code to handle non-compliant behavior.
One more thing… your original post was made around 2AM Eastern time. Getting upset because no one responded to you immediately is probably not the best way to get help here in the future.
Can you go with TN and use its retry mechanism(if delivery task fails) and to do this you may have to use TN HTTP delivery method instead of builtin client:http service call.But may be its too late for you moving your docs routing via TN… just in case…
Here is the information that is posted in advantage for similar problem:
the pub.remote:invoke, uses the java.net.URLConnection class. This class has a known limitation in it, meaning that it does not have a timeout that can be set from code. It appears that this has been changed in JDK 1.5 but for now it looks like you’ll have to use the following properties to be able to use the functionality desired.
Also this limitation is only exposed when the the physical machine that is being tried to connect to has no connectivity, i.e. network cable unplugged or machine outage.
But my question here is, I am using “pub.client.http”. Will the above hold for client.http flow service too. My request is waiting around 3min before it comes out. I want it to wait not more than 1 min. Because our partner has a scheduled down time and we don’t want to load up our queues.