我对骡子有一些疑问。
我在流程中有三个组件,一个HTTP连接器,一个ObjectToJMS转换器和一个JMS连接器。 如果ObjectToJMS变换器在处理数据时抛出异常,我该如何将http状态代码415返回给用户? 我可以添加一个Catch Exception Strategy并配置一个有效负载变换器吗?
如何指定发送到REST Web服务的数据的MIME类型?
I have some questions on Mule.
I have three components in a flow, a HTTP connector, an ObjectToJMS transformer and a JMS connector. If the ObjectToJMS transformer throws an exception when processing the data, how can I retrun a http status code of 415 to the user? Can I just add a Catch Exception Strategy and configure a set payload transformer?
How can I specify the MIME type of the data that are sending to a REST web service?
最满意答案
您可以使用Catch Exception Strategy和set-payload来设置响应消息,使用http:response-builder ( http://www.mulesoft.org/documentation/display/current/HTTP+Response+Builder )来设置HTTP状态和内容类型。
对于请求,您可以在出站端点上设置contentType。
You can use Catch Exception Strategy with set-payload to set response message and http:response-builder (http://www.mulesoft.org/documentation/display/current/HTTP+Response+Builder) to set HTTP status and content type.
For requests, you can set contentType on your outbound endpoint.
更多推荐
发布评论