You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Spring Integration ServiceActivator方法未调用问题求助

迁移至Java 11和Spring 5后ServiceActivator方法未调用问题

将遗留应用迁移到Java 11和Spring 5后,出现ServiceActivator方法未触发的问题。@Publisher方法能正常执行并打印日志,但ServiceActivator类完全没有日志输出。

使用版本:

  • Spring 5.3.14
  • spring-integration-* 5.5.7

XML配置

<int:channel id="employeeServicesChannel">
    <int:dispatcher task-executor="employeeServicesExecutor" />
</int:channel>
<bean id="employeeServicesExecutor"
    class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
    <property name="corePoolSize" value="10" />
    <property name="maxPoolSize" value="40" />
    <property name="queueCapacity" value="10" />
    <property name="keepAliveSeconds" value="0"></property>
</bean>

Java代码

public class EmployeeServicesPublisher {

    @Publisher(channel = "employeeServicesChannel")
    public EmployeeServicesDto publishEmployeeServicesRequest(EmployeeServicesDto requestDto) {

        logger.info(" employee service request :" + requestDto);
        return requestDto;

    }
}

@MessageEndpoint
public class EmployeeServicesServerGateway {

    @ServiceActivator(inputChannel = "employeeServicesChannel", outputChannel = 
                                                          "esDynamicOutputChannel")
    public EmployeeServicesDto processRequest(EmployeeServicesDto employeeServicesDto) {

        logger.info("===================================");
        logger.info(" request Id:" + employeeServicesDto.getRequestId());
        return employeeServicesDto;
    }   
}

内容的提问来源于stack exchange,提问作者VKR

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.11 08:10:28