-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrss-feed-to-s3.yml
41 lines (41 loc) · 1.22 KB
/
rss-feed-to-s3.yml
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
apiVersion: camel.apache.org/v1
kind: Integration
metadata:
name: rss-to-s3
spec:
configuration:
- type: configmap
value: rss-to-s3-configmap
- type: secret
value: aws
flows:
- from:
uri: rss://http://feeds.feedburner.com/TechCrunch/startups?splitEntries=true&delay=1000
steps:
- marshal:
rss: {}
- set-header:
name: title
xpath: "//item/title/text()"
- set-header:
name: description
xpath: "//item/description/text()"
- set-header:
name: id
xpath:
expression: "//item/link/text()"
result-type: "java.lang.String"
- set-body:
simple: '{"id": "${header.id}", "title": "${header.title}", "description": "${header.description}"'
- set-header:
name: CamelAwsS3Key
simple: "rss/techrunch/${header[id].replaceAll('[^A-Za-z0-9]', '')}.json"
- marshal:
json: {}
- log: "${header.CamelAwsS3Key}"
- to:
uri: aws-s3://{{BUCKET}}
parameters:
accessKey: "{{ACCESS_KEY}}"
secretKey: "{{SECRET_KEY}}"
region: "{{REGION}}"