-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update processors docs * update processor docs * update webhook processor doc * add error processor * fix error processor specs * update docs
- Loading branch information
1 parent
50dd4a9
commit 0a8f988
Showing
15 changed files
with
274 additions
and
71 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
--- | ||
IMPORTANT: This file was generated using src/processorgen/main.go. DO NOT EDIT. | ||
|
||
title: 'error' | ||
sidebar_position: 5 | ||
--- | ||
|
||
import ReactDiffViewer from 'react-diff-viewer'; | ||
import Chip from '@mui/material/Chip'; | ||
import Box from "@mui/system/Box"; | ||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
|
||
# `error` | ||
|
||
Returns an error for all records that get passed to the processor. | ||
|
||
## Description | ||
|
||
Any time a record is passed to this processor it returns an error, | ||
which results in the record being sent to the DLQ if it's configured, or the pipeline stopping. | ||
|
||
**Important:** Make sure to add a [condition](https://conduit.io/docs/processors/conditions) | ||
to this processor, otherwise all records will trigger an error. | ||
|
||
## Configuration parameters | ||
|
||
<Tabs groupId="config-params"> | ||
<TabItem value="yaml" label="YAML"> | ||
```yaml | ||
version: 2.2 | ||
pipelines: | ||
- id: example | ||
status: running | ||
connectors: | ||
# define source and destination ... | ||
processors: | ||
- id: example | ||
plugin: "error" | ||
settings: | ||
# Error message to be returned. This can be a Go | ||
# [template](https://pkg.go.dev/text/template) executed on each | ||
# [`Record`](https://pkg.go.dev/github.com/conduitio/conduit-commons/opencdc#Record) | ||
# being processed. | ||
# Type: string | ||
message: "error processor triggered" | ||
``` | ||
</TabItem> | ||
<TabItem value="table" label="Table"> | ||
<table class="no-margin-table"> | ||
<tr> | ||
<th>Name</th> | ||
<th>Type</th> | ||
<th>Default</th> | ||
<th>Description</th> | ||
</tr> | ||
<tr> | ||
<td>`message`</td> | ||
<td>string</td> | ||
<td>`error processor triggered`</td> | ||
<td> | ||
Error message to be returned. This can be a Go [template](https://pkg.go.dev/text/template) | ||
executed on each [`Record`](https://pkg.go.dev/github.com/conduitio/conduit-commons/opencdc#Record) | ||
being processed. | ||
</td> | ||
</tr> | ||
</table> | ||
</TabItem> | ||
</Tabs> | ||
|
||
## Examples | ||
|
||
### Error record with custom error message | ||
|
||
This example shows how to configure the error processor to | ||
return a custom error message for a record using a Go template. | ||
|
||
#### Configuration parameters | ||
|
||
<Tabs groupId="config-params"> | ||
<TabItem value="yaml" label="YAML"> | ||
```yaml | ||
version: 2.2 | ||
pipelines: | ||
- id: example | ||
status: running | ||
connectors: | ||
# define source and destination ... | ||
processors: | ||
- id: example | ||
plugin: "error" | ||
settings: | ||
message: "custom error message with data from record: {{.Metadata.foo}}" | ||
``` | ||
</TabItem> | ||
<TabItem value="table" label="Table"> | ||
<table class="no-margin-table"> | ||
<tr> | ||
<th>Name</th> | ||
<th>Value</th> | ||
</tr> | ||
<tr> | ||
<td>`message`</td> | ||
<td>`custom error message with data from record: {{.Metadata.foo}}`</td> | ||
</tr> | ||
</table> | ||
</TabItem> | ||
</Tabs> | ||
|
||
#### Record difference | ||
|
||
```mdx-code-block | ||
<Box className='diff-viewer'> | ||
<ReactDiffViewer | ||
styles={{ | ||
diffContainer: { | ||
overflowX: 'auto', | ||
overflowY: 'hidden', | ||
}, | ||
}} | ||
leftTitle={'Before'} | ||
rightTitle={'After'} | ||
oldValue={"{\n \"position\": null,\n \"operation\": \"create\",\n \"metadata\": {\n \"foo\": \"bar\"\n },\n \"key\": null,\n \"payload\": {\n \"before\": {\n \"bar\": \"baz\"\n },\n \"after\": {\n \"foo\": \"bar\"\n }\n }\n}"} | ||
newValue={"{\n \"error\": \"custom error message with data from record: bar\"\n}"} | ||
hideLineNumbers={false} | ||
showDiffOnly={false} | ||
splitView={true} | ||
/> | ||
</Box> | ||
``` | ||
|
||
|
||
|
||
![scarf pixel conduit-site-docs-processors](https://static.scarf.sh/a.png?x-pxid=33ce4d9e-1948-4cab-846a-7e6cd33b8cae) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.