edcincy
edcincy

Reputation: 341

Spring @Async with App Engine?

I am attempting to asynchronously call two separate servlets on App Engine using two @Async annotated methods. The code running on App Enging IS NOT using Spring. It's just using the normal Java Servlet API. The code calling the servlets is using Spring.

The @Async on the calling methods does not seem to be working. The methods are each called, and return in the normal order. (method->return, method->return)

I have @Async annotations on each public method.
I have the @EnableAsync annotation on the class calling the methods. These are two separate classes. No static classes involved.

I'm unsure if this is due to App Engine not supporting Servlet 3.0, or that I have not properly configured @Async propertly.

Thanks in advance!

Upvotes: 0

Views: 207

Answers (2)

edcincy
edcincy

Reputation: 341

Problem solved!

The issue was WHERE I was putting the xmlns:task="http://www.springframework.org/schema/task" and task:annotation-driven entries.

We have several XML files (that import other XML files) in our application. Initially, I was putting these entries in the XML that contained the config for the bean containing the @Async annotation. In order to get it to work, I had to put it in the applicationContext.xml

The calls are being made asynchronously on different threads and App Engine is handling them as such.

Upvotes: 0

jirungaray
jirungaray

Reputation: 1674

Unfortunately GAE does not support Serlvet 3.0 spec as shown on this issue.You can apparently move to managed VMs and use it but sandbox GAE wont be using 3.0 for a while.

Upvotes: 0

Related Questions