Mule 骡子基础视频不适合我
我使用Macbook Pro成功地观看了Mule基础视频。我现在有Windows 10,我也在做同样的事情,但在这种情况下,Mule 骡子基础视频不适合我,mule,windows-10,Mule,Windows 10,我使用Macbook Pro成功地观看了Mule基础视频。我现在有Windows 10,我也在做同样的事情,但在这种情况下,url/?language=French不起作用,即查询参数language=在logger中显示西班牙语,并且在每种情况下,消息流都会通过西班牙语默认值的变量组件运行 我已经检查并再次检查了每个组件,但这就像消息一样。inboundProperties无法识别变量组件#[message.inboundProperties['Language']]中设置的变量语言 在lan
url/?language=French
不起作用,即查询参数language=
在logger中显示西班牙语,并且在每种情况下,消息流都会通过西班牙语默认值的变量组件运行
我已经检查并再次检查了每个组件,但这就像消息一样。inboundProperties
无法识别变量组件#[message.inboundProperties['Language']]
中设置的变量语言
在language=anything
的每种情况下,language=Spanish
(默认值),默认负载为“Hola!Como esa”
这里是xml
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
<flow name="hellomuleFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<expression-filter expression="#[message.payload != '/favicon.ico']" doc:name="Expression" />
<set-variable variableName="Language" value="#[message.inboundProperties['language']]" doc:name="Set Language Variable"/>
<choice doc:name="Choice">
<when expression="#[flowVars['language']=='Japanese']">
<set-payload value="Konichiwa" doc:name="Respond in Japanese"/>
</when>
<when expression="#[flowVars['language']=='French']">
<set-payload value="Bonjour" doc:name="Respond in French"/>
</when>
<otherwise>
<set-variable variableName="language" value="Zulu" doc:name="Set Language"/>
<set-payload value="Hola" doc:name="Respond in Spanish"/>
</otherwise>
</choice>
<logger level="INFO" doc:name="Logger" message="The response "#[message.payload]" means Hello in #[flowVars['language']]"/>
</flow>
</mule>
在设置变量值时进行校正。您正试图从标题中读取查询参数值。在设置变量值时,按如下所示更改MEL表达式。在设置变量时,将值更改为“#[message.inboundProperties.http.query.params.language]”
希望这对你有帮助 请分享你的整个骡子,谢谢苏达。我认为视频不正确,或者内置属性对于Mac来说足够了,但对于WIndows 10来说不够。当我添加http.query.params.language时。这就解决了问题。(Windows 10不同?)