Wednesday, January 28, 2015

LDAP support in Apache Camel

Apache Camel allows you to add LDAP queries to your Camel routes via the camel-ldap and camel-spring-ldap components. The camel-ldap component allows you to perform an LDAP query using a filter as the message payload. The spring-ldap component is a wrapper for Spring LDAP, and is a bit more advanced than the camel-ldap component, in that it also supports the "bind" and "unbind" operations, in addition to "search".

I've created two test-cases that show how to use each of these components. Both test-cases use the Camel file component to read in files that contain LDAP queries. These queries are then dispatched to an Apache DS server that is configured via annotations in the test code, using an LDIF file containing some test data. The results are then processed and written out in the target directory. The test-cases are available here

6 comments:

  1. This has been so useful. Thanks! I am having some trouble with the camel-ldap component. The LdapProducer is getting a NPE (line 82) in the finally clause of the process method. Do you have any tips in solving this?

    ReplyDelete
  2. Camel ver is 2.15.1
    If the source I am looking at is right, it is dying on dirContext.close(); (NPE).

    ReplyDelete
  3. I'll fix the NPE. How are you configuring the LDAPContext? If in Spring are you adding a scope of "prototype"?

    ReplyDelete
  4. That means Apache camel doesn't supports any of the following operation. Right?
    Abandon, Add, Compare, Delete, Extended, Modify, Modify DN.

    ReplyDelete