Skip to content
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

Conversation

ricardojlrufino
Copy link

Implementation for quakus 2x using native quarkus redis client

Copy link
Owner

@lukas-krecan lukas-krecan left a 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.

providers/redis/shedlock-provider-redis-quarkus2/pom.xml Outdated Show resolved Hide resolved
providers/redis/shedlock-provider-redis-quarkus2/pom.xml Outdated Show resolved Hide resolved

long expireTime = getSecsUntil(lockConfiguration.getLockAtMostUntil());

String key = buildKey(lockConfiguration.getName(), this.environment);
Copy link
Owner

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?

Copy link
Author

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());
Copy link
Owner

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.

Copy link
Owner

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.

Copy link
Author

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 {
Copy link
Owner

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.

Copy link
Author

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

@lukas-krecan
Copy link
Owner

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.

@ricardojlrufino
Copy link
Author

This is "oficial version" from redhat
3.x is a community version
image

@lukas-krecan
Copy link
Owner

Would something like this be OK for you?

@lukas-krecan lukas-krecan merged commit 4359464 into lukas-krecan:master Oct 13, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants