Claus: I believe many components have the option of setting timeout. HTTPClient used by HTTP component internally have a timeout setting (HttpConnectionParams.setConnectionTimeout(): http://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/params/HttpConnectionParams.html#setConnectionTimeout(int)
Same may be the case for FTP/SFTP. My problem is if a client has a bad server and does not release the connection, my delivery queues start filling up since the outbound message delivery component (like HTTP/SFTP) is stuck in a timeout. If the underlying layer does not have an easy timeout setting then it becomes difficult. Your idea of a separate thread to monitor timeout may be necessary. But still, is there any way we know for sure that the connection has timed out or it is busy transferring a huge chunk of data? As a user, the best scenario for me is to have a -Dorg.camel.CONNECT_TIMEOUT=XX and -Dorg.camel.READ_TIMEOUT=XX system properties that will set the connect / read timeouts. What do you think? Hari Gangadharan Architect, Globalstar http://www.harinair.com Claus Ibsen-2 wrote: > > Hi > > > On Thu, May 21, 2009 at 9:49 PM, harinair <[email protected]> wrote: >> >> I am using Camel to send messages from a Queue to external vendors. The >> protocol can be FTP/SFTP/HTTP or HTTPS. However sometimes the queue >> starts >> filling up which means that the messages are not getting drained. My >> feeling >> is the connection to a particular external vendor is stuck because the >> timeout is not properly set. My DSL is similar to: >> <bean id="dataPushErrorHandler" >> class="org.apache.camel.builder.DeadLetterChannelBuilder"> >> <property name="defaultDeadLetterEndpointUri" >> value="seda:routerDeliveryAttempt1Queue" /> >> <property name="redeliveryPolicy" ref="dataPushRedeliveryPolicy" >> /> >> </bean> >> >> <!-- Deliver the Live Data Push - Channel A data --> >> <route errorHandlerRef="dataPushErrorHandler"> >> <from ref="routerDeliveryChannelAQueue" /> >> <process ref="securityHeaderGenerator" /> >> <to ref="routerLogDefault" /> >> <recipientList> >> <xpath resultType="java.lang.String">$routerRoute</xpath> >> </recipientList> >> <to uri="bean:responseVerificationProcessor?method=process" /> >> </route> >> >> >> Now my questions is - is there any easy global parameter to set the >> timeout >> for all network operations done by Camel? If there is not is there any >> way I >> can set timeout for FTP/SFTP/HTTP modules? Is it a good idea to add a >> global >> timeout or to use sun.net.client.defaultConnectTimeout and >> sun.net.client.defaultReadTimeout? > > Yeah timeout setting is actually hard as well. > You got the OS level, the JVM, the JVM system properties, the > framework and then Camel as well. > And they all got different/independent timeout and whatnot. > > > A general timeout feature does not exists in Camel. Some of the > transports offer a timeout. > - JMS > - Mina > - and maybe some others but I cannot remember. But its documented in > the wiki if they have a timeout option > > However we could consider having a Camel timeout feature so Camel at > least could and indicate a timeout error. > However its not easy to do with all protocols. And we need some latch > around that can trigger when a timeout occur. > > But I do think we could add something to the SendToProcessor that can > support a custom Camel timeout that kinda overrule any other. > But this requires a latch and to use a different thread for sending. > Or am I wrong on this? > > Any thought? > > > > >> >> Hari Gangadharan >> -- >> View this message in context: >> http://www.nabble.com/Camel-stuck-periodicallly---HTTP-timeout-issue-tp23659334p23659334.html >> Sent from the Camel - Users mailing list archive at Nabble.com. >> >> > > > > -- > Claus Ibsen > Apache Camel Committer > > Open Source Integration: http://fusesource.com > Blog: http://davsclaus.blogspot.com/ > Twitter: http://twitter.com/davsclaus > > -- View this message in context: http://www.nabble.com/Camel-stuck-periodicallly---HTTP-timeout-issue-tp23659334p23732505.html Sent from the Camel - Users mailing list archive at Nabble.com.
