Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mule 如何将内容编码设置为gzip,以便在http API调用中压缩有效负载_Mule_Anypoint Studio_Mule Esb - Fatal编程技术网

Mule 如何将内容编码设置为gzip,以便在http API调用中压缩有效负载

Mule 如何将内容编码设置为gzip,以便在http API调用中压缩有效负载,mule,anypoint-studio,mule-esb,Mule,Anypoint Studio,Mule Esb,我正在使用Mule 3.8。如何设置内容编码:gzip为了压缩我的有效负载,外部_API接受gzip压缩的有效负载作为输入 我正在使用直到成功,以便重试我的http API调用。我没有得到关于如何在http请求中设置gzip以便压缩有效负载的正确文档 <flow name="Ingestion_with_retries_Flow" > <until-successful objectStore-ref="objectStore" maxRetries="${ma

我正在使用Mule 3.8。如何设置内容编码:gzip为了压缩我的有效负载,外部_API接受gzip压缩的有效负载作为输入

我正在使用直到成功,以便重试我的http API调用。我没有得到关于如何在http请求中设置gzip以便压缩有效负载的正确文档

    <flow name="Ingestion_with_retries_Flow" >
    <until-successful objectStore-ref="objectStore" maxRetries="${max.retries}" deadLetterQueue-ref="Queue_Failed_Payload_To_ErrorDir_And_Notify"
                      failureExpression="#[(exception != null) and (exception.causedBy(java.net.ConnectException) || exception.causedBy(java.net.SocketTimeoutException) || exception.causedBy(java.net.SocketException) || exception.causedBy(java.io.IOException))]"
                      doc:name="Until Successful" millisBetweenRetries="${millis.between.retries}">
        <processor-chain doc:name="Processor Chain">
            <http:request config-ref="HTTPS_Ingestion_Service_External_API" path="/delivery" method="POST" doc:name="External API Data Delivery Post">
                <http:request-builder>
                    <http:header headerName="Accept" value="${http.by.interface.version}"/>

                </http:request-builder>
                <http:success-status-code-validator values="200"/>
            </http:request>

            <json:xml-to-json-transformer doc:name="XML to JSON"/>
            <flow-ref name="Subflow_Extract_Ingestion_Response" doc:name="Extract Ingestion Response"/>
        </processor-chain>
    </until-successful>
</flow>

只需使用压缩模块的Compress元素压缩输入有效负载即可

然后可以将输入侦听器的响应头设置为Content Encoding=gzip。这让调用方/浏览器知道响应负载是gzip编码的