We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I try to add listeners for redisson lock: (in a spring-boot project)
//@Autowired //private RedissonClient redissonClient; RLock lock = redissonClient.getLock(PaymentLockConstants.RECHARGE_CODE_LOCK_PREFIX + tenantId); RedissonLock redissonLock = (RedissonLock) lock; redissonLock.addListener(redissonLockExpiredListener); redissonLock.addListener(redissonLockDeletedListener);
there is the listeners:
import lombok.extern.slf4j.Slf4j; import org.redisson.api.DeletedObjectListener; import org.redisson.api.ExpiredObjectListener; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Slf4j @Configuration public class RedissonConfiguration { @Bean("redissonLockExpiredListener") public ExpiredObjectListener redissonLockExpiredListener() { return name -> { log.info("[redisson][expire]Lock named {} expired", name); }; } @Bean("redissonLockDeletedListener") public DeletedObjectListener redissonLockDeletedListener() { return name -> { log.info("[redisson][release]Lock named {} release", name); }; } }
and get instances in the top class:
@Autowired @Qualifier("redissonLockExpiredListener") ExpiredObjectListener redissonLockExpiredListener; @Autowired @Qualifier("redissonLockDeletedListener") DeletedObjectListener redissonLockDeletedListener;
But there is no logs when i run the locking code. 😢 I want catch the lock events, such as locked、unlocked、expired ...
The text was updated successfully, but these errors were encountered:
Redisson version is 3.17.7
<dependency> <groupId>org.redisson</groupId> <artifactId>redisson-spring-boot-starter</artifactId> <version>3.17.7</version> </dependency>
Sorry, something went wrong.
No branches or pull requests
I try to add listeners for redisson lock: (in a spring-boot project)
there is the listeners:
and get instances in the top class:
But there is no logs when i run the locking code.
😢
I want catch the lock events, such as locked、unlocked、expired ...
The text was updated successfully, but these errors were encountered: