Hello,
I am using Camel 2.17.4, I have a route initiating a request/response
netty4-http call:
<to
uri="netty4-http:{{oozie.service.url}}/jobs?action=start&headerFilterStrategy=#headerFilter&throwExceptionOnFailure=false&synchronous=true"/>
<camel:convertBodyTo type="String"/>
<log message="Oozie Response: ${body}"/>
First problem is that the synchronous=true is passed as query parameter to the
remote server, when it should be used to configure the endpoint.
2017-11-30 09:01:07,921 | DEBUG | yClientTCPWorker | 51 -
org.apache.camel.camel-netty4 - 2.17.4 | Channel: [id: 0x5d15a2da,
L:/192.168.56.1:56875 - R:quickstart.cloudera/192.168.56.101:11000] writing
body: DefaultFullHttpRequest(decodeResult: success, version: HTTP/1.1, content:
UnpooledUnsafeNoCleanerDirectByteBuf(ridx: 0, widx: 1714, cap: 1714))
POST
http://quickstart.cloudera:11000/oozie/v2/jobs?action=start&synchronous=true
HTTP/1.1
Content-Length: 1714
Content-Type: application/xml
Host: quickstart.cloudera:11000
Connection: keep-alive
Second problem is that even though the server is actually responding, I am
getting asynchronous error:
2017-11-30 09:01:08,359 | DEBUG | yClientTCPWorker | 49 -
org.apache.camel.camel-core - 2.17.4 | Http responseCode: 201
2017-11-30 09:01:08,361 | INFO | pool-50-thread-1 | 49 -
org.apache.camel.camel-core - 2.17.4 |
ID-Alexs-Laptop-local-56143-1512049637396-7-2 >>> (submitSparkQueriesWF)
convertBodyTo[String] --> log[Oozie Response: ${body}] <<<,
Headers:{CamelHttpResponseCode=201, CamelHttpResponseText=Created,
Content-Type=application/json;charset=UTF-8}, BodyType:String,
Body:{"id":"0000002-171129163622279-oozie-oozi-W"}
2017-11-30 09:01:08,362 | INFO | pool-50-thread-1 | 49 -
org.apache.camel.camel-core - 2.17.4 | Oozie Response:
{"id":"0000002-171129163622279-oozie-oozi-W”}
Some time later, I get error:
2017-11-30 09:02:08,375 | ERROR | pool-50-thread-1 | 49 -
org.apache.camel.camel-core - 2.17.4 | Failed delivery for (MessageId:
ID-Alexs-Laptop-local-56143-1512049637396-7-4 on ExchangeId:
ID-Alexs-Laptop-local-56143-1512049637396-7-2). Exhausted after delivery
attempt: 1 caught: org.apache.camel.CamelExchangeException: No response
received from remote server: quickstart.cloudera:11000.
Exchange[ID-Alexs-Laptop-local-56143-1512049637396-7-2]
...
Stacktrace
---------------------------------------------------------------------------------------------------------------------------------------
org.apache.camel.CamelExchangeException: No response received from remote
server: quickstart.cloudera:11000.
Exchange[ID-Alexs-Laptop-local-56143-1512049637396-7-2]
at
org.apache.camel.component.netty4.handlers.ClientChannelHandler.channelInactive(ClientChannelHandler.java:130)[51:org.apache.camel.camel-netty4:2.17.4]
at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:241)[32:io.netty.transport:4.0.43.Final]
Notice the error occurs in a different thread.
I don’t know why this error is occurring because there is a response, and why
is it not handling the exchange synchronous ?
Best regards,
Alex soto