Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在类级别使用@EnableScheduling进行Spring注释_Java_Spring_Spring Scheduled - Fatal编程技术网

Java 在类级别使用@EnableScheduling进行Spring注释

Java 在类级别使用@EnableScheduling进行Spring注释,java,spring,spring-scheduled,Java,Spring,Spring Scheduled,我有一个具有异步调用功能的服务类。代码如下所示: @Service public class EllaService { @Async public void invokeEllaAsync( final IrisBo irisBo ) throws EllaGatewayUnsuccessfulResponseException { if( !isTrafficIgnored( irisBo ) ) { try {

我有一个具有异步调用功能的服务类。代码如下所示:

@Service
public class EllaService {

    @Async
    public void invokeEllaAsync( final IrisBo irisBo ) throws EllaGatewayUnsuccessfulResponseException {

        if( !isTrafficIgnored( irisBo ) ) {
            try {
                callEllaService( irisBo );
            }
            catch( EllaGatewayUnsuccessfulResponseException ex ) {
                throw new EllaGatewayUnsuccessfulResponseException( ex.getMessage(), ex.getCause() );
            }

        }
    }
}

我是否需要在类级别使用
@EnableScheduling
进行注释才能正常工作?

您应该使用
@enablesync
注释main


@EnableScheduling
已连接到
@Scheduled