spring-projects / spring-ldap

Spring LDAP
https://spring.io/spring-ldap
Apache License 2.0
342 stars 481 forks source link

LDAP-286: Documentation: @Async and Spring-LDAP #249

Open spring-projects-issues opened 10 years ago

spring-projects-issues commented 10 years ago

Matthew Copeland (Migrated from LDAP-286) said:

UnboundId LDAP supports async searches against the directory. When looking in the spring-ldap documentation, I didn't see anything talking about performing async searches. (Did I miss it?) In doing google searches, I've seen some things about using @Async with newer versions of spring to do async operations. The use case I'm looking at is for running possibly hundreds of ldap queries at a time. If spring-ldap can work with the @Async annotation, a quick note about it, any issues to be aware of, and a link over to the appropriate documentation would be very useful. If it can't, then please let me know, and I'll fill out a feature request for async operations in spring-ldap.

spring-projects-issues commented 10 years ago

Mattias Hellborg Arthursson said:

I'm not familiar with UnboundId, but from the documentation it appears to support asynchronous LDAP searches re-using the same LDAP connection. Spring LDAP is based on standard Java LDAP/JNDI; and when it comes to protocol features only stuff that's in there is supported by Spring LDAP. This means that async queries as UnboundId describe them are not (and very likely will not be) supported by Spring LDAP.

There is nothing to stop you from executing your queries in parallel, possibly using @Async - that's a Spring feature completely unrelated to Spring LDAP. Spring LDAP will still continue working the same way however: each Spring LDAP operation will open its own connection to the server and wait synchronously for its response. This means that if you try to execute hundreds of parallel operations, you will require hundreds of LDAP connections to the server, which is not likely to be appreciated by the server administrators.

spring-projects-issues commented 10 years ago

Matthew Copeland said:

That information is useful to know. Thanks.

As for the server admins, I'm one of the server admins, so that part isn't a problem. I was more concerned with having to figure out exactly how large of a connection pool would be needed with a corresponding thread pool for the async calls. It sounds like I'd need them both in the hundreds, if I want to be able to do this.

Thanks.