weimeilin79 commented on issue #1983:
URL: https://github.com/apache/camel-quarkus/issues/1983#issuecomment-722434426


   For people that might bump into the same problem: 
   
   So directly casting the byte[] to `InputStream` doesn't cut it. Although 
everything looks ok, no error during runtime, I end up with an empty object. 
Meaning the byte was not correctly `marshal` into the object. 
   I then change the endpoint to  `netty-http` it worked like a charm. Clearly 
not a Quarkus issue. 
   Will checkin with Camel and ask the difference between the two. 
   Thanks!
   
   Working example
   ```
   
restConfiguration().component("netty-http").host("localhost").port("8080").bindingMode(RestBindingMode.auto);
           
           
rest("/").post("transfer").consumes("application/json").to("direct:transfer");
   
   from("direct:transfer")   
           .setHeader("sender",jsonpath("$.sender.userid"))
           .marshal().protobuf("demo.camel.TransactionProtos$Transaction")
           .log("Sender: ${header.sender}")
           
.toD("kafka:webtrans-quarkus?brokers=localhost:9092&key=${header.sender}&serializerClass=org.apache.kafka.common.serialization.ByteArraySerializer")
           ;
   
   ``` 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to