{"id":16923354,"url":"https://github.com/jesty/shedlock-provider-cosmosdb","last_synced_at":"2025-10-25T18:02:48.208Z","repository":{"id":81162080,"uuid":"216532386","full_name":"jesty/shedlock-provider-cosmosdb","owner":"jesty","description":"A custom provider to use ShedLock with CosmosDB","archived":false,"fork":false,"pushed_at":"2019-10-22T08:05:27.000Z","size":20,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-01T15:47:22.113Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jesty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-21T09:43:11.000Z","updated_at":"2025-04-23T12:35:05.000Z","dependencies_parsed_at":"2023-06-30T08:16:14.709Z","dependency_job_id":null,"html_url":"https://github.com/jesty/shedlock-provider-cosmosdb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jesty/shedlock-provider-cosmosdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jesty%2Fshedlock-provider-cosmosdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jesty%2Fshedlock-provider-cosmosdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jesty%2Fshedlock-provider-cosmosdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jesty%2Fshedlock-provider-cosmosdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jesty","download_url":"https://codeload.github.com/jesty/shedlock-provider-cosmosdb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jesty%2Fshedlock-provider-cosmosdb/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261186369,"owners_count":23121937,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T19:58:51.065Z","updated_at":"2025-10-25T18:02:48.121Z","avatar_url":"https://github.com/jesty.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ShedLock Provider for CosmosDB\n\n[ShedLock](https://github.com/lukas-krecan/ShedLock) is a Java library that can be used to be sure that a scheduled task runs only once at the same time in a distributed environment.\n\nThe lock may be implemented using various providers like Redis, MongoDB, Hazelcast and so on.\n\nUsing the provider in this project, you can rely on Cosmos DB.\n\nTo use it, you just need to:\n\n- import the dependency in your pom.xml:\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003enet.javacrumbs.shedlock\u003c/groupId\u003e\n    \u003cartifactId\u003eshedlock-core\u003c/artifactId\u003e\n    \u003cversion\u003e3.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.jesty\u003c/groupId\u003e\n    \u003cartifactId\u003eshedlock-provider-cosmosdb\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n- instantiate the right provider, e.g. using Spring with annotation-based configuration:\n\n```java\nimport com.github.jesty.shedlock.provider.cosmosdb.CosmosDBLockProvider;\n\n...\n\n@Bean\npublic LockProvider lockProvider(CosmosContainer container) {\n    return new CosmosDBLockProvider(container, \"lockGroup\"); //lockGroup is the partition key\n}\n```\n\nFor more information about ShedLock refer to the [original documentation](https://github.com/lukas-krecan/ShedLock).\n\nThe lock relies on a Cosmos DB's collection. In order to perform the lock you have to create a stored procedure ([checkLockAndAcquire.js](https://github.com/jesty/ShedLock/tree/master/providers/cosmosdb/shedlock-provider-cosmosdb/storedprocedures/checkLockAndAcquire.js)) in your Cosmos DB instance.\n\n## Build from source\n\nBefore building this project you need to checkout ShedLock and install _shedlock-test-support_ in your local Maven repository:\n\n    \u003e git clone https://github.com/lukas-krecan/ShedLock.git\n    \u003e cd shedlock-test-support\n    \u003e mvn clean install \n\nFinally, you can build this project by running:\n\n    \u003e mvn package\n\nThere is an [integration test](https://github.com/jesty/ShedLock/tree/master/providers/cosmosdb/shedlock-provider-cosmosdb/src/test/java/net/javacrumbs/shedlock/provider/cosmosdb/CosmosDbProviderIntegrationTest.java) that can be run using:\n\n    \u003e mvn verify\n\nThis test need a Cosmos DB instance on Azure, or a [Cosmos DB local emulator](https://docs.microsoft.com/azure/cosmos-db/local-emulator) instance running.\nThe instance parameters must be set in [config.properties](https://github.com/jesty/ShedLock/tree/master/providers/cosmosdb/shedlock-provider-cosmosdb/src/test/resources/config.properties).\n\nIf you would like to build or install the project in your local repository without running integration tests, you can run:\n    \n    \u003e mvn install -DskipITs\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjesty%2Fshedlock-provider-cosmosdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjesty%2Fshedlock-provider-cosmosdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjesty%2Fshedlock-provider-cosmosdb/lists"}