Hi Sanjiva,

I will try my best. :-)

Here is a WS-RM scenario that currently doesn't work,

Client                                          Server
------                                          ------
   |               1. Response                    |
   |  <-----------------------------------------  |
   |               2. Ack                         |
   |  ---------------------------->X              |
   |               3. Duplicate                   |
   |  <-----------------------------------------  |
   |               4. Ack                         |
   |  ----------------------------------------->  |
   |                                              |
   |                                              |

In this scenario the server sends a response message to the client. The 
client then tries to send an acknowledgement to the server, but the 
acknowledgement gets lost, for whatever reason. This means that the WS-RM 
layer, in the server, will eventually time-out and send the response 
message again. This time the client should send an acknowledgement to 
cover both the original and the duplicate response messages.

This scenario is broken because the duplicate response never makes it to 
the WS-RM layer on the client side, because the AddressingBasedDispatcher 
recognises it as a duplicate and throws an exception instead. This means 
that the WS-RM layer never gets driven to send the second acknowledgement. 
The result is that the server will simply keep sending duplicate responses 
forever (almost)!

In order to get this scenario to work the AddressingBasedDispatcher will 
need to dispatch any duplicate messages as normal, instead of deciding 
that they are 'bad' and throwing an exception. This will allow WS-RM to be 
easily added into the picture at any time. This also means that if there 
is no WS-RM engaged then a service will potentially be driven more than 
once if there are duplicate messages (created by some other means). This 
shouldn't be a problem, however, because web services are meant to be 
stateless entities anyway :-) If you do happen to have a web service that 
is not stateless then you will need to engage WS-RM to ensure that it is 
not driven by duplicates.

I hope this helps.

Cheers

Brian DePradine
Web Services Development
IBM Hursley
External  +44 (0) 1962 816319         Internal 246319

If you can't find the time to do it right the first time, where will you 
find the time to do it again?


Sanjiva Weerawarana <[EMAIL PROTECTED]> wrote on 02/03/2007 02:57:26:

> Hi Brian,
> 
> That doesn't make sense to me- if the MEP has completed then the message 

> is arriving after everything has happened. The MEP would not have been 
> marked complete unless RM successfully delivered the message to the 
receiver.
> 
> So if after that a message arrives referring to a completed operation 
then 
> we can reject it in addressing right away.
> 
> Can you explain a scenario where someone like WS-RM will do anything 
> useful with it? And what will happen if there's no WS-RM etc. around at 
> all and this method doesn't catch this repeated message?
> 
> Thanks,
> 
> Sanjiva.
> 
> Brian De Pradine wrote:
> > 
> > Hello,
> > 
> > Apologies for not making the intent clearer. We are not swallowing the 

> > message, but instead simply allowing it to continue on it's way 
through 
> > the flow. The idea is that we do not have enough information in the 
> > AddressingBasedDispatcher to determine that such messages are 'bad'. 
> > Instead we want to allow other layers such as WS-RM to see, and 
possibly 
> > handle, such duplicate messages.
> > 
> > Cheers
> > 
> > Brian DePradine
> > Web Services Development
> > IBM Hursley
> > External  +44 (0) 1962 816319         Internal 246319
> > 
> > If you can't find the time to do it right the first time, where will 
you 
> > find the time to do it again?
> > 
> > 
> > Sanjiva Weerawarana <[EMAIL PROTECTED]> wrote on 01/03/2007 
01:47:46:
> > 
> >  > +1 but I'm confused why we'd remove this exception .. if someone 
sends a
> >  > response message again we should be saying "nope been there done 
that
> >  > already" back to the sender. If you eat the exception and log it 
they 
> > have
> >  > no info. What is broken about the old code?
> >  >
> >  > Sanjiva.
> >  >
> >  > David Illsley wrote:
> >  > > Hi Brian,
> >  > > I think it's important that if this (message being swallowed) is
> >  > > happening, that we make it very obvous. What do you think about
> >  > > logging at a higher level than debug?
> >  > > David
> >  > >
> >  > > On 28/02/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >  > >> Author: pradine
> >  > >> Date: Wed Feb 28 09:43:07 2007
> >  > >> New Revision: 512869
> >  > >>
> >  > >> URL: http://svn.apache.org/viewvc?view=rev&rev=512869
> >  > >> Log:
> >  > >> Do something more useful than throw an exception.
> >  > >>
> >  > >> Modified:
> >  > >> 
> >  > >>
> >  > 
> > 
> 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AddressingBasedDispatcher.
> >  > java
> >  > >>
> >  > >>
> >  > >> Modified:
> >  > >>
> >  > 
> > 
> 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AddressingBasedDispatcher.
> >  > java
> >  > >>
> >  > >> URL:
> >  > >> http://svn.apache.
> >  > 
> > 
> 
org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AddressingBasedDispatcher.
> >  > java?view=diff&rev=512869&r1=512868&r2=512869
> >  > >>
> >  > >>
> >  > 
> > 
> 
==============================================================================
> >  > >>
> >  > >> ---
> >  > >>
> >  > 
> > 
> 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AddressingBasedDispatcher.
> >  > java
> >  > >> (original)
> >  > >> +++
> >  > >>
> >  > 
> > 
> 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AddressingBasedDispatcher.
> >  > java
> >  > >> Wed Feb 28 09:43:07 2007
> >  > >> @@ -137,16 +137,18 @@
> >  > >>                  log.debug(msgctx.getLogIDString()+"
> >  > >> "+Messages.getMessage("checkingrelatesto",
> >  > >>                      relatesTo));
> >  > >>              }
> >  > >> -            if ((relatesTo != null) && !"".equals(relatesTo)) {
> >  > >> +            if (relatesTo != null && !"".equals(relatesTo)) {
> >  > >>                  OperationContext operationContext =
> >  > >>                          msgctx.getConfigurationContext()
> >  > >> .getOperationContext(relatesTo);
> >  > >>
> >  > >>                  if (operationContext != null) {
> >  > >>                      if(operationContext.isComplete()){
> >  > >> -                        // If the dispatch happens because of 
the
> >  > >> RelatesTo and the mep is complete
> >  > >> -                        // we should throw a more descriptive 
fault.
> >  > >> -                        throw new
> >  > >> AxisFault(Messages.getMessage("duplicaterelatesto",relatesTo));
> >  > >> +                        if(LoggingControl.debugLoggingAllowed 
&&
> >  > >> log.isDebugEnabled()){
> >  > >> +                            log.debug(msgctx.getLogIDString()+"
> >  > >> Operation context is marked as complete. Calling cleanup on 
it.");
> >  > >> +                        }
> >  > >> +                        operationContext.cleanup();
> >  > >> +                        return InvocationResponse.CONTINUE;
> >  > >>                      }
> >  > >> 
> >  > >> msgctx.setAxisOperation(operationContext.getAxisOperation());
> >  > >> msgctx.setOperationContext(operationContext);
> >  > >>
> >  > >>
> >  > >>
> >  > >> 
---------------------------------------------------------------------
> >  > >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >  > >> For additional commands, e-mail: [EMAIL PROTECTED]
> >  > >>
> >  > >>
> >  > >
> >  > >
> >  >
> >  > --
> >  > Sanjiva Weerawarana, Ph.D.
> >  > Founder & Director; Lanka Software Foundation; 
http://www.opensource.lk/
> >  > Founder, Chairman & CEO; WSO2, Inc.; http://www.wso2.com/
> >  > Director; Open Source Initiative; http://www.opensource.org/
> >  > Member; Apache Software Foundation; http://www.apache.org/
> >  > Visiting Lecturer; University of Moratuwa; 
http://www.cse.mrt.ac.lk/
> >  >
> >  > 
---------------------------------------------------------------------
> >  > To unsubscribe, e-mail: [EMAIL PROTECTED]
> >  > For additional commands, e-mail: [EMAIL PROTECTED]
> >  >
> > 
> > 
> > 
> > 
------------------------------------------------------------------------
> > 
> > /
> > /
> > 
> > /Unless stated otherwise above:
> > IBM United Kingdom Limited - Registered in England and Wales with 
number 
> > 741598.
> > Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 
3AU/
> > 
> > 
> > 
> > 
> > 
> > 
> 
> -- 
> Sanjiva Weerawarana, Ph.D.
> Founder & Director; Lanka Software Foundation; http://www.opensource.lk/
> Founder, Chairman & CEO; WSO2, Inc.; http://www.wso2.com/
> Director; Open Source Initiative; http://www.opensource.org/
> Member; Apache Software Foundation; http://www.apache.org/
> Visiting Lecturer; University of Moratuwa; http://www.cse.mrt.ac.lk/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 






Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU





Reply via email to