I want to advice the following method
public BaseRepresentationObject createLedgerTransaction(Long fromUserId, Long toUserId, Double serviceAmount,
Double masaryCommission, Double merchantCommission, Double appliedFees, Double tax, Long ratePlanId,
Long serviceId, String pendingTrx, String globalTrxId)
and extract the two arguments : pendingTrx
, globalTrxId
to be used in the advice method.
I use the following execution expression:
@Around("execution(* com.masary.ledger.service.components.LedgerTransactionComponent.createLedgerTransaction(..)) && args(pendingTrx,globalTrxId,..)")
public Object doBasicProfilingLedgerCreate(final ProceedingJoinPoint pjp , String pendingTrx, String globalTrxId) throws Throwable
The application is built successfully, but the advice code is not executed.
I use Spring boot with @EnableAspectJAutoProxy(proxyTargetClass=true)
on my configuration class.
By the way I have @AfterThrowing
advice to run correctly. So I highly think that the problem is with my execution expression.
Update: I have very weird finding : when I use any argument of type String the advice does not work, otherwise(Long or Double) it works.
any explanation?