Dhairya-007 opened a new pull request, #29985:
URL: https://github.com/apache/camel/pull/29985

   ## Problem
   
   ```java
   @UriParam(label = "producer")
   private String inputHeader;
   @UriParam(label = "producer")
   private String outputHeader;
   ```
   
   `MyBatisConsumer.createExchange` reads `outputHeader` and, when it is set, 
puts the polled row in that header instead of the body:
   
   ```java
   private Exchange createExchange(Object data) {
       final MyBatisEndpoint endpoint = getEndpoint();
       final Exchange exchange = createExchange(false);
       exchange.setPattern(ExchangePattern.InOnly);
       final String outputHeader = getEndpoint().getOutputHeader();
   
       Message msg = exchange.getIn();
       if (outputHeader != null) {
           msg.setHeader(outputHeader, data);
       } else {
           msg.setBody(data);
       }
   ```
   
   So this is the option that decides where a consuming route finds its data - 
body or named header - and the catalog files it under `producer`, beside 
`inputHeader`, which really is producer-only (it is where the producer reads 
its statement input from, and the consumer never looks at it).
   
   Someone writing `from("mybatis:selectAll?consumer.onConsume=...")` and 
filtering the option table by consumer does not see it, and the natural reading 
of a producer label is that it has no effect on a consumer.
   
   ## Fix
   
   Label `outputHeader` as `common`; leave `inputHeader` as `producer`.
   
   Nothing in the runtime path changes - the consumer already reads it, which 
is how the code above works. The regenerated `mybatis.json` and 
`mybatis-bean.json` are included, produced by `camel-package-maven-plugin`.


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to