Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify that only a Channel is subscribable #4

Closed
wants to merge 5 commits into from

Conversation

scothis
Copy link

@scothis scothis commented Oct 11, 2018

The Subscription resource already said that the from property ObjectRef was required to be a Channel, but the remainder of the spec implied otherwise.

  • remove Subscribable interface (it doesn't need to exist if only a single resource can be referenced by Subscriptions)
  • a Source is no longer expected to ever create a Channel (a higher level resource can create both a Source and Channel)
    • Source now requires a Channel ObjectRef
  • cleanup language around the role of a Source

- remove Subscribeable interface
- Source now requires a Channel ObjectRef
- cleanup language arround the role of a Source
@grantr
Copy link

grantr commented Oct 11, 2018

If only a Channel can be Subscribable, what's the solution to knative#508? (generally: a Source that is capable of fanout must be fanned out separately due to this restriction)

I think there should be a very compelling reason for disallowing a Source to fanout on its own, since that translates directly into decreased efficiency for users and implementers that they cannot overcome.

@scothis
Copy link
Author

scothis commented Oct 11, 2018

If only a Channel can be Subscribable, what's the solution to knative#508?

Create a new Source for each "Subscription" targeting the result/Sinkable.

A Source should be relatively light since most of the infrastructure is now centralized by the provisioner. If there is complex configuration for the Source, a higher order resource can decompose to a set of Sources.

@grantr
Copy link

grantr commented Oct 11, 2018

Create a new Source for each "Subscription" targeting each of the result's Sinkable.

I'm not sure I understand, can you elaborate on this? What is a "Subscription"? What creates the Source and how does it know about the result? What object contains the result value?

@scothis
Copy link
Author

scothis commented Oct 12, 2018

A source with multiple subscriptions

Source -> Subscription A -> Channel A
       -> Subscription B -> Channel B
       -> Subscription C -> Channel C

becomes multiple sources with no subscriptions

Source A -> Channel A
Source B -> Channel B
Source C -> Channel C

Each of Source A, B and C use the same Provisioner and the same configuration except for the channel field which is set from the result.target field of each of Subscription A, B and C.

- A **Source** allows an incoming events from an external system to be
_Subscribable_. A _Subscription_ is used to connect these events to
subsequent processing steps.
- A **Source** emits incoming events to a _Channel_.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine as in source always puts things into a channel. However, I think it would be nice if a user wouldn't have to go digging into objects and then cut&paste these Channels around when creating pipelines. Hence the ability to deref, just like with Targetable, we could require a user to go in and at the lowest level just say it's a DNS name, same kind of applies here as in it's not ideal, if we think Targetable is a good concept, this is the same but in reverse.

@matzew
Copy link

matzew commented Oct 12, 2018

a Source is no longer expected to ever create a Channel (a higher level resource can create both a Source and Channel)

I agree that a source should not create a Channel. This higher level resource you talk here is the kind: Provisioner - right ?

@matzew
Copy link

matzew commented Oct 12, 2018

A source with multiple subscriptions

Source -> Subscription A -> Channel A
       -> Subscription B -> Channel B
       -> Subscription C -> Channel C

becomes multiple sources with no subscriptions

Source A -> Channel A
Source B -> Channel B
Source C -> Channel C

Each of Source A, B and C use the same Provisioner and the same configuration except for the channel field which is set from the result.target field of each of Subscription A, B and C.

I am not really sure I do get that

@deissnerk
Copy link

deissnerk commented Oct 15, 2018

@grantr In knative#508 I was suggesting that Channels should support more protocols. In my example it was:

Source (Topic) -> Channel -> Subscription A (Queue A) 
                          -> Subscription B (Queue B) 

@scothis scothis mentioned this pull request Oct 15, 2018
- A **Source** allows an incoming events from an external system to be
_Subscribable_. A _Subscription_ is used to connect these events to
subsequent processing steps.
- A **Source** emits incoming events to a _Channel_.

- A **Channel** provides event persistance and fanout of events from a
well-known input address to multiple outputs described by _Subscriptions_.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think with this change, the drawing in https://docs.google.com/drawings/d/10mmXzDb8S_4_ZG_hcBr7s4HPISyBqcqeJLTXLwkilRc/edit needs update too

@n3wscott
Copy link
Owner

merged.

@n3wscott n3wscott closed this Oct 18, 2018
@scothis scothis deleted the rm-subscribeable branch October 18, 2018 20:20
n3wscott pushed a commit that referenced this pull request Mar 5, 2019
Trigger filters on event source and type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants