关于骡子的一般问题(General questions about Mule)

编程入门 行业动态 更新时间:2024-10-15 06:19:08
关于骡子的一般问题(General questions about Mule)

我对骡子有一些疑问。

我在流程中有三个组件,一个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.

更多推荐

本文发布于:2023-07-07 04:05:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1058708.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:骡子   General   Mule   questions

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!