使用 MEL 在 HTTP OUTBOUND ENDPOINT 中获取 URL

Using MEL to fetch URL in HTTP OUTBOUND ENDPOINT

我有一个要求,我必须通过 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>

Http 组件需要静态 'HTTP://' 作为 URL 的开头,因此下面的工作

<http:outbound-endpoint exchange-pattern="request-response" method="GET" address="http://#[message.outboundProperties.'url'] " doc:name="HTTP"/>