Reputation: 1
I have a hosted http service that accepts a trend data and returns some output. This service is accessed in siddhi query language as follows:
@sink(type='http-request', sink.id='trends',
publisher.url='${SERVICE_URL}', @map(type='json', @payload(""" {"trend":{{trendArray}} } """) ) )
define stream Request(item string, trendArray string);
@source(type='http-response' , sink.id='trends', http.status.code='200',
@map(type='json', @attributes(stock = '<HOW_TO_GET_THIS_VALUE>', output = "<HOW_TO_GET_THIS_VALUE>")
) )
define stream Response(item string, output string);
The http request(and response) payload doesn't include item name.
- when the response comes we would like to assign item name against which we scored the output - marked as HOW_TO_GET_THIS_VALUE above. How to accomplish this in siddhi query ?
- How to treat the response data of as-is as pass to the field ?
I did not see a description of this scenario in siddhi. If not supported, it will good to know details of a custom extension (based out of http extension) for this scenario. Solution to add a proxy layer for http call is less desired.
Upvotes: 0
Views: 87
Reputation: 1
After some experiments , HOW_TO_GET_THIS_VALUE = 'trp:item'. The http sink should also have this field even though its not used in payload.
Upvotes: 0