Coko Lipo
Coko Lipo

Reputation: 1

Calling a Knative sequence does not return the output of the sequence

We are experimenting with knative sequences, we have defined a 3 step sequence similar to the one described in the knative tutorials : https://knative.dev/docs/eventing/flows/sequence/sequence-terminal/

We call the sequence using a POST cloudevent request that correctly triggers it. We use the sequence's Address as a target (which resolves to the address of the sequence's first channel). The POST request remains pending until the whole sequence is over (all steps), but the HTTP response we get is not the output of the sequence, instead we simply get :

{
    "body": "",
    "headers": {
        "allow": "POST, OPTIONS",
        "date": "Thu, 02 May 2024 13:20:00 GMT",
        "content-length": "0",
        "x-envoy-upstream-service-time": "24452",
        "server": "envoy"
    }
}

When adding a "reply" block, the sequence correctly sends the event to the described sink. In both cases (with or without reply) the caller of the sequence does not get the output of the sequence in return to his request. What bugs us is that the request remains pending until the whole sequence is over, so it seems logical that we should get the output of the sequence's last step.

Is this a feature ? Or did we miss something in the configuration ? Any help would be appreciated, thank you very much.

Upvotes: 0

Views: 86

Answers (1)

Leo6Leo
Leo6Leo

Reputation: 25

The behavior you're observing is expected due to the asynchronous nature of Knative Sequences with the in-memory channel. When you send a POST request to the sequence, it triggers the sequence, and the reply will not be sent until the sequence is finished.

If you hope to get the reply (acknowlegement) immediately when the event is distributed to the sequence), I would suggest you use Kafka Channel implementation.

Don't forget to change the default channel here after you install Kafka Channel.

Upvotes: 0

Related Questions