0

是否可以在 http sink 请求中生成和使用动态 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 的一部分,这是 http-sink 请求的发布者 URL。

悉地有这样的规定吗?

4

1 回答 1

1

是的,它的工作原理与查询参数相同,

 publisher.url='http://<host>:<port>/{{var}}/parse?a={{a}}&b={{b}}&c={{c}}'
于 2019-09-19T11:49:23.357 回答