我有一个要求,我必须通过HTTPS使用休息服务,我必须在运行时获取URL。 为了实现这一目标,我正在设置REST' url'作为出境物业,我试图使用MEL
获取#[message.outboundProperties.'url'
当我按照上面说的那样尝试时,我收到编译时错误,如下所述
org.springframework.beans.MethodInvocationException: Property 'protocol' threw exception; nested exception is java.lang.IllegalArgumentException: Address '#[message.outboundProperties.'url']' for protocol 'http' should start with http://
我做错了吗?或者有除此之外达到此要求的最佳方法吗?
<https:outbound-endpoint exchange-pattern="request-response"
method="GET" doc:name="HTTPs with Auth header" address="#[message.outboundProperties.'url']" connector-ref="HTTP_HTTPS"/>
<https:connector name="HTTP_HTTPS" cookieSpec="netscape" validateConnections="true" sendBufferSize="0" receiveBufferSize="0" receiveBacklog="0" clientSoTimeout="10000" serverSoTimeout="10000" socketSoLinger="0" doc:name="HTTP-HTTPS">
<https:tls-key-store path="#[message.outboundProperties.'Storepath']" keyPassword="#[message.outboundProperties.'storepassword']" storePassword="#[message.outboundProperties.'storepassword']"/>
<https:tls-server path="#[message.outboundProperties.'Storepath']" storePassword="#[message.outboundProperties.'storepassword']"/>
</https:connector>
&#13;
答案 0 :(得分:1)
Http组件需要静态的HTTP://&#39;作为URL的开头,因此以下工作
<http:outbound-endpoint exchange-pattern="request-response" method="GET" address="http://#[message.outboundProperties.'url'] " doc:name="HTTP"/>