-
-
Notifications
You must be signed in to change notification settings - Fork 3
feat: Add application to schema and API #518
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
Conversation
evanh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
When we say that namespaces can be duplicated across applications does it mean that there are going to be two independent namespaces with the same name in two applications or that the namespace is shared and messages for a namespace can be consumed by either of the two applications ? Let's say a producer issues a task for namespace
Can we just disallow this from the beginning ? |
|
Who decides which application a task belong when issuing the task itself?
|
| query_builder.push_bind(now.timestamp()); | ||
| query_builder.push(")"); | ||
|
|
||
| // Handle namespace filtering | ||
| // Handle application & namespace filtering | ||
| if let Some(value) = application { | ||
| query_builder.push(" AND application ="); | ||
| query_builder.push_bind(value); | ||
| } | ||
| if let Some(namespaces) = namespaces | ||
| && !namespaces.is_empty() | ||
| { |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
A namespace may be duplicated by multiple applications (as they are just strings at the end of the day). My plan is to end up in a state where a namespace value could be used by multiple applications, but each copy of the namespace is consumed by separate workers in separate applications.
The producer of an activation is responsible for choosing the right namespace and application values.
I can't think of any scenarios where we would intentionally create overlapping namespace names in different applications, but it could happen.
Yes. I can make requests that specify namespace & omit application invalid. We'll need to support the scenario where a worker provides neither an application or namespace for a short period of time to handle deploy boundaries between sentry and taskbroker. Once sentry has been updated to produce |
The producer will have the final say on which application a task belongs. My plan is to have the application defined statically in the application code where namespaces are defined, and tasks will inherit config from the namespace.
Yes, this is where I'd like to end up. Clients have to define their application label statically, and only in scenarios where we have cross-application messaging would a producer use a different |
To better support multiple client applications using a single taskbroker instance, we need to introduce the concept of
application. Anapplicationrepresents a logical client or consumer. Applications contain many namespaces, and namespaces can be duplicated across applications.Currently, clients can consume from all namespaces, or a single namespace. There isn't a way for a worker to request tasks from multiple namespaces, and more importantly there isn't a way to exclude namespaces. By adding
applicationto activations & taskbroker, we'll be able to have clients do any of the following:Request tasks from a given namespace across any application.This is no longer allowed.Scenario 4 will be deprecated in the future with runtime enforcement. Once sentry is updated, this scenario will return errors/no-results as well. Changing the protobufs is a 'breaking change', so requiring application will be a runtime constraint until we can revise protobufs.
Refs STREAM-603