是否可以在http接收器请求中生成并使用动态URL作为publisher.url?
我有一个输入流,它接受一个参数。根据我在这个流中传递的值,这应该作为基本URL的一部分包括在内,它将从另一个流接收参数。
@App:name("TestApp")
@source(type='http', receiver.url='http://0.0.0.0:8008/xyz', @map(type = 'json', @attributes(a='$.b', b='$.b', c='$.c', var='$.var')))
@sink(type='log')
define stream InputStream(a string, b string, c string, var string);
@source(type='http-response' ,sink.id='1234', @map(type='json', @attributes(a1='a1', a2='a2', a3='a3')))
@sink(type='log')
define stream ResponseStream (a1 string, a2 string, a3 string);
@sink(type='http-request', sink.id='1234', publisher.url='http://<host>:<port>/<var>/parse?a={{a}}&b={{b}}&c={{c}}', method='GET', headers="'Content-Type:text/plain'", @map(type='keyvalue', @payload(a='{{b}}', b='{{b}}', c='{{c}}')))
define stream InterStream (a string, b string, c string, var string);
from InputStream
select a, b, c, var
insert into InterStream;我希望将var作为我的基URL的一部分附加到我的基URL中,这是http-sink请求的发布者URL。
siddhi有这样的规定吗?
发布于 2019-09-19 19:49:23
是的,它与查询参数的作用相同。
publisher.url='http://<host>:<port>/{{var}}/parse?a={{a}}&b={{b}}&c={{c}}'https://stackoverflow.com/questions/58009342
复制相似问题