-
Notifications
You must be signed in to change notification settings - Fork 514
New issue
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
shedlock-provider-redis-quarkus2 impl using vert.x redis client #1553
shedlock-provider-redis-quarkus2 impl using vert.x redis client #1553
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks a lot. I have left quite a lot comments. The most important is to extend AbstractExtensibleLockProviderIntegrationTest
for tests as it contains quite comprehensive test-suite.
.../src/main/java/net/javacrumbs/shedlock/provider/redis/quarkus2/QuarkusRedisLockProvider.java
Outdated
Show resolved
Hide resolved
.../src/main/java/net/javacrumbs/shedlock/provider/redis/quarkus2/QuarkusRedisLockProvider.java
Outdated
Show resolved
Hide resolved
.../src/main/java/net/javacrumbs/shedlock/provider/redis/quarkus2/QuarkusRedisLockProvider.java
Outdated
Show resolved
Hide resolved
|
||
long expireTime = getSecsUntil(lockConfiguration.getLockAtMostUntil()); | ||
|
||
String key = buildKey(lockConfiguration.getName(), this.environment); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not need to pass instance variable environment
as an argument?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't understand your point
|
||
public QuarkusRedisLockProvider(RedisDataSource dataSource, String appNameOrPrefix) { | ||
this.redisDataSource = dataSource; | ||
this.environment = appNameOrPrefix + ":"+ String.join(":", ConfigUtils.getProfiles()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please explain why the enviroment is used for the key. I do not think we have anything like this in any other lock provider.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto the appNameOrPrefix. If you have a use-case for it, let's just keep the appNameOrPrefix
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Part of this code was copied from the spring implementation, it used the profile/environment name to compose the key. I ended up leaving it as it was.
|
||
|
||
@ApplicationScoped | ||
public class SchedulerLockFactory { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this? In Spring we let the users to specify the Lock Provider in the aplication code. Having it in the library feels surprising.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if I import a specific provider it's because I want to use it... I don't see the need to configure it manually
.../net/javacrumbs/shedlock/provider/redis/quarkus/QuarkusRedisLockProviderIntegrationTest.java
Outdated
Show resolved
Hide resolved
I have not realized that it's for an old version of Quarkus, sorry. In this case I will not be willing to merge it as it will be obsolete the second we release it. Thanks again for your contribution, but in this case it will be better if you keep the code only in your codebase. |
Would something like this be OK for you? |
Implementation for quakus 2x using native quarkus redis client