You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Thibaut Robert <th...@gmail.com> on 2015/09/24 17:57:20 UTC

cxfrs endpoint is not singleton, bus caching issue

Hi,

I am wondering if there is a reason to have cxfrs endpoint declared as not
singleton.
My concern is that I am using a producer template to send rest request to a
dynamic URI like this: template.requestBodyAndHeaders("cxfrs:" +
destination, ...) // destination="http://remote/service"

Each time a request is performed, a new endpoint is created, even if the
uri has already been called before. The endpoint creation turn itself into
a cxf bus instance creation, which is costly.

I think I can specifiy a bus ref is the URI to avoid this, but this was
really an unexpected behavior from my point of view ! Should this be
improved ?

Thanks,
Thibaut

Re: cxfrs endpoint is not singleton, bus caching issue

Posted by Claus Ibsen <cl...@gmail.com>.
Yeah 99% should be singleton's and only in rare cases they should not be.



On Thu, Sep 24, 2015 at 5:57 PM, Thibaut Robert
<th...@gmail.com> wrote:
> Hi,
>
> I am wondering if there is a reason to have cxfrs endpoint declared as not
> singleton.
> My concern is that I am using a producer template to send rest request to a
> dynamic URI like this: template.requestBodyAndHeaders("cxfrs:" +
> destination, ...) // destination="http://remote/service"
>
> Each time a request is performed, a new endpoint is created, even if the
> uri has already been called before. The endpoint creation turn itself into
> a cxf bus instance creation, which is costly.
>
> I think I can specifiy a bus ref is the URI to avoid this, but this was
> really an unexpected behavior from my point of view ! Should this be
> improved ?
>
> Thanks,
> Thibaut



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2nd edition: https://www.manning.com/books/ibsen2