简体   繁体   中英

Does Google App Engine support using Spring @Async?

I have an @Api annotated Endpoint class in a Google App Engine project. I am trying to call from a method inside this endpoint, a method annotated with @Async (org.springframework.scheduling.annotation.Async). When I debug in the SimpleAsyncUncaughtExceptionHandler class, handleUncaughtException method:

@Override
public void handleUncaughtException(Throwable ex, Method method, Object... params) {
    if (logger.isErrorEnabled()) {
        logger.error(String.format("Unexpected error occurred invoking async " +
                "method '%s'.", method), ex);
    }
}

The logger.isErrorEnabled() returns false and the method invoke of AsyncExecutionInterceptor returns with null. So, my question is, does GAE support using Spring's @Async functionality?

The Gooogle AppEngine (Standard) will not support the Multiple Threads, It runs on Single Thread If you use @Async Annotation usually it will create another thread and execute and in case of AppEngine it will not create the thread and it will not execute.

If you want to use the threads in Google AppEngine you still can use the Flexible version of Google AppEngine. which more like computer engine so it don't have many restrictions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM