Jae Chi
Jae Chi

Reputation: 11

CamelExchangeException: Cannot write response to ... caused by UnsupportedException

I have a camel route in grails. The exception goes away when I comment out the unmarshall line in the processor as if it was taking too long for the TCP response to be sent back in time. If my assessment is correct, if there a setting in netty to send the response back without waiting?

Thanks.

from("netty4:tcp://172.25.200.66:12345?
clientMode=true&disconnectOnNoReply=false&connectTimeout=100000
&reconnect=true&allowDefaultCodec=false&decoder=#jsonDecoderFactory")
.to("log:dump?showAll=true")
.bean("messageProcessorService", "processMessage")


def processMessage (String msg) {
    log.debug("MessageProcessorService processMessage")
    def object = unmarshall(msg)
}


2017-01-13 13:20:58,186 | WARN  |  camel.component.netty4.NettyConsumer |
    Caused by: [org.apache.camel.CamelExchangeException - Cannot write response to /172.25.200.66:12345.
    Exchange[ID-wulg2-chij-udev-local-41278-1484313632001-0-20][Message: []].
    Caused by: [java.lang.UnsupportedOperationException - unsupported message
    type: Collections$UnmodifiableList (expected: ByteBuf, FileRegion)]]
    org.apache.camel.CamelExchangeException: Cannot write response to
    /172.25.200.66:12345.
    Exchange[ID-wulg2-chij-udev-local-41278-1484313632001-0-20][Message: []].
    Caused by: [java.lang.UnsupportedOperationException - unsupported message

Upvotes: 0

Views: 720

Answers (1)

Jae Chi
Jae Chi

Reputation: 11

It turns out that option "sync=false" sets the endpoint to one-way. Thus not requiring to write responses back.

Upvotes: 1

Related Questions