-
Notifications
You must be signed in to change notification settings - Fork 26
/
mongodb-source.kamelet.yaml
110 lines (107 loc) · 6.36 KB
/
mongodb-source.kamelet.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
apiVersion: camel.apache.org/v1
kind: Kamelet
metadata:
name: mongodb-source
annotations:
camel.apache.org/kamelet.support.level: "Stable"
camel.apache.org/catalog.version: "2.3.0"
camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMzEgNjciIGZpbGw9IiNmZmYiIGZpbGwtcnVsZT0iZXZlbm9kZCIgc3Ryb2tlPSIjMDAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjx1c2UgeGxpbms6aHJlZj0iI0EiIHg9IjEiIHk9IjEiLz48c3ltYm9sIGlkPSJBIiBvdmVyZmxvdz0idmlzaWJsZSI+PGcgc3Ryb2tlPSJub25lIiBmaWxsLXJ1bGU9Im5vbnplcm8iPjxwYXRoIGQ9Ik0xNC4xNzQuMTc1bDEuNzA4IDMuMjA4Yy4zNzEuNTc5LjgwNCAxLjExNyAxLjI5IDEuNjA0IDEuNDMgMS40MyAyLjc4OCAyLjkyOCA0LjAwOCA0LjUzMiAyLjg5NCAzLjggNC44NDYgOCA2LjI0IDEyLjU4NGEzMC45NCAzMC45NCAwIDAgMSAxLjMyNCA4LjU0Yy4xNCA4LjY0Ni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AwIC4wNyAwIC4xNC4wMzQuMjQ0LjYyOCAxLjg0OC44IDMuNzMuOTA2IDUuNjQ4di43YzAgLjgzNi0uMDM0LjY2LjY2Ljk0LjI4LjEwNC41OTIuMTQuODcyLjM0OC4yMSAwIC4yNDQtLjE3NC4yNDQtLjMxNGwtLjEwNC0xLjE1di0zLjIwOGMtLjAzNC0uNTYuMDctMS4xMTYuMTQtMS42NHoiIGZpbGw9IiNjMmJmYmYiLz48L2c+PC9zeW1ib2w+PC9zdmc+"
camel.apache.org/provider: "Red Hat"
camel.apache.org/kamelet.group: "MongoDB"
camel.apache.org/kamelet.namespace: "Nosql"
labels:
camel.apache.org/kamelet.type: "source"
spec:
definition:
title: "MongoDB Source"
description: |-
Consume data from MongoDB.
If you enable the `persistentTailTracking` property, the consumer keeps track of the last consumed message and, on the next restart, the consumption restarts from that message. If you enable `persistentTailTracking`, you must provide a value for the `tailTrackIncreasingField` property (by default it is optional).
If you disable the `persistentTailTracking` property, the consumer consumes the whole collection and waits in idle for new data to consume.
The collection that provides the data must be a capped collection.
required:
- hosts
- collection
- database
type: object
properties:
hosts:
title: MongoDB Hosts
description: A comma-separated list of MongoDB host addresses in `host:port` format.
type: string
collection:
title: MongoDB Collection
description: The name of the MongoDB collection to bind to this endpoint.
type: string
password:
title: MongoDB Password
description: The user password for accessing MongoDB.
type: string
format: password
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
- urn:camel:group:credentials
username:
title: MongoDB Username
description: The username for accessing MongoDB. The username must be present in the MongoDB's authentication database (`authenticationDatabase`). By default, the MongoDB `authenticationDatabase` is 'admin'.
type: string
x-descriptors:
- urn:camel:group:credentials
ssl:
title: Enable Ssl for Mongodb Connection
description: whether to enable ssl connection to mongodb
type: boolean
default: true
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:checkbox'
sslValidationEnabled:
title: Enables Ssl Certificates Validation and Host name checks.
description: IMPORTANT this should be disabled only in test environment since can pose security issues.
type: boolean
default: true
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:checkbox'
database:
title: MongoDB Database
description: The name of the MongoDB database.
type: string
persistentTailTracking:
title: MongoDB Persistent Tail Tracking
description: Specifies to enable persistent tail tracking, which is a mechanism to keep track of the last consumed data across system restarts. The next time the system is up, the endpoint recovers the cursor from the point where it last stopped consuimg data. This option will only work on capped collections.
type: boolean
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:checkbox'
default: false
tailTrackIncreasingField:
title: MongoDB Tail Track Increasing Field
description: The correlation field in the incoming data which is of increasing nature and is used to position the tailing cursor every time it is generated.
type: string
dependencies:
- "camel:kamelet"
- "camel:mongodb"
- "camel:jackson"
- "mvn:org.apache.camel.kamelets:camel-kamelets-utils:2.3.0"
template:
beans:
- name: local-mongodb
type: "#class:org.apache.camel.component.mongodb.MongoDbComponent"
- name: mongo-client
type: "#class:org.apache.camel.kamelets.utils.mongodb.SslAwareMongoClient"
properties:
password: "{{?password}}"
username: "{{?username}}"
hosts: "{{hosts}}"
ssl: "{{ssl}}"
sslValidationEnabled: "{{sslValidationEnabled}}"
from:
uri: "{{local-mongodb}}:test"
parameters:
collection: "{{collection}}"
database: "{{database}}"
persistentTailTracking: "{{persistentTailTracking}}"
tailTrackIncreasingField: "{{?tailTrackIncreasingField}}"
mongoConnection: "#{{mongo-client}}"
steps:
- marshal:
json: {}
- to: kamelet:sink