Sequence
Info
Sequence needs “hairpin” traffic. Please verify that your pod can reach itself via the service IP. If the “hairpin” traffic is not available, you can reach out to your cluster administrator since its a cluster level (typically CNI) setting.
Sequence has three parts for the Spec:
Steps
which defines the in-order list ofSubscriber
s, aka, which functions are executed in the listed order. These are specified using themessaging.v1.SubscriberSpec
just like you would when creatingSubscription
. Each step should beAddressable
.Reply
(Optional) Reference to where the results of the final step in the sequence are sent to.
Sequence Status
Sequence has four parts for the Status:
- Conditions which detail the overall Status of the Sequence object
- ChannelStatuses which convey the Status of underlying
Channel
resources that are created as part of this Sequence. It is an array and each Status corresponds to the Step number, so the first entry in the array is the Status of the before the first Step. - SubscriptionStatuses which convey the Status of underlying
Subscription
resources that are created as part of this Sequence. It is an array and each Status corresponds to the Step number, so the first entry in the array is theSubscription
which is created to wire the first channel to the first step in theSteps
array.
Examples
We also use a very simple transformer which performs very trivial transformation of the incoming events to demonstrate they have passed through each stage.
For the first example, we’ll use a 3 Step Sequence
that is wired directly into the PingSource
. Each of the steps simply tacks on “- Handled by “, for example the first Step in the Sequence
will take the incoming message and append “- Handled by 0” to the incoming message.
See Sequence with no reply (terminal last Step).
Sequence with reply
For the next example, we’ll use the same 3 Step Sequence
that is wired directly into the PingSource
. Each of the steps simply tacks on “- Handled by “, for example the first Step in the Sequence
will take the incoming message and append “- Handled by 0” to the incoming message.
See Sequence with reply (last Step produces output).
For the next example, we’ll use the same 3 Step Sequence
that is wired directly into the PingSource
. Each of the steps simply tacks on “- Handled by “, for example the first Step in the Sequence
will take the incoming message and append “- Handled by 0” to the incoming message.
The only difference is that we’ll use the Subscriber.Spec.Reply
field to wire the output of the last Step to another Sequence
that does the same message modifications as the first pipeline (with different steps however).
See Chaining Sequences together.