Skip to main content

CDC Sink: Update Task

Update a CDC Sink task via Client API

Use UpdateCdcSinkOperation to modify an existing task.

Start from the existing task configuration, apply your changes, and send the complete updated CdcSinkConfiguration.

The update operation replaces the saved task configuration, so include any unchanged settings you want to keep.
The task to update is selected by the taskId passed to UpdateCdcSinkOperation.

// config contains the existing task configuration with the changes applied.

config.Tables.Add(new CdcSinkTableConfig
{
CollectionName = "Customers",
SourceTableName = "customers",
PrimaryKeyColumns = new List<string> { "id" },
Columns =
[
new CdcColumnMapping() { Column = "id", Name = "Id" },
new CdcColumnMapping() { Column = "name", Name = "Name" },
new CdcColumnMapping() { Column = "email", Name = "Email" },
]
});

// Execute the operation by passing it to Maintenance.Send
store.Maintenance.Send(new UpdateCdcSinkOperation(taskId, config));

For PostgreSQL tasks, adding or removing tables can require updating the PostgreSQL publication.
See PostgreSQL - Cleanup and Maintenance for details.

Update a CDC Sink task via Studio

To edit a CDC Sink task in the Studio:

Create task 12

  1. Navigate to Databases → your database → TasksOngoing Tasks.
  2. Under the SINK (SOURCE ⇒ RavenDB) group,
    click the task's name (or the edit icon) to open the same configuration form used for creation, now in edit mode.
  3. Modify the connection string, tables, column mappings, or patches as needed, then click Save.

Update a CDC Sink task via REST API

To update a CDC Sink task through REST, send a PUT request to the same endpoint used to create a task,
with the task ID in the id query string parameter.

The request body must contain the complete updated JSON CdcSinkConfiguration.
If id is omitted, the same endpoint creates a new CDC Sink task.

MethodEndpointAuth
PUT/databases/{databaseName}/admin/cdc-sink?id={taskId}DatabaseAdmin