You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Kostov, Andreya" <an...@sap.com> on 2016/03/15 13:55:08 UTC

Use LDAP component to connect to different backend systems

Hello,

We are using Spring Web 4.2.4 and Apache Camel 2.16.2.
We want to create a route which reads data from an Active Directory service. We want to use the Camel LDAP component. Our requirement is that we are able to read from different backend systems, which are configured by the user.
The LdapContext which is used should be registered as a bean and it is looked up by the component from the Spring WebApplicationContext. However, this does not work for us, as we do not have the bean at deploy-time.
Is there a way we can do this? From what I saw there is no easy way to register a bean at runtime.

Best regards,
Andreya

Re: Use LDAP component to connect to different backend systems

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Maybe you can contribute this to Apache Camel. We could maybe allow to
configure the endpoint or exchange header to which ldap context to
use.
http://camel.apache.org/contributing

On Thu, Mar 17, 2016 at 9:31 AM, Kostov, Andreya <an...@sap.com> wrote:
> Hello Thomas,
>
> Thank you for the suggestion. However I'm not sure this would help as the issue that the LdapProducer reads the beans from Spring context still remains - we still cannot do anything with the beans by adding/removing routes at runtime.
>
> Anyway, for future reference - we have managed to work around this altogether by extending the LdapProducer and overriding the method which reads the LdapContext to use an exchange property, rather than Spring WebApplicationContext. This means that the LdapEndpoint and LdapComponent classes have to be extended too and the component manually registered with a different scheme. But in the end, it works as expected. :)
>
> Best regards,
> Andreya
>
> -----Original Message-----
> From: Walzer, Thomas [mailto:thomas.walzer@integratix.net]
> Sent: Wednesday, March 16, 2016 11:05 AM
> To: users@camel.apache.org
> Subject: Re: Use LDAP component to connect to different backend systems
>
> Hi,
>
> I would remove/add the routes via the context API
> This was already discussed here: http://stackoverflow.com/questions/15248776/dynamic-change-endpoint-camel#15254698
>
> Cheers, Thomas.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

RE: Use LDAP component to connect to different backend systems

Posted by "Kostov, Andreya" <an...@sap.com>.
Hello Thomas,

Thank you for the suggestion. However I'm not sure this would help as the issue that the LdapProducer reads the beans from Spring context still remains - we still cannot do anything with the beans by adding/removing routes at runtime.

Anyway, for future reference - we have managed to work around this altogether by extending the LdapProducer and overriding the method which reads the LdapContext to use an exchange property, rather than Spring WebApplicationContext. This means that the LdapEndpoint and LdapComponent classes have to be extended too and the component manually registered with a different scheme. But in the end, it works as expected. :)

Best regards,
Andreya

-----Original Message-----
From: Walzer, Thomas [mailto:thomas.walzer@integratix.net] 
Sent: Wednesday, March 16, 2016 11:05 AM
To: users@camel.apache.org
Subject: Re: Use LDAP component to connect to different backend systems

Hi,

I would remove/add the routes via the context API
This was already discussed here: http://stackoverflow.com/questions/15248776/dynamic-change-endpoint-camel#15254698

Cheers, Thomas.

Re: Use LDAP component to connect to different backend systems

Posted by "Walzer, Thomas" <th...@integratix.net>.
Hi,

I would remove/add the routes via the context API
This was already discussed here: http://stackoverflow.com/questions/15248776/dynamic-change-endpoint-camel#15254698

Cheers, Thomas.


> Am 15.03.2016 um 13:55 schrieb Kostov, Andreya <an...@sap.com>:
> 
> Hello,
> 
> We are using Spring Web 4.2.4 and Apache Camel 2.16.2.
> We want to create a route which reads data from an Active Directory service. We want to use the Camel LDAP component. Our requirement is that we are able to read from different backend systems, which are configured by the user.
> The LdapContext which is used should be registered as a bean and it is looked up by the component from the Spring WebApplicationContext. However, this does not work for us, as we do not have the bean at deploy-time.
> Is there a way we can do this? From what I saw there is no easy way to register a bean at runtime.
> 
> Best regards,
> Andreya