[
https://issues.apache.org/jira/browse/CAMEL-14650?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17053983#comment-17053983
]
Pascal Schumacher commented on CAMEL-14650:
-------------------------------------------
Hi Djordje,
you can use:
{code:java}
from("timer:foo?period=3600000")
.to("https://swapi.co/api/films")
.split().jsonpath("$.results[*].episode_id").streaming()
.convertBodyTo(String.class)
.setHeader(Exchange.HTTP_METHOD).constant(HttpMethods.GET)
.setHeader(Exchange.HTTP_PATH).simple("${body}")
.to("https://swapi.co/api/films")
.log("${body}")
.end();
{code}
instead and only a single ClientConnectionManager etc. will be created.
Or if you need to poll different hosts (different HTTP_URI), use:
{code:java}
from("timer:foo?period=3600000")
.setHeader(Exchange.HTTP_URI).constant("https://swapi.co/api/films")
.toD("${headers." + Exchange.HTTP_URI + "}")
.split().jsonpath("$.results[*].episode_id").streaming()
.convertBodyTo(String.class)
.setHeader(Exchange.HTTP_METHOD).constant(HttpMethods.GET)
.setHeader(Exchange.HTTP_PATH).simple("${body}")
.toD("${headers." + Exchange.HTTP_URI + "}")
.log("${body}")
.end();
{code}
instead and only a single ClientConnectionManager will be created for each host.
> camel-http - unnecessary logging in component
> ---------------------------------------------
>
> Key: CAMEL-14650
> URL: https://issues.apache.org/jira/browse/CAMEL-14650
> Project: Camel
> Issue Type: Bug
> Components: camel-http
> Affects Versions: 3.1.0
> Reporter: Djordje Bajic
> Priority: Trivial
> Labels: camel-http
> Fix For: 3.2.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> When sending request this is logged
> {code:java}
> (INFO) o.a.camel.component.http.HttpComponent : Created
> ClientConnectionManager org.apache.http.impl.conn{code}
> It should be set to DEBUG log level.
> Sample route:
> {code:java}
> from("timer:foo?period=3600000")
> .setHeader(HTTP_URI).constant("https://swapi.co/api/films")
> .toD("${headers." + HTTP_URI + "}")
> .split().jsonpath("$.results[*].episode_id").streaming()
> .convertBodyTo(String.class)
> .setHeader(HTTP_METHOD).constant(GET)
>
> .setHeader(HTTP_URI).simple("https://swapi.co/api/films/${body}")
> .toD("${headers." + HTTP_URI + "}")
> .log("${body}")
> .end();
> {code}
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)