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

Unable to receive the json responce to the source #80

Closed
Lasith650 opened this issue Sep 25, 2018 · 2 comments
Closed

Unable to receive the json responce to the source #80

Lasith650 opened this issue Sep 25, 2018 · 2 comments
Assignees

Comments

@Lasith650
Copy link

Lasith650 commented Sep 25, 2018

Description:
I am trying to connect to the github api through a siddhi app using the bellow code,

@app:name("RequestResponseSample")
@app:description('This sample siddhi app demonstrates how to use transport properties along with request sink and response source')

define stream regStream (id String);

@sink(type='http-request', publisher.url='http://api.github.com/repos/wso2/product-sp/releases',
method='POST',
chunk.disabled='true',
sink.id='reg-company',
@Map(type='json', @payload("""{"id":"{{id}}"}""")))
define stream requestStream (id string);

-- source to receive successful responses (which have 2xx status codes)
@source(type='http-response' , sink.id='reg-company', http.status.code='200',
@Map(type='json', @attributes(tag_name='$.tag_name')))
define stream responseStream(tag_name string);

-- source to receive the responses with 4xx status codes
@source(type='http-response' , sink.id='reg-company', http.status.code='403' ,
@Map(type='text', regex.A='((.|\n)*)', @attributes(message='A[1]')))
define stream responseStream4xx(message string);

@sink(type='log')
define stream logStream(tag_name string);

from regStream
select id
insert into requestStream;

from responseStream
select *
insert into logStream;

But I am not getting a response. It displays an error message saying that the channel is inactive

Bellow is the response I received when I requested through "Postman"

image
@minudika

@minudika
Copy link
Contributor

minudika commented Oct 7, 2018

Tried to reproduce this but could not reproduce the exact issue.
When calling to the given endpoint we encountered the issue #83.

@mohanvive
Copy link
Contributor

Closing the issue since related redirection issue is handled by another ticket ...

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

No branches or pull requests

3 participants