{"id":22295773,"url":"https://github.com/danielfernandez/test-spring-boot-reactive-netty","last_synced_at":"2025-03-25T22:34:03.089Z","repository":{"id":146695457,"uuid":"64599531","full_name":"danielfernandez/test-spring-boot-reactive-netty","owner":"danielfernandez","description":"Test Repository for apparent issue when accessing netty-served Spring Boot reactive web apps","archived":false,"fork":false,"pushed_at":"2016-09-24T21:44:26.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T19:49:05.796Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/danielfernandez.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":"2016-07-31T14:59:51.000Z","updated_at":"2016-07-31T15:10:52.000Z","dependencies_parsed_at":"2023-04-03T15:21:32.585Z","dependency_job_id":null,"html_url":"https://github.com/danielfernandez/test-spring-boot-reactive-netty","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielfernandez%2Ftest-spring-boot-reactive-netty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielfernandez%2Ftest-spring-boot-reactive-netty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielfernandez%2Ftest-spring-boot-reactive-netty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielfernandez%2Ftest-spring-boot-reactive-netty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielfernandez","download_url":"https://codeload.github.com/danielfernandez/test-spring-boot-reactive-netty/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245555063,"owners_count":20634667,"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-12-03T17:43:08.624Z","updated_at":"2025-03-25T22:34:03.045Z","avatar_url":"https://github.com/danielfernandez.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# test-spring-boot-reactive-netty\n\nThis repository tests an appearing issue when using Netty to serve a Spring Boot-enabled *Reactive Web* application.\n\nThis application is very simple: it was created at [http://start.spring.io](http://start.spring.io) and the following\nmodification was made to its `pom.xml` in order to disable the Tomcat starter and use Netty instead:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.springframework.boot.experimental\u003c/groupId\u003e\n    \u003cartifactId\u003espring-boot-starter-web-reactive\u003c/artifactId\u003e\n    \u003cexclusions\u003e\n        \u003c!-- Excluded because we will be using netty --\u003e\n        \u003cexclusion\u003e\n            \u003cgroupId\u003eorg.springframework.boot\u003c/groupId\u003e\n            \u003cartifactId\u003espring-boot-starter-tomcat\u003c/artifactId\u003e\n        \u003c/exclusion\u003e\n    \u003c/exclusions\u003e\n\u003c/dependency\u003e\n\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.projectreactor.ipc\u003c/groupId\u003e\n    \u003cartifactId\u003ereactor-netty\u003c/artifactId\u003e\n\u003c/dependency\u003e\n```\n\nThe controller is very simple:\n```java\n@RestController\npublic class TestSpringBootReactiveNettyController {\n\n\t@RequestMapping(value = \"/\")\n\tpublic Mono\u003cSomeBean\u003e root() {\n\t\treturn Mono.just(new SomeBean(\"Ola mundo\", \"Hola mundo\"));\n\t}\n\n}\n```\n\n# How to replicate\n\nRequirements: Java 8, Maven 3, git client, web browser (Chrome or Firefox). Tested on several Operating Systems:\nMac OS 10.11 El Capitan, Windows 10, Ubuntu 16.\n\n  * Clone this repository\n  * `cd` to the project's folder\n  * Start the app with `mvn -U clean compile spring-boot:run`\n  * Open browser and go to `http://localhost:8080` (it is important that `localhost` is used)\n  * If a small piece of JSON loads OK the first time, hit refresh several times until some of those *refreshes* stop responding at all\n\n\n# Issue description\n\nEnvironments in which this has been replicated:\n\n   * Chrome 52, Postman (Chrome-based), Firefox 49 and Safari 9.1.3 on **Mac OS X 10.11 El Capitan** (server + browsers, all local).\n   * Chrome 52 and Firefox 49 on **Windows 10** (server + browsers, all local).\n\nSymptoms: only alternate requests have response: 1. Response, 2. No response, 3. Response, 4. No response…\n\nBy means of debugging it has been determined that Netty **does** receive an HTTP request in every case. But no HTTP\nresponse is sent half of the times.\n\nBy means of network sniffing it has been determined that the HTTP request looks alright, and exactly the same\nboth when there is HTTP response and when there isn't. Example:\n\n```\nGET / HTTP/1.1\nHost: localhost:8080\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Firefox/45.0\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\nAccept-Language: en-US,en;q=0.5\nAccept-Encoding: gzip, deflate\nConnection: keep-alive\n```\n\nThis **cannot be replicated using `curl`, `httpie` or `wget`**. Only browsers seem to show this behaviour (or\nPostman, which works on the Chrome engine).\n\nAlso, this behaviour also happens when the application is configured to return HTML (actually this issue initially\nappeared at the [Thymeleaf + Spring Reactive sandbox application](https://github.com/thymeleaf/thymeleafsandbox-springreactive)).\n\n**IMPORTANT**: This issue, in the same systems and setups, **cannot be replicated when accessing the server using its IP (e.g. `192.168.0.20`)**. So this seems somehow related to the use of `localhost`.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielfernandez%2Ftest-spring-boot-reactive-netty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielfernandez%2Ftest-spring-boot-reactive-netty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielfernandez%2Ftest-spring-boot-reactive-netty/lists"}