ETL-33-apache SeaTunnel 实战 13 source http 实战例子
2024年1月5日大约 3 分钟
http source
场景:我们希望定时调用一个 http 请求
实战
配置
我们简单点,直接以百度为例子。
# Defining the runtime environment
env {
# You can set flink configuration here
parallelism = 1
job.mode = "STREAMING"
checkpoint.interval = 10000
}
source{
Http {
url = "https://www.baidu.com/"
method = "GET"
format = "text"
poll_interval_millis = 5000
}
}
transform {
# If you would like to get more information about how to configure seatunnel and see full list of transform plugins,
# please go to https://seatunnel.apache.org/docs/transform-v2/sql
}
sink {
# 使用自定义的控台输出,避免 console 异常。
ConsoleBinlog {
}
}
我们配置定义了 5s 请求一次百度。
效果
2024-01-31 10:44:30.359 ~~~~~~~~~~~~ SeaTunnelRow{tableId=, kind=+I, fields=[
百度一下,你就知道 新闻 hao123 地图 视频 贴吧 登录 document.write('登录');
更多产品 关于百度 About Baidu ©2017 Baidu 使用百度前必读 意见反馈 京ICP证030173号
]}
2024-01-31 10:44:35.395 ~~~~~~~~~~~~ SeaTunnelRow{tableId=, kind=+I, fields=[
百度一下,你就知道 新闻 hao123 地图 视频 贴吧 登录 document.write('登录');
更多产品 关于百度 About Baidu ©2017 Baidu 使用百度前必读 意见反馈 京ICP证030173号
]}
贡献者
binbin.hou