Hello Christophe,
I expected a failure or fault to be thrown in response to the timeout. It just
doesn't happen. I've tried several variants using fault handlers
The Invoke activity does not give a timeout because of being unreachable. The
corresponding WebService is found and accepts the connection.
The Invoke activity still runs while the timeout configured in servicemix
occurs. The timeout itself is never logged, just mentioned in an exception
thrown later. The log shows the events that occured after the timeout. I
abbreviated the log and log entries and put in comments (in braces) to show
that I read from the log.
- ProcessMessageExchangeEvent: (return from the Invoke)
- VariableModificationEvent: (initialize the response variable of the Invoke)
NewValue = [message: null]
Type = dataHandling
VarName = OrderSenderResponse
- ActivityExecEndEvent: (Invoke ends)
... Later in the log the response variable of the Invoke is used to fill the
response variable of the Reply.
- ActivityEnabledEvent: (enable the assign activity)
ActivityType = OAssign
- ActivityExecStartEvent: (start the assign activity)
ActivityType = OAssign
- VariableModificationEvent: (prepare the variable modification)
NewValue = [message: null]
Type = dataHandling
VarName = output
- VariableReadEvent: (read the response variable of the Invoke)
Type = dataHandling
VarName = OrderSenderResponse
- VariableModificationEvent: (set the value into the response variable of the
Reply)
NewValue = [message: null]
Type = dataHandling
VarName = output
- ActivityExecEndEvent: (finish the assign activity)
ActivityType = OAssign
- ActivityEnabledEvent: (enable the Reply activity)
ActivityType = OReply
- ActivityExecStartEvent: (start the Reply activiy)
ActivityType = OReply
- VariableReadEvent: (read the response variable of the Reply)
Type = dataHandling
VarName = output
- ProcessMessageExchangeEvent: (process the Reply)
- ActivityExecEndEvent: (end the Reply activity)
ActivityType = OReply
... more events follow, regarding other activities
After logging of these events the following exception occurs.
10:21:57,761 ERROR [onent.servicemix-http-thread-3]
org.apache.servicemix.http.HttpComponent - Error processing exchange
org.apache.servicemix.jbi.runtime.impl.InOutImpl@4d0e1da2
java.lang.Exception: HTTP request has timed out
at
org.apache.servicemix.http.processors.ConsumerProcessor.process(ConsumerProcessor.java:97)
at
org.apache.servicemix.soap.SoapEndpoint.process(SoapEndpoint.java:368)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:627)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:598)
at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchangeInTx(AsyncBaseLifeCycle.java:478)
at
org.apache.servicemix.common.AsyncBaseLifeCycle$2.run(AsyncBaseLifeCycle.java:347)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
My interpretation of this log is that the process did not recognize the timeout
configured for the servicemix. No failure and no fault are thrown in response
to the timeout. The exception thrown in ConsumerProcessor.process is never
reflected in the state of the process instance. Also, the database does not
hold any fault in the respective table.
It looks like the exception is not properly considered by the process. At least
not when using JBI and servicemix.http.
While assembling the information for this e-mail I talked to a colleague and he
came up with the idea to check for an empty variable before trying to assign
the Invoke response to the Reply response. If I find the variable to be empty I
throw a fault. That way the process status is adjusted.
Thank you for your input. The workaround is good enough for now to ensure
proper handling of the process.
Best regards,
Uwe
-----Ursprüngliche Nachricht-----
Von: Christophe Noel [mailto:[email protected]]
Gesendet: Mittwoch, 18. Mai 2011 09:52
An: [email protected]
Betreff: RE: How to handle a timeout provoked by a long-running Invoke activity
Hello Uwe,
What I don't understand in your mail is
>> - After the Invoke finally returns the second Assign reads an empty variable
Any Invoke request that gets a time out would throw an Exception, and if the
Exception is not catched, the workflow will terminate.
Kind regards,
Christophe.
-----Original Message-----
From: Uwe Bachmann [mailto:[email protected]]
Sent: mercredi 18 mai 2011 09:38
To: [email protected]
Subject: AW: How to handle a timeout provoked by a long-running Invoke activity
Designing the process asynchronously would avoid the problem. Unfortunately the
WebService called synchronously is specified by a business partner. The state
returned effects the client initiating the call. After this synchronous part
the process already defines asynchronous communication with said business
partner - which fails after the process is in the inconsistent state.
I was hoping to find a solution using synchronous communication reliably.
Any suggestions?
Thanks,
Uwe
-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]]
Im Auftrag von Jean-Claude Moissinac
Gesendet: Dienstag, 17. Mai 2011 21:52
An: user
Betreff: Re: How to handle a timeout provoked by a long-running Invoke activity
Asynchronicity seems to be the concept
Is it possible with ODE to have the following behavior:
the process returns quickly and another call is there to get a state of the
result and to get the result if it is ready
On Tue, May 17, 2011 at 2:36 PM, Uwe Bachmann <[email protected]> wrote:
> Rafal,
>
> thank you for your reply.
>
> I would rather not increase the timeout. First, the client should not have to
> wait too long and get an error after an adequate time. Second, it would not
> avoid the inconsistency between the state of the caller and the BPEL process
> instance, just make it less likely to hit the timeout.
>
> I tried to set exitOnStandardFault to "yes" as you suggested. No change in
> behavior. It looks like neither a failure nor a fault is raised in this
> scenario.
>
> Maybe there are some other options?
>
> Thanks,
>
> Uwe
>
> -----Ursprüngliche Nachricht-----
> Von: Rafal [mailto:[email protected]]
> Gesendet: Dienstag, 17. Mai 2011 14:13
> An: [email protected]
> Betreff: Re: How to handle a timeout provoked by a long-running Invoke
> activity
>
> Hi Uwe
>
> 1. To increase timeout for response you need to set property
> mex.timeout=300000.
> You can find more information on
> http://ode.apache.org/endpoint-configuration.html.
> 2. Try set attribute exitOnStandardFault="yes" in process node
> <bpel:process name="xxxx"
> targetNamespace="xxx"
> xmlns:tns="xxx"
> xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
> expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
> queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
> exitOnStandardFault="yes"
> >
>
> Rafal
>
>
>
> On Tue, May 17, 2011 at 1:09 PM, Uwe Bachmann <[email protected]> wrote:
>> Hi,
>>
>> while browsing for timeout handling in ODE I did not find a solution for the
>> following case.
>>
>> Take a sequence: Receive - Assign - Invoke - Assign - Reply
>>
>> The Invoke returns a response that is used to prepare the reply variable.
>> Assume everything is up and running and responding properly. A timeout of 60
>> seconds is configured for the sequence to return to the calling WebService.
>> What if the Invoke activity takes longer to process than 60 seconds?
>> The timeout of the sequence hits and the caller is getting informed of the
>> timeout by a SOAP fault.
>>
>> When I simulated this case by delaying the Invoke response inside the called
>> WebService method I found the following situation:
>> - After the Invoke finally returns the second Assign reads an empty variable
>> and prepares the variable for the Reply. The Reply is executed seemingly
>> successful.
>> - In the log output an exception in
>> org.apache.servicemix.http.processors.ConsumerProcessor.process (HTTP
>> request has timed out) can be seen.
>> - The process instance is never informed of the failure. The setting of
>> faultOnFailure and/or installing fault handlers inside the Invoke or for the
>> surrounding scope don't help setting the process instance to failed state.
>>
>> Does anybody know if there is a way to handle this case properly?
>>
>> Any help is appreciated.
>>
>> Uwe
>>
>>
>>
>
>
>
- -----------------------------------------------------------------------------
E-MAIL DISCLAIMER
The present message may contain confidential and/or legally privileged
information. If you are not the intended addressee and in case of a
transmission error, please notify the sender immediately and destroy this
E-mail. Disclosure, reproduction or distribution of this document and its
possible attachments is strictly forbidden.
SPACEBEL denies all liability for incomplete, improper, inaccurate,
intercepted, (partly) destroyed, lost and/or belated transmission of the
current information given that unencrypted electronic transmission cannot
currently be guaranteed to be secure or error free.
Upon request or in conformity with formal, contractual agreements, an
originally signed hard copy will be sent to you to confirm the information
contained in this E-mail.
SPACEBEL denies all liability where E-mail is used for private use.
SPACEBEL cannot be held responsible for possible viruses that might corrupt
this message and/or your computer system.
e ------------------------------------------------------------------------------