【问题标题】:Is it possible to generate and use a dynamic URL in WSO2SP?是否可以在 WSO2SP 中生成和使用动态 URL?
【发布时间】:2019-09-19 10:49:13
【问题描述】:

是否可以在 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。

悉地有这样的规定吗?

【问题讨论】:

    标签: siddhi stream-processing wso2sp


    【解决方案1】:

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

     publisher.url='http://<host>:<port>/{{var}}/parse?a={{a}}&b={{b}}&c={{c}}'
    

    【讨论】:

    猜你喜欢
    • 2018-08-05
    • 1970-01-01
    • 2013-10-30
    • 1970-01-01
    • 2022-11-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-14
    相关资源
    最近更新 更多