-
Notifications
You must be signed in to change notification settings - Fork 588
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
Knative Eventing Trigger sends CE Responder to a loop #7356
Comments
It seems to be an expected behavior. We have suggested a workaround here in Tekton Triggers: Can this be resolved without using filters? Can broker and Trigger not go on loop somehow? |
It is generally a good idea to not subscribe to all events, and provide explicit filters (for types and other CE attributes). |
Besides that, there is also a way to control behavior a bit, using the Regardless, not sure if all broker implementations supporting this.
|
Here is a post I wrote: https://developers.redhat.com/articles/2023/05/02/how-set-event-driven-microservices-using-knative-eventing Using application-specific events is a section that also recommends:
|
The |
I think that generally we could offer a way of disabling the reply as it might help with integrations with legacy apps as well which might not be necessarily change-able Something like: spec:
reply:
discard: true |
This is also related to #6392 |
You mean legacy apps submitting CloudEvents? |
Receiving Cloudevents, here the reply is sent by a subscriber |
See this comment on TTL which I agree with #6392 (comment) |
@matzew, I guess I can't argue with this, but I think it should work. My question is more general. In our use case, which was eventually boiled down to the test case provided in this ticket by @khrm, the Tekton EL sends an "accepted" CloudEvent response to the broker. The broker then turns around and sends that accepted message back the the Tekton EL. And then, of course, the EL sends back an "accepted" CloudEvent response. And we get in an infinite loop. This fundamentally seems wrong, and that there is a bug somewhere. So are you saying that this is what should be happening? My (naive) expectation was that an "accepted" CloudEvent response would be a special case, and not broadcast everywhere. |
So, I have a few questions:
The use-case: Do I understand it correct?
Just for understanding. Or is the use-case different? |
Instead of going the way to define a apiVersion: eventing.knative.dev/v1
kind: Trigger
metadata:
name: agogos-build-v1a1
namespace: tests
spec:
broker: agogos
filter:
attributes:
type: com.redhat.agogos.event.component.build.v1alpha1
subscriber:
uri: http://el-agogos.tests.svc.cluster.local:8080
---
apiVersion: eventing.knative.dev/v1
kind: Trigger
metadata:
name: agogos-some-other
namespace: tests
spec:
broker: agogos
filter:
attributes:
type: com.redhat.agogos.event.someother.event.type
subscriber:
uri: http://el-agogos.tests.svc.cluster.local:8080 (or some other serivce for this type)
... If you than want to process some other event type (e.g. like that "accept" from Tekton), I'd add a new trigger for that. This also prevents you from accidentally sending "wrong" events to the Tekton EL. However, I do see the point for the loop and the but for now, I think the above suggestions are the best options, and they follow the design and best practices (E.g. to not subscribe to all events on a trigger) |
This issue is stale because it has been open for 90 days with no |
Describe the bug
Our CE Responder goes on a loop.
It's somewhat similar to this:
https://github.com/cloudevents/sdk-go/blob/7f5ef3992769f96b40a54c4d59291be62acd36da/samples/http/responder/main.go
Expected behavior
Broker shouldn't resend events coming trigger to itself again.
To Reproduce
Follow the tutorial.
kn service create ce-test --image docker.io/kbaig/ce-test@sha256:60820f82aaabeb32c137650391fde6f27bd78825c6823b693bb851ab294e6888 --port 8080
Based on https://github.com/khrm/ce-test
Knative release version
Additional context
Add any other context about the problem here such as proposed priority
The text was updated successfully, but these errors were encountered: