Conversation
nicolaferraro
left a comment
There was a problem hiding this comment.
Everything looks good. I'd only allow event to act as a producer too, to publish an event, i.e. sending it to the broker.
| final String version = configuration.getCloudEventsSpecVersion(); | ||
| final Processor ceProcessor = CloudEventsProcessors.forSpecversion(version).producerProcessor(this); | ||
| if (type == Knative.Type.event) { | ||
| throw new UnsupportedOperationException("knative `events` are supported only as consumer"); |
There was a problem hiding this comment.
Mmh, why? I should be allowed to send events to the broker mesh
There was a problem hiding this comment.
It should behave as any other endpoint or channel, so no code changes
There was a problem hiding this comment.
so the event type is also used to lookup the service definition from the knative environment json ?
There was a problem hiding this comment.
No.. producer side the event type can be used to set the value of the ce-type header (when not overridden by the route headers).
I'm just thinking a possible way to define it..
.to('knative:event/chuck')
Semantically may mean "transform the exchange into a chuck event and emit it".
Destination is always the "default" broker unless overridden. So we may expect at runtime level that the operator will inject the destination into the KNATIVE config and we need to look it up here (by type and name, where name is default if not overridden).
|
reworking |
Fixes #151
Fixes #150