user3140656
user3140656

Reputation: 55

spring app with queues communication only and performance test

I have a spring application that retrieves messages from one queue (aws sqs) renders and sends request to the outside vendor, gets response process it again and puts it back into another processed queue. Spring application has no API, communicating through queues only. I need to determine throughput (# of msg/s) of my application. What's the best way to do it? Any existent tools for my use case?

Upvotes: 1

Views: 425

Answers (1)

David
David

Reputation: 8206

You can benchmark the "service" code "in isolation" from SQS using various techniques. As mentioned in the comment on your question a popular tool is jmeter. You could expose a http endpoint just for exercising the service code (the same code that will run when an SQS message is received)

You could also consider running locally a localstack docker image which will allow you to mock SQS (you can use a test harness to put messages into the localstack sqs queue and then, assuming that you have a way to correlate the message produced by the service measure the time between the message being sent to the queue and the time at which it appears on the queue that the app write to.

This of course is potentially misleading as using the "real" SQS will likely have some overhead of its own (e.g. locally running docker won't involve remote network calls which will hide some amount of network latency and perhaps the real SQS processing time has different characteristics to the localstack one). Of course, you could actually just use real SQS queues if the cost of those messages doesn't bother you too much and this will be more accurate.

Another key thing to consider is, given that your service sends a request to an outside vendor your performance characteristics will be linked to that of the downstream service that you depend upon - if that service has latency that varies between 100ms to 2000 ms for example it'll impact yours so when deciding whether to benchmark your code in isolation (for example by using a mock of that service) you would need to consider that.

Upvotes: 1

Related Questions