Spring has the ability to provide for Asynchronous processes to run. This would typically be used for some kind of status updater that has to circulate your database to determine if the change a user just made has had any effect on the rest of the system. This is normally not a very quick process, so you would naturally want to throw it over the wall to some asynchronous process that may tell you when it’s done.

This all works pretty well. You just have to tag the method in question with the @Asynch tag. You can still do things like synchronize the method call so that only one of them is running.

The tricky part is how to pass over the credentials of the user that started this all occurring?

If you have a typical MVC implementation for your app, you have gone through some pain to determine that the current user has the rights to exercise some feature that results in an asynchronous process kickoff. But there is no apparent mechanism for passing over the user ‘session’ information over to that asynchronous process. This means your asynchronous process has to run in its own vertical stack, not sharing results with anyone, including the user who kicked the whole thing off in the first place.

This appears to be a flaw in the design: While it is extremely useful to kick stuff off that runs elsewhere and does not tie up the user, there needs to be a connection maintained back to the user thread.

Any useful suggestions here?