title | weight | type | aliases | |
---|---|---|---|---|
Sequence |
20 |
docs |
|
Sequence CRD provides a way to define an in-order list of functions that will be
invoked. Each step can modify, filter or create a new kind of an event. Sequence
creates Channel
s and Subscription
s under the hood.
Sequence has three parts for the Spec:
Steps
which defines the in-order list of Subscriber
s, aka, which
functions are executed in the listed order. These are specified using the
messaging.v1.SubscriberSpec
just like you would when creating
Subscription
. Each step should be Addressable
.ChannelTemplate
defines the Template which will be used to create
Channel
s between the steps.Reply
(Optional) Reference to where the results of the final step in the
sequence are sent to.Sequence has four parts for the Status:
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 Channel
before the first Step.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 the
Subscription
which is created to wire the first channel to the first step
in the Steps
array.Channel
which is
fronting the first Step in the Sequence.For each of these examples below, we'll use
PingSource
as
the source of events.
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.
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 an event display pod.
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 smae message
modifications as the first pipeline (with different steps however).
You can also create a Trigger which targets Sequence
. This time we'll wire
PingSource
to send events to a Broker
and then we'll have the Sequence
emit the resulting Events back into the Broker so that the results of the
Sequence
can be observed by other Trigger
s.
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Опубликовать ( 0 )