Spring cloud config server and SSH git repository


Create a spring cloud config server application Create a maven project with following POM file Create main java class with required configuration as following: Generate a key pair Then export the private key under OpenSSH format by Conversions -> Export OpenSSH key Now you have two private keys and one public key: id_rsa id_rsa_openssh id_rsa.pub … Continue reading Spring cloud config server and SSH git repository

SockJS and WebSocket


WebSocket Create a simple Spring WebSocket application Add POM dependencies Add WebSocket handler In the above configuration, there is important line that is setAllowedOrigins(“*”), if we don’t have this, the WebSocket handshake request could respond with 403 request forbidden. Now I have just set up the WebSocket server. Continue, I will test it Send message … Continue reading SockJS and WebSocket

Spring Data JPA with multiple datasource


Requisition Spring Boot 1.5.11.RELEASE Spring Data JPA 1.11.11.RELEASE Hibernate 5.3.5.Final Postgres 9.4 When using Spring Data JPA together with Spring Boot. It's easily to realize that Spring Boot JDBC help to initialize one primary data source. But in reality, one application usually need more than one data source. Especially with legacy systems, this kind of … Continue reading Spring Data JPA with multiple datasource

Configuration ngoài cho ứng dụng với Spring Boot


1. Sử dụng properties file SpringApplication sẽ load các property từ tất cả các file application.properties trong các vị trí sau, và thêm chúng vào application environment: + Folder /config bên trong folder hiện tại. + Folder hiện tại. + Class path /config + Root class path Mặc định, SpringApplication sẽ load theo thứ tự … Continue reading Configuration ngoài cho ứng dụng với Spring Boot

Sử dụng configuration class trong Spring Boot


1. Sử dụng class Configuration Spring Boot ưu ái việc sử dụng các class Configuration. Mặc dù bạn có thể hoàn toàn sử dụng việc gọi hàm SpringApplication.run() ngay bên trong file XML, nhưng nhìn chung Spring khuyên điểm xuất phát của ứng dụng là một class với annotation @Configuration. Thông thường thì class với … Continue reading Sử dụng configuration class trong Spring Boot

Configure spring security with ldap authentication and local system roles in grails


Add plugins Add plugins of Spring security and ldap in BuildConfig Configure spring security Configure spring security and LDAP authentication in Config Implement authorities Implement the authority for user Add your first user When start up your web application you also need to create the first user to verify your spring security configuration and create … Continue reading Configure spring security with ldap authentication and local system roles in grails