CEXT-6482: Add multi-event-consumer sample - #70
Merged
Conversation
obarcelonap
approved these changes
Jul 24, 2026
obarcelonap
left a comment
Member
There was a problem hiding this comment.
should we integrate aio-lib-telemetry?
is this pattern supported?
obarcelonap
reviewed
Jul 24, 2026
obarcelonap
reviewed
Jul 24, 2026
Shows how several Commerce event subscriptions can share a single runtime action: the shared "consumer" action resolves each event's I/O event code and dispatches it, via an OpenWhisk invoke, to the action that actually handles it.
Match the unwrapped, one-line-per-paragraph style used by the other sample READMEs in this repo.
The auto-generated installation action needs AIO_COMMERCE_AUTH_IMS_* inputs for the app-management association flow, same as every other aio-commerce-lib-app sample.
List all three APIs declared in install.yaml (including AdobeIOManagementAPISDK, needed for the consumer's openwhisk invoke) instead of two. Drop the IMS credentials bullet: those are synced automatically by aio-commerce-lib-app once the APIs are subscribed, not a separate manual prerequisite.
Drop the invented rationale for AdobeIOManagementAPISDK.
App Builder workspaces cap the number of event registrations. Routing several events to one action keeps a many-event app under that limit instead of spending a registration per event.
Removed the overrides section and added includes to the files section.
iivvaannxx
force-pushed
the
CEXT-6482/event-consumer-sample-impl
branch
from
July 27, 2026 10:06
5759cdd to
382c7e0
Compare
Contributor
Author
Meging this as agreed offline, we can integrate telemetry in the future. I have some things I want to do in the lib as soon as priorities allow, I think we can reconsider integration then. |
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.
Summary
consumeraction.consumeraction resolves each declared event name to its I/O event code (resolveIoEventCode) and hands{ code, action }routes to a reusable, domain-agnostic dispatcher (withEventRouterinlib/router.js), which matches the incoming CloudEventtypeand forwards it to the right handler action via an OpenWhisk invoke.@adobe/aio-commerce-sdkresponse helpers (ok,badRequest), consistent with the rest of the app.Test plan
npm install(postinstall codegen succeeds)aio app buildbuilds all 7 actions (3 app-management + consumer + 3 handlers) without errorsnpx ultracite checkpasses on all new source filesconsumeraction to confirmresolveIoEventCoderesolves against the declared event names and app id correctly