Sorry for the inconvenience.
seda:route1
    - processor-1 (Using producertemplate exchange is sent to different direct 
endpoints)
direct:<route1....n>
    - OnException:
        - CustomErrorHandlingProcessor
    - Processor-2
    - toURI: netty:<host>:<port>?sync=true
    - ResponseProessor
The original fomatting did not retain, not sure why.
However, on further analysis, found out the root cause of the issue. The 
problem was because, after the first attempt (where exchange body was set as 
string), the exchange body was set in the form of bytes and server was reading 
this as string. After removing the set body as bytes, this started working.
Also, we have one more observation during this sceanario as below:

We are creating a bytebuffer for a string content received. When creating 
string using byte array directly from bytebuffer and with the help of 
NettyConverter, different results are observed.

Example string:
"{\"abc-metadata\":{\"id\":\"1234\",\"x-y-z\":\"xyz\",\"s-number\":1,\"msg-number\":1,\"version\":\"sversion\",\"service-name\":\"serviceNAme\""

bytebuffer.array() gives the following result:
72 69 80 51 0 -124 0 0 0 15 0 126 123 34 97 98 99 45 109 101 116 97 100 97 116 
97 34 58 123 34 105 100 34 58 34 49 50 51 52 34 44 34 120 45 121 45 122 34 58 
34 120 121 122 34 44 34 115 45 110 117 109 98 101 114 34 58 49 44 34 109 115 
103 45 110 117 109 98 101 114 34 58 49 44 34 118 101 114 115 105 111 110 34 58 
34 115 118 101 114 115 105 111 110 34 44 34 115 101 114 118 105 99 101 45 110 
97 109 101 34 58 34 115 101 114 118 105 99 101 78 65 109 101 34

whereas NettyConverter.toString(Unpooled.wrappedBuffer(buffer), exchange) gives 
this 72 69 80 51 0 63 0 0 0 15 0 126 123 34 97 98 99 45 109 101 116 97 100 97 
116 97 34 58 123 34 105 100 34 58 34 49 50 51 52 34 44 34 120 45 121 45 122 34 
58 34 120 121 122 34 44 34 115 45 110 117 109 98 101 114 34 58 49 44 34 109 115 
103 45 110 117 109 98 101 114 34 58 49 44 34 118 101 114 115 105 111 110 34 58 
34 115 118 101 114 115 105 111 110 34 44 34 115 101 114 118 105 99 101 45 110 
97 109 101 34 58 34 115 101 114 118 105 99 101 78 65 109 101 34

Also, We observed when string contains whitespace characters NettyConverter 
doesnt work for all string values and intermittently fails.

Can you please check?



Reply via email to