Re: Camel enrich+simple+http4 endpoint open too many connections

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: Camel enrich+simple+http4 endpoint open too many connections

Claus Ibsen-2
Hi

Yes its expected and standard behaviour as you create a new unique
endpoint. Instead use a static endpoint and set a header with the
dynamic context-path. There are various HTTP headers you can find on
Exchange you can use to set that.

On Sun, Jul 28, 2019 at 3:14 PM Martin Pelikán <[hidden email]> wrote:

>
> Hello Camel riders,
>
> We found issue when enrich/simple/http4 component opens new TCP connection for each different endpoint it invokes. Case unfortunately happens even when invoking url like:
>
> https://localhost/api/v1/user/${id}<https://localhost/api/v1/user/$%7bid%7d>
>
> and id will change on every request. Connection is reused only when url exactly matches. We experienced these connections not to be closed properly and causing Sockets in unknown state – hung up.
>
> Troublesome code:
>
> <enrich>
>   <simple>${header.targetUrl}</simple>
> </enrich>
>
> And header.targetUrl = https4://localhost/..
>
> Https4 component is registered beforehand as new bean including sslContextParameters bean.
>
> More details:
> https://github.com/pelikanmartin/camel-enrich-too-many-connections
>
> Is it standard behavior?
>
> Thank you,
> Martin
>


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