Repository navigation
csapi-mqtt: Batch Resource Events for observations - #266
Merged
Merged
Conversation
tipatterson-dev
force-pushed
the
feature/cs-api-mqtt/258-batch-events
branch
from
November 12, 2026 02:02
713c445 to
d1a9f9d
Compare
alexrobin
force-pushed
the
feature/cs-api-mqtt/258-batch-events
branch
from
November 12, 2026 07:27
d1a9f9d to
f9f58e5
Compare
Base automatically changed from
feature/cs-api-mqtt/254-resource-events
to
master
November 12, 2026 07:37
alexrobin
force-pushed
the
feature/cs-api-mqtt/258-batch-events
branch
from
November 12, 2026 07:37
f9f58e5 to
1d441b5
Compare
alexrobin
self-requested a review
November 12, 2026 07:37
alexrobin
approved these changes
Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Publishes CS API Part 3 Batch Resource Events for the observations of each datastream (
/req/resource-events/batch-events,/req/mqtt/batch-resource-events). A datastream can create many observations each second, so the service sends one event with the number of new observations in each time window, not one event for each observation.Closes #258. Part of #249.
Stacked on #264 (Resource Events, #254) (base
feature/cs-api-mqtt/254-resource-events). Merge #261, #263 and #264 first.Changes
TopicMapperaccepts the Batch Resource Event topic (no:data):{nodeId}/{systemPath}/datastreams/{id}/observations.BatchWindow: counts the observations of one datastream and publishes at most one batch in each window.BatchEventPublisher:typeisorg.ogc.api.csapi.observation.create.sourceis the API root.subjectis the canonical observations URL ({apiRoot}/datastreams/{id}/observations) andresourceparentis the canonical datastream URL. Each event has a newid.datais{"timerange": [first, last], "count": n}, withdatacontenttypeapplication/json.batchEventWindowMs(default1000).0publishes one event each time a datastream gets observations. A negative value is rejected.CsApiMqttConnector(no code change): the batch topic uses the event topic checks of csapi-mqtt: Resource Events for systems, datastreams and control streams #264. A subscriber must be able to read the datastream, and client publications are rejected as not authorized.observationBatchEventschannel, a batch CloudEvents schema withdata, and the configured window in the channel description.Not included
.../observations/{id}) are rejected. They need osh-core changes first.Known limits
Testing
TestBatchWindow: first event at once, events after a quiet window, one flush at the end of the window, second window cycle, quiet window, time range order, rejected schedule, close, zero window.TestBatchEventPublisher: topic and CloudEvent JSON, a newidfor each event, unknown datastream, datastream and system removal, stop.testEventsFromEventBususes a real osh-coreEventBus, so that the subscription delivers events.TestTopicMapper: batch topics for top-level systems and nested subsystems, and rejected topics.TestAsyncApiHandler: batch channel, event type and the configured window.subject,resourceparentandtimerange.../observations/{id}: rejected; client publish to the batch topic: not authorizedStack