请查看并查看您的配置是否有问题。我总是收到文件名,而不是文件内容返回给浏览器。
<flow name="pdf-testerFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/pdf" allowedMethods="GET" doc:name="HTTP"/>
<set-variable variableName="fileName" value="#[mule.home]/pdf_1548966287527.pdf" doc:name="Variable" mimeType="application/pdf"/>
<set-property propertyName="content-type" value="application/pdf" doc:name="Set Content Type"/>
<mulerequester:request resource="file://#[flowVars.fileName]?connector=file-connector-config" doc:name="Mule Requester" metadata:id="804167d5-1407-4cf6-9e08-06ffd8ffb876"/>
<logger level="INFO" doc:name="Logger"/>
</flow>
响应返回为: /Users/~~/AnypointStudio/Workspace/.mule/pdf_1548966287527.pdf。而不是内容。
<file:connector name="file-connector-config" autoDelete="false" streaming="true" validateConnections="true" doc:name="File" />