Skip to content

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

engnke
Copy link
Contributor

@engnke engnke commented Jun 20, 2025

Ticket: https://smartcontract-it.atlassian.net/browse/INFOPLAT-2479

Update the chip-ingress client to set all attributes that could be provided on cloudevent object and updates the chip-ingress-emmiter to extract these attributes and pass to the client.

@engnke engnke requested review from a team as code owners June 20, 2025 16:29
@engnke engnke requested a review from justinkaseman June 20, 2025 16:29
@engnke engnke marked this pull request as draft June 20, 2025 16:29
@engnke engnke marked this pull request as ready for review June 23, 2025 21:31
attributes = make(map[string]any)
}

if val, ok := attributes["time"].(t.Time); ok {
Copy link
Contributor

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.

Copy link
Contributor Author

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)
Copy link
Contributor

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?

Copy link
Contributor Author

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

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.

3 participants