POJO-SE: Invoking @OnDone manually and continue executing on @OnError/Fault

2 messages Options
Embed this post
Permalink
rjoshi

POJO-SE: Invoking @OnDone manually and continue executing on @OnError/Fault

Reply Threaded More More options
Print post
Permalink
Girish,
  thanks for the information about sequential mode. Until sequential execution is available, I am planning to implement using queue where all objects are queued in the for loop and 1st service is invoked.  When response is received, I will poll object from queue and invoke next service.

On certain conditions, I need to trigger @OnDone function call. Is there anyway to trigger let POJO-SE to trigger @OnDone function manually?

@OnError and @OnFault:  When error or fault occurs,  I want to grace fully handle and continue invoking  remaining services which I can do by invoking next service from the queue but it seem @OnError and @Fault, POJO-SE will abort all outstanding responses and OnDone method which means I won't be able to invoke next services as well I have to do some special billing logs when it is done which will not happen. Is it correct?

http://wiki.open-esb.java.net/Wiki.jsp?page=POJOSEConsumingAsynchronously
Whenever POJO throws FaultMessage, ErrorMessage or Exception back to POJO SE, POJO SE will return fault message or error status back to POJO service consumer. Further execution of callback and OnDone methods will be aborted and outstanding responses from asynchronously consumed services by this POJO instance will be ignored and where possible error status returned.

Thanks,
Rohit Joshi
Girish Patil-2

Re: POJO-SE: Invoking @OnDone manually

Reply Threaded More More options
Print post
Permalink
rjoshi wrote:
> Girish,
>   thanks for the information about sequential mode. Until sequential
> execution is available, I am planning to implement using queue where all
>  
I realized even sequential execution the way we (Frank & I) were
thinking may not satisfy your use-case, where you expect response
message from consumed service before consuming another service.
> objects are queued in the for loop and 1st service is invoked.  When
> response is received, I will poll object from queue and invoke next service.
>
> One requirement I have is on certain conditions, I need to trigger @OnDone
> function call. Is there anyway to trigger let POJO-SE to trigger @OnDone
> function manually?
>  
Currently OnDone is executed only when all the outstanding response
messages are received with "out", "done" or "error" status. On "error"
status, OnError method if present is executed. If POJO service itself
throws exceptions/ErroMessage/FaultMessage while executing Operation,
OnReply, OnError or  OnFault, OnDone method is never called.

I am not sure exactly on condition you want to force execution of
OnDone. May be you need to send response message prematurely from your
service before receiving all response. You can even now should be able
to send FaultMessage back before all responses from consumed services
are received.  Sending/throwing  normal "out" message instead fault
matches your requirement?
> Thanks,
> Rohit Joshi
>  

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]