I want to use Knative Sequence to chain few ksvcs but failed. The first step ksvc can be triggered but not the rest of them.
In my ksvc(Node.js), I used CloudEvent js-sdk. I assume I would need to return a new CloudEvent after receiving it. So here comes my code:
app.post('/', (req, res)=>{
const event = HTTP.toEvent({ headers: req.headers, body: req.body });
// respond as an event
const responseEventMessage = new CloudEvent({
source: '/',
type: 'event:response',
...event
});
responseEventMessage.data = {
hello: 'world'
};
res.status(201).json(responseEventMessage);
})