add more params to dapr pubsub subscription#332
add more params to dapr pubsub subscription#332halegreen wants to merge 1 commit intoOpenFunction:mainfrom
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.
@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?
|
@ZoeShaw101 Also don't forget to sign your commit by |
d85a381 to
baa54b9
Compare
Signed-off-by: WangXiaoxiao <[email protected]>
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