Giter Club home page Giter Club logo

Comments (4)

oscerd avatar oscerd commented on June 27, 2024

You just need to send an header together with the payload to the sink connector. This header should be named "CamelHeader.Authorization" with the bearer token as value.

from camel-kafka-connector-examples.

kferrone avatar kferrone commented on June 27, 2024

Ok, so I am using the unofficial strimzi-cli here for local testing and Strimzi is running in kubernetes.

I made a file called producer.properties with the following on my local machine:

CamelHeader.Authorization=Bearer 123token456

Then I run this command to create a producer from the cli

kfk console-producer --topic my-topic -c my-cluster -n default --producer.config producer.properties

Then I paste the following:

{"message": "foo"}

I see my consumers do get the message including the connector.
However I am still getting 403 back from the endpoint from within the sink connector.
Did I even do what you are saying?

How to debug the actual request getting made to the endpoint? I want to see the headers, body and all.

I also get this warning when I open the producer terminal:

WARN The configuration 'CamelHeader.Authorization' was supplied but isn't a known config. (org.apache.kafka.clients.producer.ProducerConfig)

from camel-kafka-connector-examples.

oscerd avatar oscerd commented on June 27, 2024

I would use Kafkacat and add a

-H CamelHeader.Authorization="Bearer 123token456"

from camel-kafka-connector-examples.

kferrone avatar kferrone commented on June 27, 2024

Oh my hero! Kafkacat worked well for me. It looks like there is a bug in the Strimzi CLI. I was pulling my hair out. I'll let them know something isn't working right. Thanks.

from camel-kafka-connector-examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.