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

Show optional response event when sending an event #383

Open
rhuss opened this issue Nov 5, 2024 · 4 comments
Open

Show optional response event when sending an event #383

rhuss opened this issue Nov 5, 2024 · 4 comments
Labels
kind/enhancement triage/accepted Issues which should be fixed (post-triage)

Comments

@rhuss
Copy link
Contributor

rhuss commented Nov 5, 2024

It would be great to show the HTTP response when a CE has been sent when testing microservices that consume and produce Cloud Events as response.

Currently, the response is just ignored. The Golang CE SDK supports a more sophisticated way to send events that also allows the inspection of the response via https://github.com/cloudevents/sdk-go/blob/de2f28370b0d2a0f64f92c0c6139fa4b8a7c3851/v2/protocol/http/protocol.go#L178

Not sure how to get this from the in-cluster sender image to the CLI (except to log to stdout), but for the out-cluster sending from the CLI this should be not too difficult.

@cardil
Copy link
Contributor

cardil commented Nov 5, 2024

/triage accepted
/kind enhancement

I think this can be done, and could be handy, especially for things like Quarkus Funqy runtime for Func, which has a response type by default.

@knative-prow knative-prow bot added triage/accepted Issues which should be fixed (post-triage) kind/enhancement labels Nov 5, 2024
@cardil
Copy link
Contributor

cardil commented Nov 5, 2024

However, I think we should stick to CE events, and present the response only if a valid CE is returned (not for a general HTTP response). WDYT @rhuss?

@rhuss
Copy link
Contributor Author

rhuss commented Nov 5, 2024

I'm okay with that. You can always add the complete response in the --verbose output, even when its not a CE. When restricting for CE you could reuse the way how gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display renders the event in its log

@cardil
Copy link
Contributor

cardil commented Nov 6, 2024

Sure, the rendering is already implemented in kn-event. Dumping the raw HTTP in debug logs is also good idea.

@cardil cardil changed the title Show HTTP response when sending an event Show optional response event when sending an event Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement triage/accepted Issues which should be fixed (post-triage)
Projects
None yet
Development

No branches or pull requests

2 participants