Spring integration 我的服务激活器是否可以将重载函数设置为SPEL表达式中的方法

Spring integration 我的服务激活器是否可以将重载函数设置为SPEL表达式中的方法,spring-integration,Spring Integration,我有一个像这样的门 public interface MetadataIngestNotificationGateway { public boolean sendMetadataNotification(MetadataNotification notification); public boolean sendMetadataAssociationNotification(MetadataAssociationNotification notification); }

我有一个像这样的门

public interface MetadataIngestNotificationGateway {

     public boolean sendMetadataNotification(MetadataNotification notification);
     public boolean sendMetadataAssociationNotification(MetadataAssociationNotification notification);

}
<int:header-enricher>
        <int:header name="routingKey" expression="@routingKeyResolver.resolveRoutingKey(payload)" />
</int:header-enricher>
我有一个标题润色器,看起来像这样

public interface MetadataIngestNotificationGateway {

     public boolean sendMetadataNotification(MetadataNotification notification);
     public boolean sendMetadataAssociationNotification(MetadataAssociationNotification notification);

}
<int:header-enricher>
        <int:header name="routingKey" expression="@routingKeyResolver.resolveRoutingKey(payload)" />
</int:header-enricher>
这一切看起来都应该工作,但我最终得到了这个错误。
方法调用:在RoutingKeyResolver类型上找不到方法resolveRoutingKey(MetadataAssociationNotification)

我声称它可以找到(我可以看到),但框架认为它无法找到。有人能帮我找出我的错误吗。我不确定这是否真的能起作用,尽管它看起来应该起作用


我假设我不能有一个指向重载函数的表达式

我假设这是SpEL的问题,SpEL会为第一次调用动态生成该表达式的类

同时,我尝试复制它,针对您的特定情况尝试此解决方案:

<int:header-enricher>
        <int:header name="routingKey" ref="routingKeyResolver" method="resolveReoutingKey"/>
</int:header-enricher>

我假设这是SpEL的问题,SpEL会为第一次调用动态生成该表达式的类

同时,我尝试复制它,针对您的特定情况尝试此解决方案:

<int:header-enricher>
        <int:header name="routingKey" ref="routingKeyResolver" method="resolveReoutingKey"/>
</int:header-enricher>