Skip to content

Commit b8a2abb

Browse files
authored
Merge pull request AdobeDocs#343 from oshmyheliuk/CEXT-4516
CEXT-4516: Create an eventing multiprovider documentation
2 parents b76a963 + 5d1d4c2 commit b8a2abb

File tree

7 files changed

+253
-16
lines changed

7 files changed

+253
-16
lines changed

src/data/navigation/sections/events.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ module.exports = [
1515
title: "Configure Adobe Commerce",
1616
path: "/events/configure-commerce.md",
1717
},
18+
{
19+
title: "Configure additional event providers",
20+
path: "/events/configure-additional-event-providers.md",
21+
},
1822
{
1923
title: "Module development",
2024
path: "/events/module-development.md",
Loading
Loading

src/pages/events/api.md

Lines changed: 184 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ The `POST /rest/<store_view_code>/V1/eventing/eventSubscribe` endpoint subscribe
3434
],
3535
"destination": "string",
3636
"priority": true,
37-
"hipaaAuditRequired": true
37+
"hipaa_audit_required": true,
38+
"provider_id": "string"
3839
},
3940
"force": true
4041
}
@@ -130,7 +131,8 @@ The `GET /rest/all/V1/eventing/getEventSubscriptions` endpoint returns a list of
130131
],
131132
"destination": "default",
132133
"priority": false,
133-
"hipaa_audit_required": false
134+
"hipaa_audit_required": false,
135+
"provider_id": "default"
134136
}]
135137
```
136138

@@ -169,7 +171,8 @@ The `PUT /rest/<store_view_code>/V1/eventing/eventSubscribe/<event_name>` endpoi
169171
],
170172
"destination": "string",
171173
"priority": true,
172-
"hipaa_audit_required": true
174+
"hipaa_audit_required": true,
175+
"provider_id": "string"
173176
}
174177
}
175178
```
@@ -271,9 +274,144 @@ curl -i -X PUT \
271274
'<ADOBE_COMMERCE_URL>/rest/all/V1/eventing/updateConfiguration'
272275
```
273276

274-
## Get configured event provider information
277+
## Event provider management
275278

276-
The `GET /rest/<store_view_code>/V1/eventing/getEventProviders` endpoint returns information about the event provider configured for the Commerce instance.
279+
The event provider management endpoints allow you to create, update, and delete event providers. The event provider must be created in the Adobe Developer Console before registering it in Adobe Commerce.
280+
281+
### Create an event provider
282+
283+
The `POST /rest/<store_view_code>/V1/eventing/eventProvider` endpoint registers a new event provider in an Adobe Commerce instance. The event provider must be created in the Adobe Developer Console before it can be registered in Adobe Commerce.
284+
285+
**Headers:**
286+
287+
`Authorization: Bearer <administrator token>`
288+
289+
The administrator must be granted access to the `Magento_AdobeIoEventsClient::event_provider_edit` resource.
290+
291+
**Payload Parameters:**
292+
293+
Name | Format | Required | Description
294+
--- |--------| --- | ---
295+
`provider_id` | string | required | The event provider ID.
296+
`instance_id` | string | required | The instance ID of event provider.
297+
`label` | string | optional | A label of the event provider.
298+
`description` | string | optional | A description of the event provider.
299+
`workspace_configuration` | string | optional | The contents of the workspace configuration file downloaded from the Adobe Developer Console associated with the event provider.
300+
301+
**Example usage:**
302+
303+
The following cURL command registers a new event provider:
304+
305+
```bash
306+
curl -i -X POST \
307+
-H "Content-Type:application/json" \
308+
-H "Authorization:Bearer <AUTH_TOKEN>" \
309+
-d \
310+
'{
311+
"eventProvider": {
312+
"provider_id": "1902bc50-12345-41e8-955b-af4a9667823f",
313+
"instance_id": "my_instance_id",
314+
"label": "My provider",
315+
"description": "Additional event provider",
316+
"workspace_configuration": "{<WORKSPACE_CONFIGURATION_FROM_ADOBE_DEVELOPER_CONSOLE>}"
317+
}
318+
}' \
319+
'<ADOBE_COMMERCE_URL>/rest/all/V1/eventing/eventProvider'
320+
```
321+
322+
**Example response:**
323+
324+
```json
325+
{
326+
"id": "3",
327+
"provider_id": "1902bc50-12345-41e8-955b-af4a9667823f",
328+
"instance_id": "my_instance_id",
329+
"label": "My provider",
330+
"description": "Additional event provider",
331+
"workspace_configuration": "****"
332+
}
333+
```
334+
335+
### Update an event provider
336+
337+
The `PUT /rest/<store_view_code>/V1/eventing/eventProvider/<provider_id>` endpoint updates the event provider with the specified ID. The request body has the same format as the `POST` request except that `id` must be provided.
338+
339+
**Headers:**
340+
341+
`Authorization: Bearer <administrator token>`
342+
343+
The administrator must be granted access to the `Magento_AdobeIoEventsClient::event_provider_edit` resource.
344+
345+
**Payload Parameters:**
346+
347+
Name | Format | Required | Description
348+
--- |--------| --- | ---
349+
`id` | integer | required | The ID assigned to the registered event provider.
350+
`provider_id` | string | required | The event provider ID.
351+
`instance_id` | string | required | The instance ID of event provider.
352+
`label` | string | optional | A label of the event provider.
353+
`description` | string | optional | A description of the event provider.
354+
`workspace_configuration` | string | optional | The contents of the workspace configuration file downloaded from the Adobe Developer Console associated with the event provider.
355+
356+
**Example usage:**
357+
358+
The following cURL command updates an event provider:
359+
360+
```bash
361+
curl -i -X PUT \
362+
-H "Content-Type:application/json" \
363+
-H "Authorization:Bearer <AUTH_TOKEN>" \
364+
-d \
365+
'{
366+
"eventProvider": {
367+
"id": "3",
368+
"provider_id": "1902bc50-12345-41e8-955b-af4a9667823f",
369+
"instance_id": "my_instance_id",
370+
"label": "My Updated provider",
371+
"description": "Updated description of additional event provider"
372+
}
373+
}' \
374+
'<ADOBE_COMMERCE_URL>/rest/all/V1/eventing/eventProvider'
375+
```
376+
377+
**Example response:**
378+
379+
```json
380+
{
381+
"id": "3",
382+
"provider_id": "1902bc50-12345-41e8-955b-af4a9667823f",
383+
"instance_id": "my_instance_id",
384+
"label": "My Updated provider",
385+
"description": "Updated description of additional event provider",
386+
"workspace_configuration": "****"
387+
}
388+
```
389+
390+
### Delete event provider
391+
392+
The `DELETE /rest/<store_view_code>/V1/eventing/eventProvider/<provider_id>` endpoint deletes the event provider with the specified ID from the Adobe Commerce instance. The event provider is not removed from the Adobe Developer Console.
393+
394+
**Headers:**
395+
396+
`Authorization: Bearer <administrator token>`
397+
398+
The administrator must be granted access to the `Magento_AdobeIoEventsClient::event_provider_delete` resource.
399+
400+
**Example usage:**
401+
402+
The following cURL command deletes an event provider:
403+
404+
```bash
405+
curl -i -X DELETE \
406+
-H "Authorization:Bearer <AUTH_TOKEN>" \
407+
'<ADOBE_COMMERCE_URL>/rest/all/V1/eventing/eventProvider/1902bc50-12345-41e8-955b-af4a9667823f'
408+
```
409+
410+
The response will return a 200 status code if the event provider was deleted successfully. If the provider ID is not found, an appropriate error is returned.
411+
412+
### Get list of all event providers
413+
414+
The `GET /rest/<store_view_code>/V1/eventing/eventProvider` endpoint returns a list of all event providers configured for the Commerce instance.
277415

278416
**Headers:**
279417

@@ -283,11 +421,11 @@ The administrator must be granted access to the `Magento_AdobeIoEventsClient::ev
283421

284422
**Example usage:**
285423

286-
The following cURL command retrieves information about the configured event provider:
424+
The following cURL command retrieves information about all configured event providers:
287425

288426
```bash
289427
curl -H "Authorization:Bearer <AUTH_TOKEN>" \
290-
'<ADOBE_COMMERCE_URL>/rest/all/V1/eventing/getEventProviders' \
428+
'<ADOBE_COMMERCE_URL>/rest/all/V1/eventing/eventProvider'
291429
```
292430

293431
**Example response:**
@@ -298,7 +436,45 @@ curl -H "Authorization:Bearer <AUTH_TOKEN>" \
298436
"provider_id": "ad667bc6-1678-49ff-99fc-215d71ebf82f",
299437
"instance_id": "my_instance",
300438
"label": "my_provider",
301-
"description": "Provides out-of-process extensibility for Adobe Commerce"
439+
"description": "Provides out-of-process extensibility for Adobe Commerce",
440+
"workspace_configuration": "******"
441+
},
442+
{
443+
"provider_id": "1902bc50-12345-41e8-955b-af4a9667823f",
444+
"instance_id": "my_instance_id",
445+
"label": "my_provider_2",
446+
"description": "Additional event provider",
447+
"workspace_configuration": "******"
302448
}
303449
]
304450
```
451+
452+
### Get event provider by ID
453+
454+
The `GET /rest/<store_view_code>/V1/eventing/eventProvider/<provider_id>` endpoint returns the event provider with the specified ID. If the provider ID is not found, a 404 error is returned.
455+
456+
**Headers:**
457+
458+
`Authorization: Bearer <administrator token>`
459+
460+
The administrator must be granted access to the `Magento_AdobeIoEventsClient::event_provider_list` resource.
461+
462+
The following cURL command retrieves information about the configured event provider:
463+
464+
```bash
465+
curl -H "Authorization:Bearer <AUTH_TOKEN>" \
466+
'<ADOBE_COMMERCE_URL>/rest/all/V1/eventing/eventProvider/1902bc50-12345-41e8-955b-af4a9667823f'
467+
```
468+
469+
**Example response:**
470+
471+
```json
472+
{
473+
"id": "3",
474+
"provider_id": "1902bc50-12345-41e8-955b-af4a9667823f",
475+
"instance_id": "my_instance_id",
476+
"label": "my_provider_2",
477+
"description": "Additional event provider",
478+
"workspace_configuration": "******"
479+
}
480+
```

src/pages/events/commands.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ If you decide to omit the arguments, the `event-types.json` file must have the f
3838

3939
```json
4040
{
41-
"provider": {
42-
"label": "My Adobe Commerce Events",
43-
"description": "Provides out-of-process extensibility for Adobe Commerce"
44-
}
45-
}
41+
"provider": {
42+
"label": "My Adobe Commerce Events",
43+
"description": "Provides out-of-process extensibility for Adobe Commerce"
44+
}
45+
}
4646
```
4747

4848
As an alternative to above steps, you can click the [Create Event Provider](./configure-commerce.md#commerce-admin) button on the **General configuration** section of the Adobe I/O Events page in the Admin.
@@ -77,12 +77,18 @@ The `events:provider:info` command returns details about a configured event prov
7777

7878
### Usage
7979

80-
`events:provider:info`
80+
`events:provider:info --provider-id <provider-id>`
81+
82+
### Options
83+
84+
`--provider-id` The ID of the event provider to query. If not provided, the command returns details about the default event provider.
8185

8286
### Example
8387

88+
The following example returns details about the provider with the ID `abcdef12-e499-5a0a-a683-1234567890ab`.
89+
8490
```bash
85-
bin/magento events:provider:info
91+
bin/magento events:provider:info --provider-id abcdef12-e499-5a0a-a683-1234567890ab
8692
```
8793

8894
### Response
@@ -132,6 +138,8 @@ bin/magento events:registrations:list -vv
132138
+----------------------+--------------------------------------+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
133139
```
134140

141+
To show registrations only for a specific provider, use the `--provider-id <PROVIDER_ID>` option.
142+
135143
## Create event metadata in Adobe I/O
136144

137145
The `events:metadata:populate` command creates event metadata based on XML and application configurations. This metadata gets linked to the configured event provider.
@@ -195,7 +203,7 @@ If you are implementing eventing in a performance testing environment, run the `
195203

196204
### Usage
197205

198-
`bin/magento events:subscribe <event_code> --force --fields=<name1> --fields=<name2> --parent <event_code> --rules=<field-name>|<operator>|<value> --rules=<field-name2>|<operator>|<value2> --hipaaAuditRequired --priority --destination=<destination>`
206+
`bin/magento events:subscribe <event_code> --force --fields=<name1> --fields=<name2> --parent <event_code> --rules=<field-name>|<operator>|<value> --rules=<field-name2>|<operator>|<value2> --hipaaAuditRequired --priority --destination=<destination> --providerId=<provicerId>`
199207

200208
### Arguments
201209

@@ -217,6 +225,8 @@ If you are implementing eventing in a performance testing environment, run the `
217225

218226
`--destination`, `-d` A custom destination for the event. This argument is used for SaaS integrations.
219227

228+
`--providerId` The event provider to which events will be delivered. If not provided the default event provider will be used. To configure additional event providers refer to the [Configure additional event providers](./configure-commerce.md) section.
229+
220230
`--hipaaAuditRequired` Indicates the event contains data that is subject to HIPAA auditing.`
221231

222232
### Example
@@ -289,6 +299,8 @@ observer.catalog_product_save_after
289299
observer.customer_login
290300
```
291301

302+
To return list of subscribed events with verbose output, use the `-v` or `-vv` option.
303+
292304
## List supported events
293305

294306
The `events:list:all` command returns a list of supported events defined in the specified module. (Commerce Eventing does not support all possible events.) The command returns an error if the specified module has been disabled.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: Configure Additional Event Providers
3+
description: Learn how to configure additional event providers in Adobe Commerce.
4+
keywords:
5+
- Events
6+
- Extensibility
7+
---
8+
9+
# Configure additional event providers in Adobe Commerce
10+
11+
You might need to connect your Adobe Commerce instance to other event providers besides the [default Commerce event provider](configure-commerce.md#create-an-event-provider) registered in the system configuration.
12+
13+
To link your event subscriptions to an additional event provider, the provider must be registered in the Adobe Commerce instance. You can configure the provider from the Adobe Commerce Admin or [through the API](api.md#event-provider-management).
14+
15+
## Configure event providers in the Admin
16+
17+
To manage event providers in the Adobe Commerce Admin, go to **System** > **Events** > **Event Providers**. The Event Providers page lists all additional event providers configured in your Adobe Commerce instance.
18+
19+
![Event Providers](../_images/events/multiprovider-grid.png)
20+
21+
To add a new event provider, click **Add New Provider**. Keep in mind that the event provider must be created in the Adobe I/O Events before you can add it to your Commerce instance. You can create the event provider the using [`aio` CLI tool](https://developer.adobe.com/events/docs/guides/cli/#provider-commands) or to use the [Adobe I/O Events API](https://developer.adobe.com/events/docs/api/#tag/Providers/operation/createProvider).
22+
23+
![Add New Provider](../_images/events/multiprovider-create.png)
24+
25+
`Provider ID` and `Instance ID` are required fields, while the `Workspace Configuration` field is optional. If provided, it synchronizes the event metadata registered with this provider. Otherwise, the creation of event metadata will be skipped. The `Workspace Configuration` must be provided from the workspace where the event provider was created. You can [download the workspace configuration from the Adobe Developer Console](./project-setup.md#download-the-workspace-configuration-file).
26+
27+
### Delete an event provider
28+
29+
To delete an event provider, select the action next to the provider you want to delete and click **Delete**. A confirmation dialog appears. Click **OK** to confirm the deletion.
30+
31+
<InlineAlert variant="info" slots="text1" />
32+
33+
The event provider cannot be deleted if it is used in any event subscriptions. You must first delete the event subscriptions that use this provider.

src/pages/events/release-notes.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ These release notes describe the latest version of Adobe I/O Events for Adobe Co
1212

1313
See [Update Adobe I/O Events for Adobe Commerce](installation.md#update-adobe-io-events-for-adobe-commerce) for upgrade instructions.
1414

15+
## Version 1.12.0
16+
17+
### Release date
18+
19+
April 17, 2025
20+
21+
### Enhancements
22+
23+
* Added support of [multiple event providers](./configure-additional-event-providers.md) <!-- CEXT-4383 -->
24+
25+
* Improved conversion of event payloads. In some cases payload of extension attributes was not converted correctly. <!-- CEXT-4487 -->
26+
1527
## Version 1.11.1
1628

1729
### Release date

0 commit comments

Comments
 (0)