users@jersey.java.net

[Jersey] Batch requests

From: Jason Erickson <jason_at_jasonerickson.com>
Date: Wed, 26 Oct 2011 11:07:20 -0700

I know this isn't really a REST problem per se, but I'm using Jersey for all of my AJAX calls and thought I would ask if anyone is also solving this problem.

The problem is that I will soon have to support a page that has lots of small (or some not so small) requests. It's not really acceptable to let the browser make all of these requests individually because most browsers will only make two requests in parallel and it can really slow down the user's experience. So what I want to do is send several "queries" in a single request that responds with all of the results.

I can roll my own 'batch' request, but I wanted to see if there were any facilities in Jersey already. Also, whether Jersey or not, is this something people have tackled before and what are some good approaches/traps to look out for.

(Also, let people tell me that what I'm doing is a good approach or a bad idea.)