-
Notifications
You must be signed in to change notification settings - Fork 158
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
add more params to dapr pubsub subscription #332
base: main
Are you sure you want to change the base?
add more params to dapr pubsub subscription #332
Conversation
|
@tpiperatgod @webup @wrongerror hi, any suggestions on this pr? |
apis/core/v1beta1/serving_types.go
Outdated
PubSubRoutingRule *PubSubRoutingRule `json:"pubSubRoutingRule,omitempty"` | ||
} | ||
|
||
type PubSubRoutingRule struct { |
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.
@ZoeShaw101 Thanks for your contribution and sorry for our late response because we're busy on releasing v0.7.0
I think the PubSubRoutingRule
can be changed to Subscription
directly and we needn't define our own Subscription struct, simply referencing Dapr's Subsription
is ok. https://github.com/dapr/go-sdk/blob/main/service/common/type.go#L89
// Subscription represents single topic subscription.
type Subscription struct {
// PubsubName is name of the pub/sub this message came from
PubsubName string `json:"pubsubname"`
// Topic is the name of the topic
Topic string `json:"topic"`
// Metadata is the subscription metadata
Metadata map[string]string `json:"metadata,omitempty"`
// Route is the route of the handler where HTTP topic events should be published (passed as Path in gRPC)
Route string `json:"route"`
// Match is the CEL expression to match on the CloudEvent envelope.
Match string `json:"match"`
// Priority is the priority in which to evaluate the match (lower to higher).
Priority int `json:"priority"`
// DisableTopicValidation allows to receive events from publisher topics that differ from the subscribed topic.
DisableTopicValidation bool `json:"disableTopicValidation"`
}
The PubsubName
, and Topic
fields of Subscription
will not be used because OpenFunction defined them in DaprIO
https://github.com/OpenFunction/OpenFunction/blob/main/apis/core/v1beta1/serving_types.go#L91
And Route
will not be used either because the user needn't set this by himself, it's handled automatically by the functions-framework implementation.
What are valuable to OpenFunction are Subscription
's metadata
, Match
, Priority
, and DisableTopicValidation
fields which need to be passed to functions-framework implementations via context.
@wanjunlei @tpiperatgod @wrongerror @webup @lizzzcai , what do you think?
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.
fixed it , please have a look @benjaminhuo , tks
@ZoeShaw101 Also don't forget to sign your commit by
|
d85a381
to
baa54b9
Compare
Signed-off-by: WangXiaoxiao <1141195807@qq.com>
baa54b9
to
5d51253
Compare
Hi, any review updates here? @benjaminhuo @zhbinary @tpiperatgod |
Is it possible to add Bulk Subscriptions to this PR? #519 |
fix issue: #329