Reputation: 23
I want to run Performance & Load Test for a Spring @Scheduled task using Apache JMeter if possible.
I'm using Spring 5 (non boot) and JMeter 5.4.1
Thank you
Edit 1: My scheduled task is configured as below
package com.mypackage.impl;
import com.mypackage.service.NotificationBatchService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional
public class NotificationBatchServiceImpl implements NotificationBatchService {
@Override
@Scheduled(cron = "0 0 */2 * * *")
public void synchronizeNotificationUploadDocument() {
// database transactions
// HTTP requests
}
}
Upvotes: 1
Views: 902
Reputation: 36223
You should extract the code inside of the method synchronizeNotificationUploadDocument
to a service and then load test this service.
Upvotes: 0