benthos stream nats 集成试用
测试demo 来自官方例子
使用docker-compose 进行运行
nats docker-compose file
version: '3.3'
services:
nats:
image: nats
ports:
- "4222:4222"
- "8222:8222"
- "6222:6222"
benthos stream 配置
参考 https://github.com/Jeffail/benthos/tree/master/resources/docker/streams
整体说明
里面的例子就是数据从文件读取到nats 之后不同的消费者进行nats 消息消费,再到webhook,webhook 标准输出文件读取说明
读取文件,之后到nats
input:
type: read_until
read_until:
condition:
type: static
static: false
input:
type: file
file:
path: ./sample.json
restart_input: true
pipeline:
processors:
- type: throttle
throttle:
period: 3s
output:
type: nats
nats:
subject: benthos_messages
urls:
- nats://localhost:4222
- nats 消费者(三个)
input:
type: nats
nats:
subject: benthos_messages
urls:
- nats://localhost:4222
pipeline:
processors:
- type: filter
filter:
type: jmespath
jmespath:
query: |
keys(@) | contains(@, 'title')
output:
type: http_client
http_client:
url: http://localhost:4195/webhooks/post/customer1
verb: POST
- webhook 配置
input:
type: broker
broker:
inputs:
- type: http_server
http_server:
path: /post/customer1
processors:
- type: text
text:
operator: prepend
value: "Customer 1 received: "
- type: http_server
http_server:
path: /post/customer2
processors:
- type: text
text:
operator: prepend
value: "Customer 2 received: "
- type: http_server
http_server:
path: /post/customer3
processors:
- type: text
text:
operator: prepend
value: "Customer 3 received: "
output:
type: stdout
运行
- docker-compose
dokcer-compose up -d
- 启动benthos,基于文件stream 配置
benthos --streams --streams-dir ./configs
运行效果
修改sample.json 测试

参考资料
https://github.com/Jeffail/benthos/tree/master/resources/docker/streams
benthos stream nats 集成试用的更多相关文章
- streamsets 集成 rabbitmq 以及benthos stream 处理框架
benthos 是一个stream 处理框架,streamsets 也是,但是两者可以通过不同的工具进行集成起来 一般我们可以使用http 服务,消息中间件(kafka.rabbitmq ...) 使 ...
- benthos stream 处理工具说明
benthos 是golang 编写的流处理工具,同时也可以作为一个类库使用,当前支持的source sink 还是比较全的 (kafka rabbitmq http service s3 redis ...
- pushpin Server-sent events && openresty 集成试用
前边有写过一个简单pushpin 集成stream 的demo,这次测试下sse 的功能 备注: 环境依然使用的是docker-compose运行 环境准备 docker-compose 文件 ver ...
- pushpin openresty 集成试用
pushpin 是一个很不错的将restapi 转换为reailtime api 的proxy,openresty 具有很强的nginx 控制能力 可以方便的用来进行api 的开发,默认其他语言pus ...
- gearman openresty 集成试用
很简单使用了一个openresty 的lua 模块 环境准备 docker-compose 文件 详细配置可以参考 https://github.com/rongfengliang/gearmango ...
- gogs wekan 集成试用
wekan 官方提供了一个集成gogs 的扩展,不是完全的自动化,需要结合cli,但是官方的cli 写的...(不是很全) 备注: 测试环境使用docker-compose 环境准备 docker-c ...
- graphql elasticsearch 集成试用
graphql 是很方便的api 查询语言,elasticsearch 可以方便的进行全文检索的应用开发 有一个方便的npm 包graphql-compose-elasticsearch 可以进行es ...
- hasura graphql server event trigger 试用
hasura graphql server 是一个很不错的graphql 引擎,当前版本已经支持event triiger 了 使用此功能我们可以方便的集成webhook功能,实现灵活,稳定,快捷的消 ...
- Akka(27): Stream:Use case-Connecting Slick-dbStream & Scalaz-stream-fs2
在以前的博文中我们介绍了Slick,它是一种FRM(Functional Relation Mapper).有别于ORM,FRM的特点是函数式的语法可以支持灵活的对象组合(Query Composit ...
随机推荐
- 搭建Eclipse+ADT+Android SDK 安卓开发环境
安装JDK 请看JDK环境搭建 即可. 安装Eclipse Eclipse 是一个开放源代码的.基于Java的可扩展开发平台.就其本身而言,它只是一个框架和一组服务,用于通过插件组件构建开发环境.幸运 ...
- eclipse设置条件断点
1. 在Breakpoints页面,选中断点然后右键,选择"Breakpoint Properties" 2. 勾选Conditional,并输入条件.这样,当name等于&quo ...
- html form表单提交后处理返回数据
上传如果通过form提交并且需要处理返回值.(其实用ajax上传方式刚好,看需要) 可以这么做: <form id="importBookForm" action=" ...
- windows创建窗口、关闭窗口流程
NC,即 non-client 区域,包括标题栏.窗口边框.最大.最小按钮.滚动条等. 一.在调用Windows的::CreateWindowEx函数创建窗口时,一般会先发出 WM_NCCREATE消 ...
- SQL Server 数据库获取架构信息
得到数据库存储过程列表: select * from dbo.sysobjects where OBJECTPROPERTY(id, N'IsProcedure') = 1 order by name ...
- 关于双网卡双宽带Http及Socks代理的配置
1.[硬件环境] a, 1台宿主(win7)+几十台虚拟机(xp)(vm10的版本,估计可打开52台以上的虚拟机) b, 双网卡,其中一个网卡通过路由连接电信ADSL,一个直连集线器,可直接连接移动m ...
- glusterfs分布式存储
一,分布式文件系统理论基础 1.1 分布式文件系统出现 计算机通过文件系统管理,存储数据,而现在数据信息爆炸的时代中人们可以获取的数据成指数倍的增长,单纯通过增加硬盘个数来扩展计算机文件系统的存储容量 ...
- 怎么从sqlserver的存储过程获得返回的数据
1.返回一个数值 declare @count int exec @count = testReturn \'111\',\'222\' select @count @count就是返回的数值是int ...
- <NET CLR via c# 第4版>笔记 第11章 事件
11.1 设计要公开事件的类型 11.1.1 第一步: 定义类型来容纳所有需要发送给事件通知接收者的附加信息 //第一步:定义一个类型来容纳所有应该发送给事件通知接收者的附加信息 internal c ...
- Maven私服Nexus详解
maven的仓库只有两大类:1.本地仓库 2.远程仓库,在远程仓库中又分成了3种:2.1 中央仓库 2.2 私服 2.3 其它公共库. 私服是一种特殊的远程仓库,它是架设在局域网内的仓库服务,私服代理 ...