Why are you trying to watch a configmap with http component, when there is
a consumer for the events related to specific configmap?

Il sab 14 set 2019, 18:13 Imran Raza Khan <imranrazak...@gmail.com> ha
scritto:

> I am using [kubernetes rest api][1] API to watch configmap and calling it
> with http4 component, but http4 is not forwarding exchange further in
> route, from logs i observed that http4 keep getting updates from openshift
> on first open connection as its not closing connection so dont forward
> exchange further, how i can get this data down in route
>
>     from("timer://foo?fixedRate=true&period=60000")
>     .setHeader("Authorization", simple("Bearer xxx"))
>     .setHeader("Accept", simple("application/json"))
>     .setHeader("CamelHttpMethod", constant("GET"))
>
>
> .to("https4://localhost:8443/api/v1/watch/namespaces/my-qa/configmaps/my-config-map?httpClientConfigurer=#trustCert")
>     .to("log:my?showAll=true&multiline=true")
>     .to("mock:result");
>
> Trace:
>
>     [mel-1) thread #2 - timer://foo] headers                        DEBUG
> http-outgoing-0 >> GET
> /api/v1/watch/namespaces/my-qa/configmaps/my-config-map HTTP/1.1
>     [mel-1) thread #2 - timer://foo] headers                        DEBUG
> http-outgoing-0 >> Accept: application/json
>     [mel-1) thread #2 - timer://foo] headers                        DEBUG
> http-outgoing-0 >> Authorization: Bearer xxx
>     [mel-1) thread #2 - timer://foo] headers                        DEBUG
> http-outgoing-0 >> breadcrumbId: ID-NB-118-1568476509695-0-1
>     [mel-1) thread #2 - timer://foo] headers                        DEBUG
> http-outgoing-0 >> firedTime: Sat Sep 14 17:55:14 CEST 2019
>     [mel-1) thread #2 - timer://foo] headers                        DEBUG
> http-outgoing-0 >> Host: localhost:8443
>     [mel-1) thread #2 - timer://foo] headers                        DEBUG
> http-outgoing-0 >> Connection: Keep-Alive
>     [mel-1) thread #2 - timer://foo] headers                        DEBUG
> http-outgoing-0 >> User-Agent: Apache-HttpClient/4.5.6 (Java/1.8.0_162)
>     [mel-1) thread #2 - timer://foo] headers                        DEBUG
> http-outgoing-0 >> Accept-Encoding: gzip,deflate
>     [mel-1) thread #2 - timer://foo] wire                           DEBUG
> http-outgoing-0 >> "GET
> /api/v1/watch/namespaces/my-qa/configmaps/my-config-map HTTP/1.1[\r][\n]"
>     [mel-1) thread #2 - timer://foo] wire                           DEBUG
> http-outgoing-0 >> "Accept: application/json[\r][\n]"
>     [mel-1) thread #2 - timer://foo] wire                           DEBUG
> http-outgoing-0 >> "Authorization: Bearer xxx[\r][\n]"
>     [mel-1) thread #2 - timer://foo] wire                           DEBUG
> http-outgoing-0 >> "breadcrumbId: ID-NB-118-1568476509695-0-1[\r][\n]"
>     [mel-1) thread #2 - timer://foo] wire                           DEBUG
> http-outgoing-0 >> "firedTime: Sat Sep 14 17:55:14 CEST 2019[\r][\n]"
>     [mel-1) thread #2 - timer://foo] wire                           DEBUG
> http-outgoing-0 >> "Host: m.devokd.younicos.local:8443[\r][\n]"
>     [mel-1) thread #2 - timer://foo] wire                           DEBUG
> http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
>     [mel-1) thread #2 - timer://foo] wire                           DEBUG
> http-outgoing-0 >> "User-Agent: Apache-HttpClient/4.5.6
> (Java/1.8.0_162)[\r][\n]"
>     [mel-1) thread #2 - timer://foo] wire                           DEBUG
> http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
>     [mel-1) thread #2 - timer://foo] wire                           DEBUG
> http-outgoing-0 >> "[\r][\n]"
>     [mel-1) thread #2 - timer://foo] wire                           DEBUG
> http-outgoing-0 << "HTTP/1.1 200 OK[\r][\n]"
>     [mel-1) thread #2 - timer://foo] wire                           DEBUG
> http-outgoing-0 << "Cache-Control: no-store[\r][\n]"
>     [mel-1) thread #2 - timer://foo] wire                           DEBUG
> http-outgoing-0 << "Content-Type: application/json[\r][\n]"
>     [mel-1) thread #2 - timer://foo] wire                           DEBUG
> http-outgoing-0 << "Date: Sat, 14 Sep 2019 15:55:14 GMT[\r][\n]"
>     [mel-1) thread #2 - timer://foo] wire                           DEBUG
> http-outgoing-0 << "Transfer-Encoding: chunked[\r][\n]"
>     [mel-1) thread #2 - timer://foo] wire                           DEBUG
> http-outgoing-0 << "[\r][\n]"
>     [mel-1) thread #2 - timer://foo] headers                        DEBUG
> http-outgoing-0 << HTTP/1.1 200 OK
>     [mel-1) thread #2 - timer://foo] headers                        DEBUG
> http-outgoing-0 << Cache-Control: no-store
>     [mel-1) thread #2 - timer://foo] headers                        DEBUG
> http-outgoing-0 << Content-Type: application/json
>     [mel-1) thread #2 - timer://foo] headers                        DEBUG
> http-outgoing-0 << Date: Sat, 14 Sep 2019 15:55:14 GMT
>     [mel-1) thread #2 - timer://foo] headers                        DEBUG
> http-outgoing-0 << Transfer-Encoding: chunked
>     [mel-1) thread #2 - timer://foo] MainClientExec                 DEBUG
> Connection can be kept alive indefinitely
>     [mel-1) thread #2 - timer://foo] HttpProducer                   DEBUG
> Http responseCode: 200
>     [mel-1) thread #2 - timer://foo] IOHelper                       TRACE
> Copying InputStream: org.apache.http.conn.EofSensorInputStream@3ab22477 ->
> OutputStream: CachedOutputStream[size: 0] with buffer: 4096 and flush on
> each write false
>     [mel-1) thread #2 - timer://foo] wire                           DEBUG
> http-outgoing-0 << "158[\r][\n]"
>     [mel-1) thread #2 - timer://foo] wire                           DEBUG
> http-outgoing-0 <<
>
> "{"type":"ADDED","object":{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"my-config-map","namespace":"my-qa","selfLink":"/api/v1/namespaces/my-qa/configmaps/my-config-map","uid":"a8130369-d703-11e9-b37c-d2c8065c1507","resourceVersion":"33040706","creationTimestamp":"2019-09-14T15:23:51Z"},"data":{"test":"added
> first modification"}}}[\n]"
>     [mel-1) thread #2 - timer://foo] wire                           DEBUG
> http-outgoing-0 << "[\r][\n]"
>     [mel-1) thread #2 - timer://foo] wire                           DEBUG
> http-outgoing-0 << "156[\r][\n]"
>     [mel-1) thread #2 - timer://foo] wire                           DEBUG
> http-outgoing-0 <<
>
> "{"type":"MODIFIED","object":{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"my-config-map","namespace":"yq-qa","selfLink":"/api/v1/namespaces/my-qa/configmaps/my-config-map","uid":"a8130369-d703-11e9-b37c-d2c8065c1507","resourceVersion":"33044977","creationTimestamp":"2019-09-14T15:23:51Z"},"data":{"test":"second
> modification"}}}[\n]"
>     [mel-1) thread #2 - timer://foo] wire                           DEBUG
> http-outgoing-0 << "[\r][\n]"
>
>   [1]:
>
> https://docs.openshift.com/container-platform/3.11/rest_api/api/v1.ConfigMap.html
>

Reply via email to