Skip to content

Multiple HTTP Call Response Sources #158

Open
@sybernix

Description

@sybernix

When using HTTP call and call response scenario we allow 2 sources with http.status.code = 200 and [2|4]00 to register in Siddhi app. However, when the response arrives, according to our current logic in findAndGetResponseSource method we randomly pick a source from the map matching the regex and send a response. Please find a sample app to simulate this below.

define stream FooStream (message String, headers String);
@sink(type='http-request',publisher.url='http://localhost:8005/abc', 
method='POST', 
headers='{{headers}}',sink.id='source-1', 
@map(type='json', @payload('{{message}}'))) 
Define stream BarStream (message String, headers String);

@source(type='http-response', sink.id='source-1', http.status.code='[2|4]00', 
@map(type='json',@attributes(name='name', id='id')))
define stream responseStream1(name String, id int);

@source(type='http-response', sink.id='source-1', http.status.code='200', 
@map(type='json',@attributes(name='name', id='id')))
define stream responseStream2(name String, id int);

We need to have a robust mechanism to handle such responses which need to be sent to multiple sources

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions