首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在Siddhi中使用'regex‘http.status.code处理响应

无法在Siddhi中使用'regex‘http.status.code处理响应
EN

Stack Overflow用户
提问于 2019-12-19 17:19:07
回答 2查看 99关注 0票数 0

无法使用以下命令处理响应,对于响应500:

代码语言:javascript
复制
@source(type='http-response', sink.id = 'serviceActivate', http.status.code = '5\d+', @map(type = 'json', @attributes(result = '$.result')))

代码语言:javascript
复制
@source(type='http-response', sink.id = 'serviceActivate', http.status.code = '[2|4|5]00', @map(type = 'json', @attributes(result = '$.result')))

我看到一个错误:

代码语言:javascript
复制
[2019-12-19 11:35:06,221] ERROR {org.wso2.extension.siddhi.io.http.source.HttpResponseMessageListener} - No source of type 'http-response' for status code '500' has been defined. Hence dropping the response message.

对于连续的多个源,不使用regexp,没有错误:

代码语言:javascript
复制
@source(.... http.status.code = '200',.....)
@source(.... http.status.code = '400',.....)
@source(.... http.status.code = '500',.....)

如何正确编写regexp?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2019-12-20 00:19:23

这似乎是由于bug,WSO2 SP 4.4.0是基于Siddhi核心4x,目前没有积极开发。我用最新的Siddhi Distribution 5.1.2测试了上面的内容,无法重现。有关siddhi 5x开发here的更多详细信息,请参阅。

票数 0
EN

Stack Overflow用户

发布于 2020-01-24 19:00:17

请尝试分别使用“2**”和“4**”的200和400范围状态的正则表达式。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59406540

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档