Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple HTTP Call Response Sources #158

Open
sybernix opened this issue Nov 13, 2019 · 1 comment
Open

Multiple HTTP Call Response Sources #158

sybernix opened this issue Nov 13, 2019 · 1 comment

Comments

@sybernix
Copy link
Contributor

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

@sybernix
Copy link
Contributor Author

#156 This attempted to fix the issue but further effort is needed to clone Carbon http messages between sources.

wso2/product-sp#1051 is a related issue arising from the inconsistency of equals function in ResponseSourceId.java with regard to registering the source and removing it during shutting down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant