- Define following profiles in pom.xml
<profiles>
<profile>
<id>dev</id>
<properties>
<activatedProperties>dev</activatedProperties>
</properties>
<activation>
{ | |
"basics": { | |
"name": "Stephen Traiforos", | |
"image": "https://www.gravatar.com/avatar/2802aa3aba37aee55d3baf94b42e90bf", | |
"label": "Fullstack Software Engineer", | |
"email": "stephen@traiforos.com", | |
"phone": "(508) 494-5048", | |
"summary": "Passionate full stack engineer seeking a highly collaborative team environment with a variety of architectures and technical challenges. Self driven developer with a proven track record of providing innovative solutions while leading by example through a thoughtful understanding of the customer experience, business priorities, and market opportunity.", | |
"location": { | |
"postalCode": "MA 02119", |
import javax.validation.ConstraintValidator; | |
import javax.validation.ConstraintValidatorContext; | |
/** | |
* Created by: Fuxing | |
*/ | |
public class EnumValidator implements ConstraintValidator<ValidEnum, Enum> { | |
@Override | |
public boolean isValid(Enum value, ConstraintValidatorContext context) { | |
if (value == null) return false; |
https://stackoverflow.com/questions/33744875/spring-boot-how-to-log-all-requests-and-responses-with-exceptions-in-single-pl | |
Currently Spring Boot has the Actuator feature to get the logs of requests and responses. | |
But you can also get the logs using Aspect(AOP). | |
Aspect provides you with annotations like: @Before, @AfterReturning, @AfterThrowing etc. | |
@Before logs the request, @AfterReturning logs the response and @AfterThrowing logs the error message, You may not need all endpoints' log, so you can apply some filters on the packages. |
import javax.validation.ConstraintValidator; | |
import javax.validation.ConstraintValidatorContext; | |
/** | |
* Created by: Fuxing | |
*/ | |
public class EnumValidator implements ConstraintValidator<ValidEnum, Enum> { | |
@Override | |
public boolean isValid(Enum value, ConstraintValidatorContext context) { | |
if (value == null) return false; |
This code makes use of two classes: TsWorker and TsWorkerJob. TsWorker initializes an inline worker and runs one job. The TsWorker class needs to be initialized with a function and the function's arguments as an array.
const tsWorker = new TsWorker();
// create a new job. You can create a sub class of TsWorker so that you don't have to add the function any time.
--- | |
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
creationTimestamp: null | |
name: httpbin-proxy | |
data: | |
proxy.json: |- | |
{ | |
"target-url": "http://localhost:8000", |
validate: validate the schema, makes no changes to the database. | |
update: update the schema. | |
create: creates the schema, destroying previous data. | |
create-drop: drop the schema at the end of the session. |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.