ReggieCarey commented on issue #673:
URL: https://github.com/apache/camel-kamelets/issues/673#issuecomment-1006926777


   ### SOLUTION?
   
   I have devised a solution to my basic underlying problem - When we sink to 
ElasticSearch, instead of hardcoding an indexId as the default if none is 
present, we remove the "otherwise" clause in the elasticsearch-index-sink 
Kamelet.
   
   WAS:
   ```
     flow:
       from:
         steps:
         - choice:
             otherwise:
               steps:
               - set-header:
                   name: indexId
                   simple: camel-k-index-es
             when:
             - simple: ${header[indexId]}
               steps:
               - set-header:
                   name: indexId
                   simple: ${header[indexId]}
             - simple: ${header[ce-indexid]}
               steps:
               - set-header:
                   name: indexId
                   simple: ${header[ce-indexid]}
   ```
   
   REMOVE:
   ```
             otherwise:
               steps:
               - set-header:
                   name: indexId
                   simple: camel-k-index-es
   ```
   
   RESULTING IN:
   
   ```
     flow:
       from:
         steps:
         - choice:
             when:
             - simple: ${header[indexId]}
               steps:
               - set-header:
                   name: indexId
                   simple: ${header[indexId]}
             - simple: ${header[ce-indexid]}
               steps:
               - set-header:
                   name: indexId
                   simple: ${header[ce-indexid]}
   ```
   
   This allows a blank indexId to be passed to ElasticSearch allowing it to 
autogenerate an indexId.
   
   @oscerd I hope this is a reasonable mod to the Kamelet.
   
   Sincerely,
   
   Reggie


-- 
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: commits-unsubscr...@camel.apache.org

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


Reply via email to