Documentation
Overview content is shown below. Use the menu to open other pages.
Integrations & Drivers
Concept
An Integration represents a destination (e.g., Magento 2). A Driver implements the actual delivery logic. Integrations can be enabled/disabled, filtered by entity type, and configured with per-field priorities and retries.
Discovery
- `App\Services\DriverDiscovery` collects tagged `integration` services from the container.
- Modules should bind the Driver in their ServiceProvider and tag it:
- `$this->app->bind(Magento2Driver::class);`
- `$this->app->tag([Magento2Driver::class], ['integration', 'magento2']);`
Schema & Validation
- Drivers expose `getConfigurationSchema()` with Laravel validation rules. During `integration:register` we validate the given configuration.
- Store driver-specific mapping data under the Integration’s `field_mapping` key (e.g., Magento 2 `field_mapping.websites`). Avoid adding arbitrary top-level keys that don’t exist as DB columns.
Magento 2 Driver
- Location: `Modules/Magento2/app/Magento2Driver.php`
- Handles `created`/`updated` product mutations using a rules-based payload builder.
- Configuration schema:
- Client builder: `Modules/Magento2/app/Services/Magento2ClientBuilder.php`
- `base_url` (url)
- `consumer_key`, `consumer_secret`, `access_token`, `access_secret`
- `buildWithBearerToken(base_url, access_token)`
- Endpoint builder `rest/V1/{resource}`
- Magento REST docs: https://developer.adobe.com/commerce/webapi/rest/
Entity Filters
- Integration-level filters control which entity types this driver processes.
- Configure under `config/integrations.php`:
- `entity_filters = ['product', 'attribute', 'family', 'category']`
- Only listed entities will generate MutationJobs for the Magento 2 driver.
Mapping Service
- `EntityMappingServiceInterface` implemented by `DatabaseEntityMappingService` keeps track of external IDs per integration.
- Drivers should:
- Lookup mapping by (entity_type, entity_uuid, integration_uuid).
- Update/create mappings when external entities are created.
- IEC contracts: see `docs/iec/10-integration-contracts.md`
Priorities
- Integrations define a `priority_map` mapping changed field codes to numeric priorities (lower = higher priority). A wildcard `*` provides a default.
- Example (see `config/integrations.php`):
- IEC resolves queue names via `QueueResolver` to the priority queues:
- `selling_price_scope: 10`, `automated_price: 10` (price updates are immediate)
- `properties: 20`
- `enabled: 30`
- `*: 100`
- `integrations-immediate` (<= 50)
- `integrations-normal` (<= 200)
- `integrations-low` (<= 250)
- Fallback → `integrations-low`
Docs Index
- Overview docs/iec/00-overview.md
- Quickstart docs/iec/01-quickstart.md
- Architecture docs/iec/02-architecture.md
- Data Model docs/iec/03-data-model.md
- Queues & Horizon docs/iec/04-queue-and-horizon.md
- CLI Commands docs/iec/05-commands.md
- Integrations & Drivers docs/iec/06-integrations-and-drivers.md
- Akeneo → Magento 2 docs/iec/07-akeneo-to-magento2.md
- Operations & Troubleshooting docs/iec/08-operations-and-troubleshooting.md
- Mutations docs/iec/09-mutations.md
- Integration Contracts docs/iec/10-integration-contracts.md
- Dashboard docs/iec/11-dashboard.md
- Maintenance & Retention docs/maintenance.md
Current file: docs/iec/06-integrations-and-drivers.md