talend tRESTClient 怀疑问题 204 No Content response without "content-length: 0" header
talend tRESTClient suspected issues with 204 No Content response without "content-length: 0" header
我们使用 talend 来构建 ETL。我们使用的组件之一是 tRESTClient,用于与我们平台中的 REST 服务进行交互。我们使用 talend 版本 7.1.
最近此 REST 服务更改了其 HTTP 服务器库的版本(libmicrohttpd,REST 服务基于 C/C++)。特别是,已从 limicrohttpd 0.9.48 移动到 0.9.70。自从我们进行更改后,ETL 中的集成就开始失败了。我们在 talend 跟踪中看到这样的消息:
--------------------------------------
time=2020-08-05 08:26:01| lvl=INFO | ver=1.0| Inbound Message
----------------------------
ID: 1
Response-Code: 204
Encoding: ISO-8859-1
Content-Type:
Headers: {Cache-Control=[no-cache, no-store, max-age=0, must-revalidate], connection=[keep-alive], Date=[Wed, 05 Aug 2020 06:26:03 GMT], Expires=[0], fiware-correlator=[894f7ff0-d6e4-11ea-b1bd-fa163ec74401], Pragma=[no-cache], Referrer-Policy=[same-origin], Server=[nginx], Strict-Transport-Security=[max-age=31536000; includeSubdomains;], X-Content-Type-Options=[nosniff], X-Frame-Options=[SAMEORIGIN], X-XSS-Protection=[1; mode=block]}
--------------------------------------
Exception in component tRESTClient_1 (VLCI_ETL_MEDIOAMBIENTE_INSERT_CB)
javax.ws.rs.client.ResponseProcessingException: Problem with reading the data, class org.dom4j.Document, ContentType: */*.
at org.apache.cxf.jaxrs.impl.ResponseImpl.reportMessageHandlerProblem(ResponseImpl.java:437)
at org.apache.cxf.jaxrs.impl.ResponseImpl.doReadEntity(ResponseImpl.java:379)
at org.apache.cxf.jaxrs.impl.ResponseImpl.readEntity(ResponseImpl.java:314)
at org.apache.cxf.jaxrs.impl.ResponseImpl.readEntity(ResponseImpl.java:304)
…
我们仍在调查该问题,但我们怀疑 libmicrohttpd 中引入的其中一项更改可能与之相关。特别是,对于 libmicrohttd 0.9.48(当 ETL 工作时)“Content-Length: 0”header 包含在 204 个响应中。对于 libmicrohttpd 0.9.70(当 ETL 不工作时)这样的“Content-Length: 0” header 不包括在内。
这是一个已知问题吗?我的意思是,如果“Content-Lengh: 0”不包含在 204 响应中,tRESTClient(7.1 版)是否会失败?
请注意,关于 204 响应中 Content-Length 的使用,HTTP 规范非常明确。来自 RFC 7321(据我所知这是 HTTP 的规范标准)section 6.1:
A server MUST NOT send a Content-Length header field in any response with a status code of 1xx (Informational) or 204 (No Content)”
所以如果 tRESTClient 不支持它,那么我理解是 talend 中的一个错误(也许在 post-7.1 版本中解决了?)
非常欢迎对此提出任何反馈!感谢您的关注。
我们使用 talend 来构建 ETL。我们使用的组件之一是 tRESTClient,用于与我们平台中的 REST 服务进行交互。我们使用 talend 版本 7.1.
最近此 REST 服务更改了其 HTTP 服务器库的版本(libmicrohttpd,REST 服务基于 C/C++)。特别是,已从 limicrohttpd 0.9.48 移动到 0.9.70。自从我们进行更改后,ETL 中的集成就开始失败了。我们在 talend 跟踪中看到这样的消息:
--------------------------------------
time=2020-08-05 08:26:01| lvl=INFO | ver=1.0| Inbound Message
----------------------------
ID: 1
Response-Code: 204
Encoding: ISO-8859-1
Content-Type:
Headers: {Cache-Control=[no-cache, no-store, max-age=0, must-revalidate], connection=[keep-alive], Date=[Wed, 05 Aug 2020 06:26:03 GMT], Expires=[0], fiware-correlator=[894f7ff0-d6e4-11ea-b1bd-fa163ec74401], Pragma=[no-cache], Referrer-Policy=[same-origin], Server=[nginx], Strict-Transport-Security=[max-age=31536000; includeSubdomains;], X-Content-Type-Options=[nosniff], X-Frame-Options=[SAMEORIGIN], X-XSS-Protection=[1; mode=block]}
--------------------------------------
Exception in component tRESTClient_1 (VLCI_ETL_MEDIOAMBIENTE_INSERT_CB)
javax.ws.rs.client.ResponseProcessingException: Problem with reading the data, class org.dom4j.Document, ContentType: */*.
at org.apache.cxf.jaxrs.impl.ResponseImpl.reportMessageHandlerProblem(ResponseImpl.java:437)
at org.apache.cxf.jaxrs.impl.ResponseImpl.doReadEntity(ResponseImpl.java:379)
at org.apache.cxf.jaxrs.impl.ResponseImpl.readEntity(ResponseImpl.java:314)
at org.apache.cxf.jaxrs.impl.ResponseImpl.readEntity(ResponseImpl.java:304)
…
我们仍在调查该问题,但我们怀疑 libmicrohttpd 中引入的其中一项更改可能与之相关。特别是,对于 libmicrohttd 0.9.48(当 ETL 工作时)“Content-Length: 0”header 包含在 204 个响应中。对于 libmicrohttpd 0.9.70(当 ETL 不工作时)这样的“Content-Length: 0” header 不包括在内。
这是一个已知问题吗?我的意思是,如果“Content-Lengh: 0”不包含在 204 响应中,tRESTClient(7.1 版)是否会失败?
请注意,关于 204 响应中 Content-Length 的使用,HTTP 规范非常明确。来自 RFC 7321(据我所知这是 HTTP 的规范标准)section 6.1:
A server MUST NOT send a Content-Length header field in any response with a status code of 1xx (Informational) or 204 (No Content)”
所以如果 tRESTClient 不支持它,那么我理解是 talend 中的一个错误(也许在 post-7.1 版本中解决了?)
非常欢迎对此提出任何反馈!感谢您的关注。