{"id":19336556,"url":"https://github.com/spt-development/spt-development-cid-web","last_synced_at":"2025-04-23T01:30:49.344Z","repository":{"id":39926294,"uuid":"337518224","full_name":"spt-development/spt-development-cid-web","owner":"spt-development","description":"Library for integrating spt-development/spt-development-cid into a web project.","archived":false,"fork":false,"pushed_at":"2025-03-23T16:43:59.000Z","size":123,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T06:11:20.604Z","etag":null,"topics":["correlation","microservices","spring-web"],"latest_commit_sha":null,"homepage":"https://github.com/spt-development/spt-development-cid-web","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/spt-development.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":"2021-02-09T19:48:54.000Z","updated_at":"2025-01-26T13:23:20.000Z","dependencies_parsed_at":"2023-02-04T16:15:59.260Z","dependency_job_id":"0816e6ca-5469-4d51-a40d-870d4c6c7cb3","html_url":"https://github.com/spt-development/spt-development-cid-web","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spt-development%2Fspt-development-cid-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spt-development%2Fspt-development-cid-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spt-development%2Fspt-development-cid-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spt-development%2Fspt-development-cid-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spt-development","download_url":"https://codeload.github.com/spt-development/spt-development-cid-web/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250352169,"owners_count":21416453,"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":["correlation","microservices","spring-web"],"created_at":"2024-11-10T03:11:38.959Z","updated_at":"2025-04-23T01:30:48.980Z","avatar_url":"https://github.com/spt-development.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"````\n  ____  ____ _____   ____                 _                                  _   \n / ___||  _ \\_   _| |  _ \\  _____   _____| | ___  _ __  _ __ ___   ___ _ __ | |_ \n \\___ \\| |_) || |   | | | |/ _ \\ \\ / / _ \\ |/ _ \\| '_ \\| '_ ` _ \\ / _ \\ '_ \\| __|\n  ___) |  __/ | |   | |_| |  __/\\ V /  __/ | (_) | |_) | | | | | |  __/ | | | |_ \n |____/|_|    |_|   |____/ \\___| \\_/ \\___|_|\\___/| .__/|_| |_| |_|\\___|_| |_|\\__|\n                                                 |_|                                           \n cid-web-------------------------------------------------------------------------\n````\n\n[![build_status](https://github.com/spt-development/spt-development-cid-web/actions/workflows/build.yml/badge.svg)](https://github.com/spt-development/spt-development-cid-web/actions)\n\nLibrary for integrating [spt-development/spt-development-cid](https://github.com/spt-development/spt-development-cid)\ninto a web project.\n\nUsage\n=====\n\nRegister the `CorrelationIdFilter` to initialise the correlation ID for each incoming request and return as a response \nheader. For example, in a Spring based project register as a bean.\n\n```java\n@Bean\npublic FilterRegistrationBean\u003cCorrelationIdFilter\u003e correlationIdFilter() {\n    final FilterRegistrationBean\u003cCorrelationIdFilter\u003e filterRegBean = new FilterRegistrationBean\u003c\u003e(\n            // Constructor overloads allow the overiding of the correlation ID header and whether to use the \n            // request correlation ID header (if it exists) to initialise the correlation ID.\n            new CorrelationIdFilter()\n    );\n\n    filterRegBean.setOrder(Ordered.HIGHEST_PRECEDENCE);\n    filterRegBean.addUrlPatterns(\"/api/v1.0/*\");\n\n    return filterRegBean;\n}\n```\n\nRegister the `MdcCorrelationIdFilter` to add the correlation ID to the [MDC](https://logback.qos.ch/manual/mdc.html);\n\n```java\n@Bean\npublic FilterRegistrationBean\u003cMdcCorrelationIdFilter\u003e mdcCorrelationIdFilter(@Value(\"${spt.cid.mdc.cid-key:#{null}}\") String mdcCidKey) {\n    final FilterRegistrationBean\u003cMdcCorrelationIdFilter\u003e filterRegBean = new FilterRegistrationBean\u003c\u003e(\n            new MdcCorrelationIdFilter()\n    );\n\n    // This bean must be registed after the CorrelationIdFilter.\n    filterRegBean.setOrder(Ordered.HIGHEST_PRECEDENCE + 1);\n    filterRegBean.addUrlPatterns(\"/api/v1.0/*\");\n\n    return filterRegBean;\n}\n```\n\nAlternatively, if you are integrating the library into a Spring Boot project, add the\n[spt-development/spt-development-cid-web-spring-boot](https://github.com/spt-development/spt-development-cid-web-spring-boot)\nstarter to your project's pom.\n\nBuilding locally\n================\n\nTo build the library, run the following maven command:\n\n```shell\n$ ./mvnw clean install\n```\n\nRelease\n=======\n\nTo build a release and upload to Maven Central push to `main`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspt-development%2Fspt-development-cid-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspt-development%2Fspt-development-cid-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspt-development%2Fspt-development-cid-web/lists"}