Questions tagged [spring-async]

Asynchronous execution in spring for Java. Annotating a method of a bean with @Async will make it execute in a separate thread i.e. the caller will not wait for the completion of the called method.

Asynchronous execution in spring for Java. Annotating a method of a bean with @Async will make it execute in a separate thread i.e. the caller will not wait for the completion of the called method.

150 questions
0
votes
1 answer

Spring @Async is not working

I am using Spring 3.2.2.RELEASE version . The @Async anotation is not working as expected . applicationContext.xml
Pratik Jaiswal
  • 390
  • 1
  • 5
  • 21
0
votes
1 answer

Spring AsyncResttemplate HTTPs (SSL) service call

I am using Spring asyncresttempate to call multiple services simultaneously. Those services are exposed via SSL. could you please let me know how to use the SSL certificate and AsyncResttemplate to call the services asynchronously? We can use…
Debopam
  • 3,198
  • 6
  • 41
  • 72
0
votes
1 answer

Spring @Async not working on an anonymous class

I am using @Async tag inside a method in Anonymous class. Does Spring AOP support this: private void scheduleProcessing(final SomePojo somepojo) { taskScheduler.schedule(new Runnable() { @Override …
David John
  • 179
  • 1
  • 11
0
votes
1 answer

How does Spring @Async choose a task executor/scheduler if multiple ones are defined?

I have the following defined in XML configuration:
Joseph Blair
  • 1,385
  • 2
  • 12
  • 25
0
votes
1 answer

Spring Boot and long running tasks

In my Spring Boot application I have to implement an import service. Users can submit a bunch of JSON files and application will try to import the data from these files. Depending on the data amount at JSON files the single import process can take…
alexanoid
  • 24,051
  • 54
  • 210
  • 410
0
votes
2 answers

Issue with Spring Boot Async method

I have a asynchronous method enabled using @Async annotation. At times i am seeing SimpleAsyncTaskExecutor thread count increases exponentially. Any idea on this behavior?
Suraj
  • 97
  • 5
0
votes
1 answer

jdbc connection pool using ThreadpoolExecutor in spring boot

I have an application that runs through multiple databases and for each database runs select query on all tables and dumps it to hadoop. My design is to create one datasource connection at a time and use the connection pool obtained to run select…
brain storm
  • 30,124
  • 69
  • 225
  • 393
0
votes
2 answers

Spring @Async with rate per second

What is the best way to implement @Async method that will be executed X number of time per Y number of milliseconds/seconds. I have requirement set by Amazon SES to send only 14 emails per second, which I'm doing asynchronously using Spring's @Async…
Maksim
  • 16,635
  • 27
  • 94
  • 135
0
votes
0 answers

Running methods from Springs Crud repository asynchronously

I'm making an asynchronous repository using spring. I'm extending JpaRepository, which in turn extends CrudRepository. On my own methods I'm using the Async annotation so that they return CompletableFuture. Can I make the save function in…
SiXoS
  • 535
  • 3
  • 14
0
votes
2 answers

entities not being persisted when saving them async

I have the following code: Controller: eventNotifier.saveMessage(buildMessage(message, room, sender)); EventNotifier: public void saveMessage(Message message){ r.notify(EventConsumer.NEW_MESSAGE, Event.wrap(message)); …
Luiz E.
  • 6,769
  • 10
  • 58
  • 98
0
votes
0 answers

@Async with JavaMelody @MonitoredWithSpring not working

I have problem with asynchronus execution of my code. Method startConversion() should be called asynchronusly. call goes trought AOP proxy. Everything separated works fine. Problem occurs when I put together @Async and @MonitoredWithSpring…
MarekM
  • 1,426
  • 17
  • 14
0
votes
1 answer

How can I have @Async work on 2 different threads for 2 different methods in Spring.?

In my application I have 2 @Async methods: one for auditing purposes and another for updation of some maps in 2 entirely different beans, called from different beans but at same time. One from Audit listener and other from a controller. My problem…
dgupta3091
  • 1,067
  • 1
  • 7
  • 18
0
votes
1 answer

How to autowire class having async methods in another class having async methods

I have one class EmailServiceImpl which implements EmailService and another class ReportServiceImpl which implements ReportService. Both the interfaces are annotated with @EnableAsync, and so there are methods with @Async annotations. I am using…
sarvagya kumar
  • 121
  • 1
  • 8
0
votes
0 answers

Async and transactional methods

I have a web application that imports from a file to the database. The method is asynchronous and transactional, reads and inserts objects. The problem is that the import method takes 5 or 6 minutes. If I throw twice the import method without the…
oscar
  • 1,636
  • 6
  • 31
  • 59
-4
votes
1 answer

Spring boot: Using Async method as sync method

I have some scenario scheduler(call repeatedly) should call for a async function say fun(). Controller should call same function fun() and return result based on successful completion(By checking exception) Please provide me some skeleton with…
1 2 3
9
10