Kafka Event publish details for merge API

Kafka Event publish details for merge API

The Merge API publishes events to a Kafka topic for user creation and update operations. The events include details about the changes, captured in a structured payload.

Both user creation and update event published into below Kafka topic

Kafka Topic Name: folio-dev-volaris.ALL.users.users

Each event payload includes a field type, which denotes the type of operation performed:

  • CREATED: Indicates the creation of a new user from a staging user.

  • UPDATED: Indicates the update of an existing user from a staging user.

Event Types and Payloads

1. CREATED Event

Triggered when a new user is created from a staging user.

Sample Payload:

{ "id": "b02de440-712b-414e-b7fa-760533cd0dfe", "type": "CREATED", "tenant": "diku", "timestamp": 1735639196468, "data": { "new": { "id": "c6796695-c185-4dd7-ac6c-448173bcbd23", "externalSystemId": "e8917733-fbfc-419f-b089-225b4320475d", "active": true, "type": "patron", "patronGroup": "3a0e61a4-d780-5d02-93b9-9dd86a8054e1", "departments": [], "proxyFor": [], "personal": { "lastName": "Kapil-Staging-1", "firstName": "Kapil-Staging-1", "middleName": "Kapil-Staging-1", "email": "Kapil-12345@test.com", "phone": "555-123456", "mobilePhone": "555-5678", "addresses": [ { "id": "4c7cf34d-35d0-443a-bb27-0f5702d7529a", "countryId": "USA", "addressLine1": "123 Main St", "addressLine2": "Apt 4B", "city": "Metropolis", "region": "NY", "postalCode": "12345", "addressTypeId": "93d3d88d-499b-45d0-9bc7-ac73c3a19880", "primaryAddress": true } ], "preferredContactTypeId": "002" }, "enrollmentDate": "2024-12-31T09:52:28.228+00:00", "expirationDate": "2026-12-31T00:00:00.000+00:00", "metadata": { "createdDate": "2024-12-31T09:59:56.459+00:00", "createdByUserId": "1fb9e065-8c6c-428c-a836-4a5e5a9a9fb8", "updatedDate": "2024-12-31T09:59:56.459+00:00", "updatedByUserId": "1fb9e065-8c6c-428c-a836-4a5e5a9a9fb8" }, "preferredEmailCommunication": [ "Programs", "Support", "Services" ] } } }

2. UPDATED Event

Triggered when an existing user is updated from a staging user.

Sample Payload:

{ "id": "e83855d0-a707-47c0-a66d-0cbf44ce0ee7", "type": "UPDATED", "tenant": "diku", "timestamp": 1735634992365, "data": { "old": { "username": "Kapil-2", "id": "d0214504-215f-44cc-8b22-3e042668bf91", "externalSystemId": "3c5bf2a3-4a91-447c-80be-6e33c70a9d1f", "active": true, "type": "patron", "patronGroup": "3a0e61a4-d780-5d02-93b9-9dd86a8054e1", "departments": [], "proxyFor": [], "personal": { "lastName": "Kapil-Staging-1", "firstName": "Kapil-Staging-1", "middleName": "Kapil-Staging-1", "email": "Kapil-1@test.com", "phone": "555-123456", "mobilePhone": "555-5678", "addresses": [ { "id": "33295434-76ff-41d4-bd66-225a9081f62d", "countryId": "USA", "addressLine1": "123 Main St", "addressLine2": "Apt 4B", "city": "Metropolis", "region": "NY", "postalCode": "12345", "addressTypeId": "93d3d88d-499b-45d0-9bc7-ac73c3a19880", "primaryAddress": true } ], "preferredContactTypeId": "002" }, "enrollmentDate": "2024-12-31T08:44:06.047+00:00", "expirationDate": "2026-12-31T23:59:59.999+00:00", "createdDate": "2024-12-31T08:42:58.136+00:00", "updatedDate": "2024-12-31T08:42:58.136+00:00", "metadata": { "createdDate": "2024-12-31T08:42:58.130+00:00", "createdByUserId": "1fb9e065-8c6c-428c-a836-4a5e5a9a9fb8", "updatedDate": "2024-12-31T08:45:06.275+00:00", "updatedByUserId": "1fb9e065-8c6c-428c-a836-4a5e5a9a9fb8" }, "preferredEmailCommunication": [ "Programs", "Support", "Services" ] }, "new": { "username": "Kapil-2", "id": "d0214504-215f-44cc-8b22-3e042668bf91", "externalSystemId": "79b160c5-e592-461e-9844-6d9163b0a73c", "active": true, "type": "patron", "patronGroup": "3a0e61a4-d780-5d02-93b9-9dd86a8054e1", "departments": [], "proxyFor": [], "personal": { "lastName": "Kapil-Staging-1", "firstName": "Kapil-Staging-1", "middleName": "Kapil-Staging-1", "email": "Kapil-1@test.com", "phone": "555-123456", "mobilePhone": "555-5678", "addresses": [ { "id": "33295434-76ff-41d4-bd66-225a9081f62d", "countryId": "USA", "addressLine1": "123 Main St", "addressLine2": "Apt 4B", "city": "Metropolis", "region": "NY", "postalCode": "12345", "addressTypeId": "93d3d88d-499b-45d0-9bc7-ac73c3a19880", "primaryAddress": true } ], "preferredContactTypeId": "002" }, "enrollmentDate": "2024-12-31T08:48:00.054+00:00", "expirationDate": "2026-12-31T23:59:59.999+00:00", "createdDate": "2024-12-31T08:42:58.136+00:00", "updatedDate": "2024-12-31T08:42:58.136+00:00", "metadata": { "createdDate": "2024-12-31T08:42:58.130+00:00", "createdByUserId": "1fb9e065-8c6c-428c-a836-4a5e5a9a9fb8", "updatedDate": "2024-12-31T08:49:52.354+00:00", "updatedByUserId": "1fb9e065-8c6c-428c-a836-4a5e5a9a9fb8" }, "preferredEmailCommunication": [ "Programs", "Support", "Services" ] } } }

 

 

User Expiration via Cron Job Scheduler

The User Expiration Cron Job Scheduler API handles the expiration of users by updating their active flag from true to false.

For this operation, an UPDATED event is published to the same Kafka topic (folio-dev-volaris.ALL.users.users).

  • The UPDATED event structure remains the same as defined earlier.

  • The NEW node in the payload reflects the change, with the active field set to false.

Example of the Updated Payload:

{ "id": "f234bd89-1a12-4dc5-932b-7e482f345bc7", "type": "UPDATED", "tenant": "diku", "timestamp": 1735639999999, "data": { "old": { "id": "a1b2c3d4-5678-9101-1121-314151617181", "active": true, "personal": { "lastName": "Doe", "firstName": "John", "email": "john.doe@example.com" }, "metadata": { "updatedDate": "2025-01-01T10:00:00.000+00:00" } }, "new": { "id": "a1b2c3d4-5678-9101-1121-314151617181", "active": false, "personal": { "lastName": "Doe", "firstName": "John", "email": "john.doe@example.com" }, "metadata": { "updatedDate": "2025-01-01T11:00:00.000+00:00" } } } }

 

Related content