HTTP 入站端点 Mule 的动态地址

Dynamic address for HTTP inbound endpoint Mule

我正在尝试获取 SOAP 服务的 http 入站端点的动态地址。

<http:inbound-endpoint exchange-pattern="request-response" address="#[app.registry.appversion.getNewAddress()]" doc:name="HTTP"/>

Spring 上下文有 bean 定义:

<bean id="appversion" class="com.visit.util.Application">

应用程序中的 getNewAddress() class returns 一个字符串。

但是,它抛出异常为:

Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'protocol' threw exception; nested exception is java.lang.IllegalArgumentException: Address '#[app.registry.appversion.getNewAddress()]' for protocol 'http' should start with http://
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:102)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1393)
... 38 more

看起来 MEL 未被评估,而是被视为文字字符串。我错过了什么吗?任何帮助表示赞赏。提前致谢。

改为使用 Spring 表达式 (SPeL):

<http:inbound-endpoint exchange-pattern="request-response"
      address="#{appversion.getNewAddress()}" doc:name="HTTP"/>