{"id":15999207,"url":"https://github.com/wololock/ratpack-quickstart-demo","last_synced_at":"2025-07-31T22:03:54.655Z","repository":{"id":142878280,"uuid":"124374648","full_name":"wololock/ratpack-quickstart-demo","owner":"wololock","description":"Source code for \"Practical quickstart to Ratpack\" presentation.","archived":false,"fork":false,"pushed_at":"2019-11-03T19:23:28.000Z","size":622,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T09:37:41.664Z","etag":null,"topics":["groovy","ratpack","ratpackweb"],"latest_commit_sha":null,"homepage":"","language":"Groovy","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wololock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-03-08T10:19:36.000Z","updated_at":"2023-04-22T03:15:02.000Z","dependencies_parsed_at":"2023-06-15T08:00:16.138Z","dependency_job_id":null,"html_url":"https://github.com/wololock/ratpack-quickstart-demo","commit_stats":{"total_commits":17,"total_committers":1,"mean_commits":17.0,"dds":0.0,"last_synced_commit":"841afbe37e55bc99125076b37904e6e2be028eca"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wololock/ratpack-quickstart-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wololock%2Fratpack-quickstart-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wololock%2Fratpack-quickstart-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wololock%2Fratpack-quickstart-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wololock%2Fratpack-quickstart-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wololock","download_url":"https://codeload.github.com/wololock/ratpack-quickstart-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wololock%2Fratpack-quickstart-demo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268125704,"owners_count":24200285,"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","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["groovy","ratpack","ratpackweb"],"created_at":"2024-10-08T08:41:06.164Z","updated_at":"2025-07-31T22:03:54.591Z","avatar_url":"https://github.com/wololock.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"ratpack-quickstart-demo\n-----------------------------\n\n[![Build Status](https://travis-ci.org/wololock/ratpack-quickstart-demo.svg?branch=master)](https://travis-ci.org/wololock/ratpack-quickstart-demo)\n[![codecov](https://codecov.io/gh/wololock/ratpack-quickstart-demo/branch/master/graph/badge.svg)](https://codecov.io/gh/wololock/ratpack-quickstart-demo)\n\n![Cover image](ratpack.png)\n\n*Photo: http://notallwhowanderarelost.com/rat-pack/*\n\nHello and welcome to the repository containing source code from my **Practical quickstart to Ratpack** talk. \n\n## Application architecture\n\nThis demo simulates following problem. Imagine two microservices - *product-service* and *recommendations-service*. \n\nThe first one is just a simple REST service that allows you to read information about given product. But this application does not simply\ntranslate HTTP request to some SQL query for example. It communicates with other services, databases or even file system instead.\nIt means that receiving a product information will take some time, because some information might be taken from multiple \nweb services while some of them might be loaded from the database. We will simulate latencies in this case (from 100 ms to 1500 ms).\n\n*recommendation-service* is smart enough to suggest recommendations to the client, but it doesn't know anything about the products.\nIt retrieves product information from *product-service* via HTTP GET request. We won't focus on creating recommendations engine, \nwe will hardcode products IDs and we will focus only on communication between both services. \n\n![Services](architecture.png)\n\n## Exemplary requests\n\nBelow you can find exemplary requests triggered with [HTTPie](https://httpie.org/) command line tool.\n\n```bash\nhttp localhost:5050/product/PROD-001\n```\n\n```bash\nHTTP/1.1 200 OK\ncontent-encoding: gzip\ncontent-type: application/json\ntransfer-encoding: chunked\n\n{\n    \"id\": \"PROD-001\",\n    \"name\": \"Learning Ratpack\",\n    \"price\": 29.99\n}\n```\n\n```bash\nhttp localhost:5050/product/PROD-006\n```\n\n```bash\nHTTP/1.1 404 Not Found\ncontent-encoding: gzip\ncontent-type: application/json\ntransfer-encoding: chunked\n\n{\n    \"message\": \"Product not found\"\n}\n```\n\n```bash\nhttp localhost:5050/recommendations \n```\n\n```bash \nHTTP/1.1 200 OK\ncontent-encoding: gzip\ncontent-type: application/json\ntransfer-encoding: chunked\n\n{\n    \"discount\": \"-20%\",\n    \"products\": [\n        {\n            \"id\": \"PROD-001\",\n            \"name\": \"Learning Ratpack\",\n            \"price\": 23.992\n        },\n        {\n            \"id\": \"PROD-002\",\n            \"name\": \"Netty In Action\",\n            \"price\": 31.992\n        }\n    ],\n    \"total\": 2\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwololock%2Fratpack-quickstart-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwololock%2Fratpack-quickstart-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwololock%2Fratpack-quickstart-demo/lists"}