[Java] Create custom logging aspect with Springboot AOP
Aspect-oriented Programming (AOP) enable developer design application with more “module-ize”. This example will show how to use AOP to log method execution in SpringBoot AOP.
Aspect-oriented Programming (AOP) enable developer design application with more “module-ize”. This example will show how to use AOP to log method execution in SpringBoot AOP.
To ensure service availability, Most application nee to restart service to resume. However, auto reconnect is a must requirement to ensure it can self-heal. For Spring data JPA, it can be done without alter code.
Application Performance Monitoring is one of the method to ensure application’s availability and status. However, most of them only can check the platform status (e.g. CPU usage / Thread / Memory / etc), some organization […]
It caused by Eclipse default server setting on JMX.
發生這個問題時, 主要是因為object 中有多個@JsonManagedReference 找到, 因此會令serialize 時不能正常找到相對應的class resolve.
以前在hash 物件時, 通常會用到MD5 256 / 512 之類的機制進行. 而在新系統中, 則建議利用Argon2 進行hashing. 示範中會利用Password wrapper 做adapter 去將字串作hashing 又檢驗.
之前都有寫過利用C# , PowerShell 及Java 的 MimeMessage 去傳送電郵. 在此利用Sprint 去發出電郵. 方法如下.
除了Tomcat 外, JBoss / Wildfly 都是熱門的Java Application Server. 與前者比較, JBoss / Wildfly 對整合 Java Enterprise Edition (JEE) 較佳. 而將spring 部署到 JBoss 中雖然較少, 但其穩定性則相對較佳. 示範中會利用Gradle spring application project 進行部署.
Java Persistence API (JPA) 是 Java 內建的library 用作ORM 互動. 著名的衍生品之一就是Hibernate, 而Spring 亦基於Hibernate, 在Spring Boot 中建立了Spring Data JPA. 在示範中, 會以Gradle project 接駁SQL server 及存取資料.
上文講到如何利用Java 去接駁LDAP, 今次則利用Spring security 作示範. 比較之下Spring 簡化了連接過程.
Copyright © 2024 | MH Magazine WordPress Theme by MH Themes