-
Notifications
You must be signed in to change notification settings - Fork 20
Update chip-ingress client to accept and extract additional attributes #1283
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
base: main
Are you sure you want to change the base?
Conversation
pkg/chipingress/client.go
Outdated
attributes = make(map[string]any) | ||
} | ||
|
||
if val, ok := attributes["time"].(t.Time); ok { |
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.
what are the implications of setting time
here vs recordedtime
if the user has supplied it? IFIUC we want to use recordedtime to have a somewhat reliable partition key in the data layer.
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.
this is directly from the cloudevents spec of time
vs recordedtime
- they are 2 distinct attributes - link
time
is the time stamp of when the event occurred and is optionally provided by the publisher
recordedtime
is when the cloudevent
object was created and is always set by the client here
if time is not provided then we use the current time as its value which is the same as recorded time, following the recommendation here - thats why we are setting it here
} | ||
|
||
if val, ok := attributes["datacontenttype"].(string); ok { | ||
event.SetDataContentType(val) |
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.
what is the effect of setting these on the event vs having access to them in the attributes?
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.
these are optional
attributes and can only be set if they are provided
Ticket: https://smartcontract-it.atlassian.net/browse/INFOPLAT-2479
Update the
chip-ingress
client to set all attributes that could be provided oncloudevent
object and updates thechip-ingress-emmiter
to extract these attributes and pass to the client.