Hi Aki, Willem

Yes, exactly, you are right, that is how it should be implemented, it's obvious
that if we have "/soapaddress" then only /soapaddress/2 or
/soapaddress should be matched
against it.
I recall now why this code is executed for SOAP requests as well, to
handle SOAP GETs like
/soapaddress/methodname/parameterValue.

Aki, in the code you posted,

for (String path : getDestinationsPaths()) {
           if (address.startsWith(path)
               && path.length() > len) {
               ret = getDestinationForPath(path);
               len = path.length();
           }
       }

It should probably be just

if (path.startsWith(adddress)

That will make sure /soapaddress destinations won't catch
/soapaddress2 requests but will /soapaddress/1.

That said, the issue of strict matching may also need to be resolved
so that one can enforce that
/soapaddress catch only /soapaddress - but that is another issue

thanks, Sergey




On Wed, May 11, 2011 at 3:32 AM, Willem Jiang <[email protected]> wrote:
> +1 to check the address path which is starting with "/rest/".
> It's more make sense for us.
>
>
> On 5/11/11 5:48 AM, Aki Yoshida wrote:
>>
>> Hi Sergey,
>> Thanks for your explanation. I suspected of such a fallback logic. But
>> should this fallback work for an arbitrary string or only for path
>> segments. For example, in your example, if the rest service is
>> registered at "/rest", a request to "/rest/1/2" should be sent to this
>> service but how about a request to "/rest234"?
>>
>> If we do not foward such a request but only foward those with the
>> matching path segments, can we just do the check for whether the
>> address path is starting with "/rest/" or identical to "/rest"?
>>
>> Thanks.
>> Regards, aki
>
>
> --
> Willem
> ----------------------------------
> FuseSource
> Web: http://www.fusesource.com
> Blog:    http://willemjiang.blogspot.com (English)
>         http://jnn.javaeye.com (Chinese)
> Twitter: willemjiang
>
> Connect at CamelOne May 24-26
> The Open Source Integration Conference
> http://camelone.com
>

Reply via email to