[Dev] [APIM] Content-Length of the message header is missing when it goes through the API Gateway

2017-01-10 Thread Hasunie Adikari
Hi all,

IOT backend server gives Content-length header of the response as expected,
But Issue is arisen while passing it through the API Gateway,
Content-Length of the response header is missing. We have already created
 a public JIRA [1]
for the issue in APIM 2.1.0 RC1.
Since the issue is affected only for few of APIS, We are trying to add some
custom sequence (outSequence) by creating per API Extensions [2].





 

[1] https://wso2.org/jira/browse/APIMANAGER-5573
[2] https://docs.wso2.com/display/AM1100/Adding+Mediation+Extensions


Thanks
Hasunie

-- 
*Hasunie Adikari*
Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware
blog http://hasuniea.blogspot.com
Mobile:+94713350904 <+94%2071%20335%200904>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [APIM] Content-Length of the message header is missing when it goes through the API Gateway

2017-01-10 Thread Joseph Fonseka
Hi Hasunie

It would be ideal if we can enable this only for the specific APIs but the
way IoT publisher's the APIs it will be hard to achieve.

Thanks
Jo

On Wed, Jan 11, 2017 at 4:18 AM, Hasunie Adikari  wrote:

> Hi all,
>
> IOT backend server gives Content-length header of the response as
> expected, But Issue is arisen while passing it through the API Gateway,
> Content-Length of the response header is missing. We have already created
>  a public JIRA [1]
> for the issue in APIM 2.1.0 RC1.
> Since the issue is affected only for few of APIS, We are trying to add
> some custom sequence (outSequence) by creating per API Extensions [2].
>
> 
>  value="true"/>
>  value="true" scope="axis2"/>
> 
>  
>
> [1] https://wso2.org/jira/browse/APIMANAGER-5573
> [2] https://docs.wso2.com/display/AM1100/Adding+Mediation+Extensions
>
>
> Thanks
> Hasunie
>
> --
> *Hasunie Adikari*
> Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
> blog http://hasuniea.blogspot.com
> Mobile:+94713350904 <+94%2071%20335%200904>
>



-- 

-- 
*Joseph Fonseka*
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

mobile: +94 772 512 430
skype: jpfonseka

* *
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [APIM] Content-Length of the message header is missing when it goes through the API Gateway

2017-01-10 Thread Nuwan Dias
Hi all,

This is the expected behavior of the product AFAIK. And this behavior is
related to response chunking since the Gateway by default sends data in
chunked mode. There are four possible combinations related to response
chunking.

1. Back-End sends chunked data, Gateway also sends in chunked mode.
2. Back-End sends chunked data, Gateway sends in un-chunked mode.
3. Back-End sends un-chunked data, Gateway sends in chunked mode.
4. Back-End sends un-chunked data, Gateway also sends in un-chunked mode.

The behavior you're experiencing is (3). The reason is because the Gateway
by default sends data in chunked mode and hence it drops off the
Content-Length header.

The behavior you're expecting is (4) and to do that you need to set the
FORCE_HTTP_CONTENT_LENGTH and COPY_CONTENT_LENGTH_FROM_INCOMING properties.
Hence the JiRA actually cannot be considered a bug :).

If this particular back-end is in our (wso2) control, I would suggest that
we fix it to support chunking since most modern services support it. And
then disable chunking on the Gateway if the clients of the API cannot work
on chunked data. Switch to option (2) basically.

Thanks,
NuwanD.

On Wed, Jan 11, 2017 at 8:42 AM, Joseph Fonseka  wrote:

> Hi Hasunie
>
> It would be ideal if we can enable this only for the specific APIs but the
> way IoT publisher's the APIs it will be hard to achieve.
>
> Thanks
> Jo
>
> On Wed, Jan 11, 2017 at 4:18 AM, Hasunie Adikari  wrote:
>
>> Hi all,
>>
>> IOT backend server gives Content-length header of the response as
>> expected, But Issue is arisen while passing it through the API Gateway,
>> Content-Length of the response header is missing. We have already created
>>  a public JIRA [1]
>> for the issue in APIM 2.1.0 RC1.
>> Since the issue is affected only for few of APIS, We are trying to add
>> some custom sequence (outSequence) by creating per API Extensions [2].
>>
>> 
>> > value="true"/>
>> > value="true" scope="axis2"/>
>> 
>>  
>>
>> [1] https://wso2.org/jira/browse/APIMANAGER-5573
>> [2] https://docs.wso2.com/display/AM1100/Adding+Mediation+Extensions
>>
>>
>> Thanks
>> Hasunie
>>
>> --
>> *Hasunie Adikari*
>> Software Engineer
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>> blog http://hasuniea.blogspot.com
>> Mobile:+94713350904 <+94%2071%20335%200904>
>>
>
>
>
> --
>
> --
> *Joseph Fonseka*
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
> mobile: +94 772 512 430
> skype: jpfonseka
>
> * *
>
>


-- 
Nuwan Dias

Software Architect - WSO2, Inc. http://wso2.com
email : nuw...@wso2.com
Phone : +94 777 775 729
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev