Showing posts with label connection. Show all posts
Showing posts with label connection. Show all posts

May 19, 2014

Create blocking connection with pika

Hi,

That what i did, watch that the port is not a string but integer parameter.

 pika.BlockingConnection(pika.ConnectionParameters(host='localhost',port=6672))



Dor

Nov 23, 2010

Spring LDAP dynamic connecting

Hi,
Lately i saw a question in one of spring ldap forums, were one of guys there asked this question:
How can i connect ldap without using spring xml (application context xml file).
My answer to him was that that i prefer and need in my project to use it dynamically intead of known configuration that can be configured in spring application context file (beans).
This was my solution for him:
LdapContextSource ldapContextSource = new LdapContextSource();
ldapContextSource.setUrl("ldap://localhost:portnumber");
ldapContextSource.setBase("ou=users, ou=system");//*
ldapContextSource.setUserDn("username to connect");
ldapContextSource.setPassword("password");
ldapContextSource.afterPropertiesSet();
//* the base is not necessary needed, it depends what do you need.
Bye,
Dor