Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send headers while producing to a Kafka topic #330

Closed
authorjapps opened this issue Oct 21, 2019 · 8 comments
Closed

Send headers while producing to a Kafka topic #330

authorjapps opened this issue Oct 21, 2019 · 8 comments
Assignees
Labels

Comments

@authorjapps
Copy link
Owner

authorjapps commented Oct 21, 2019

authorjapps/hello-kafka-stream-testing#1

Background

From Slack:
Question from: Kushagra
@authorjapps is it possible to send a message to a Kafka topic with a particular header? I know we can do that in http. Please advise!

AC1:

As a developer or SDET
I want to produce a record with header(s) to a desired Kafka topic
So that I verify the business flow related to the headers.
e.g.

                "records":[
                    {
                        "key": "${RANDOM.NUMBER}",
                        "value": "Hello World",
                          "headers": {
                                  "key1" : "value1",
                                  "key2" : "value2",
                          }
                          ...
                    }

AC2:

As a developer or Test Engineer
I want a help page or a Wiki to learn the usage of the producing and consuming of a Kafka record with headers
So that I can easily implement this into the test automation in my project.
Wiki todo(Ask for edit permission) :
https://github.com/authorjapps/zerocode/wiki/Kafka-records-with-headers

SDET: Software Developer Engineer in Test

@kt09
Copy link

kt09 commented May 4, 2020

Use case @authorjapps :
Send a message to a Kafka Topic on a particular partition and Header. For enterprise applications, this feature will provide the capability to test the code behind/micro service listening to a particular header. This can look something similar to http implementation where ZeroCode has the feature of specifying header. Example produce JSON can look like:

 {
            "name": "load_kafka",
            "url": "kafka-topic:demo-Kafka-Topic",
            "operation": "produce",
            "request": {
                "records":[
                    {
                        "key": "${RANDOM.NUMBER}",
                        "value": "Hello World",
                        "partition": 0,
                          _"headers": {
                                  "Key": "Sample.Key",
                                  "Value": "Sample.Value"
                          },_
                    }
                ]
            },
            "assertions": {
                "status" : "Ok",
                "recordMetadata" : {
                    "topicPartition" : {
                        "partition" : 0
                        "topic" : "demo-Kafka-Topic"
                    },
                      _"headers": {
                                  "Key": "Sample.Key",
                                  "Value": "Sample.Value"
                          },_
                }
            }
        }

@kt09
Copy link

kt09 commented May 8, 2020

@authorjapps - just touching base on this. Is there anything else I can provide here? When can I expect this feature to be available? Please advise.

@kt09
Copy link

kt09 commented May 9, 2020

@authorjapps Please review and approve the PR
#391
Please note this PR is not tested.

@authorjapps
Copy link
Owner Author

authorjapps commented May 16, 2020

Available in V 1.3.20

@kt09
Copy link

kt09 commented May 16, 2020

@authorjapps when will v 1.3.20 be available ?

@authorjapps
Copy link
Owner Author

@kt09 , Please check our release frequency details(click me) on the readme page.
Next one is around 21st May... Not too far from now.

But it would be great if you could take care of all the ACs prior to that. AC2 seems like still pending. The ticket is with you currently and hoping it would be done asap if this is urgent!

Give us a shout here once done ✌️

@kt09
Copy link

kt09 commented May 27, 2020

@authorjapps apologies for the late response and sorry for not getting to AC2 before 21st.
I will look into the AC2 and will reach out once I'm on it. And yes it is important! :)
Many thanks!

@authorjapps
Copy link
Owner Author

Hello @kt09 , Just checking... did you get chance to complete the AC2?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

2 participants