I am using Spring-webflux to create RouterFunction and Handler. I have @Aspect for My handler functions as follow to store ServerRequest body and ServerResponse body in in database.But when try to get Object my request is getting hanged. Is there any sample code to achieve this functionality.
@Around("@annotation(Log")
public Object log(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
Object o = proceedingJoinPoint.proceed();
ServerRequest serverRequest = ServerRequest.class.cast(proceedingJoinPoint.getArgs()[0]);
Mono<Customer> customerMono = serverRequest.bodyToMono(Customer.class);
Customer customer = customerMono.block() //Request Hanged here
log.info("customer" + customer);
return o;
}