无法使用Siddhi中的'regex'http状态代码处理响应

问题描述 投票:1回答:1

我试图使用'regex'http响应代码'2 \ d +'处理/接收所有带有2xx状态代码的响应,但未按预期方式处理。当我直接输入http状态代码时(例如'202'),则它正在处理响应。但是我希望'regex'来处理它。

@source(type='http-response', sink.id='Response',http.status.code='2\\d+', @map(type='json',@attributes(success = 'status')))
@sink(type='log')
define stream ResponseStream(success string);

这是我使用正则表达式代码时得到的响应。

[2019-11-26 07:16:42,705]错误{org.wso2.extension.siddhi.io.http.source.HttpResponseMessageListener}-未定义与状态代码“ 202”匹配的“ http-响应”类型的源。因此删除响应消息。

请帮助我使用正则表达式代码进行处理。

wso2 wso2carbon siddhi stream-processing wso2sp
1个回答
0
投票

在您的Siddhi查询中,您给出的状态代码为'2 \ d +'。请更改为“ 2 \ d +”

© www.soinside.com 2019 - 2024. All rights reserved.