oscerd edited a comment on issue #1171:
URL: 
https://github.com/apache/camel-kafka-connector/issues/1171#issuecomment-844709856


   The http sink seems to be wrong:
   
   This is the correct one. Method was missing and you were passing GET as 
authentication method.
   
   ```
   apiVersion: camel.apache.org/v1alpha1
   kind: Kamelet
   metadata:
     name: http-sink-kamelet
     annotations:
       camel.apache.org/kamelet.icon: 
"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MjAiCmhlaWdodD0iNDIwIiBzdHJva2U9IiMwMDAiIGZpbGw9Im5vbmUiPgo8cGF0aCBzdHJva2Utd2lkdGg9IjI2IgpkPSJNMjA5LDE1YTE5NSwxOTUgMCAxLDAgMiwweiIvPgo8cGF0aCBzdHJva2Utd2lkdGg9IjE4IgpkPSJtMjEwLDE1djM5MG0xOTUtMTk1SDE1TTU5LDkwYTI2MCwyNjAgMCAwLDAgMzAyLDAgbTAsMjQwIGEyNjAsMjYwIDAgMCwwLTMwMiwwTTE5NSwyMGEyNTAsMjUwIDAgMCwwIDAsMzgyIG0zMCwwIGEyNTAsMjUwIDAgMCwwIDAtMzgyIi8+Cjwvc3ZnPg=="
       camel.apache.org/provider: "Apache Software Foundation"
       camel.apache.org/kamelet.group: "HTTP"
     labels:
       camel.apache.org/kamelet.type: sink
   spec:
     definition:
       title: HTTP Sink
       description: Forwards an event to a HTTP endpoint
       required:
         - url
       type: object
       properties:
         url:
           title: URL
           description: The URL to send data to
           type: string
           example: "https://zzzzzz/api/api_journey";
           pattern: "^(http|https)://.*"
         method:
           title: Method
           description: The HTTP method to use
           type: string
           default: POST
         authMethod:
           title: The HTTP method to use
           description: Authentication methods allowed to use as a comma 
separated list of values Basic, Digest or NTLM.
           type: string
         authUsername:
           title: The username to use
           description: Authentication username
           type: String
         authPassword:
           title: The password to use
           description: Authentication password
           type: String
     dependencies:
       - "camel:http"
       - "camel:kamelet"
       - "camel:core"
     flow:
       from:
         uri: kamelet:source
         steps:
           - set-header:
               name: CamelHttpMethod
               constant: "{{method}}"
           - to:
               uri: "{{url}}"
               parameters:
                 authMethod: "{{authMethod}}"
                 authUsername: "{{authUsername}}"
                 authPassword: "{{authPassword}}"
   ```
   
   This is the flow binding
   
   ```
   apiVersion: camel.apache.org/v1alpha1
   kind: KameletBinding
   metadata:
     name: timer-http-kafka
   spec:
     source:
       ref:
         kind: Kamelet
         apiVersion: camel.apache.org/v1alpha1
         name: timer-source
       properties:
         period: "5000"
         message: '"Invocation "'
     steps:
       - ref:
           kind: Kamelet
           apiVersion: camel.apache.org/v1alpha1
           name: http-sink-kamelet
         properties:
           url: "http://httpbin.org/basic-auth/pippo/pippo";
           method: GET
           authMethod: BASIC
           authUsername: "pippo"
           authPassword: "pippo"
   
     sink:
       ref:
         kind: Kamelet
         apiVersion: camel.apache.org/v1alpha1
         name: kafka-not-secured-sink
       properties:
         brokers: "my-cluster-kafka-bootstrap:9092"
         topic: "test-topic"
   ```


-- 
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:
[email protected]


Reply via email to