{"action":"created","issue":{"url":"https://api.github.com/repos/reactor/reactor-netty/issues/351","repository_url":"https://api.github.com/repos/reactor/reactor-netty","labels_url":"https://api.github.com/repos/reactor/reactor-netty/issues/351/labels{/name}","comments_url":"https://api.github.com/repos/reactor/reactor-netty/issues/351/comments","events_url":"https://api.github.com/repos/reactor/reactor-netty/issues/351/events","html_url":"https://github.com/reactor/reactor-netty/issues/351","id":321269564,"node_id":"MDU6SXNzdWUzMjEyNjk1NjQ=","number":351,"title":"Unwrap Mono String to a String value","user":{"login":"letkemanpete78","id":22402240,"node_id":"MDQ6VXNlcjIyNDAyMjQw","avatar_url":"https://avatars2.githubusercontent.com/u/22402240?v=4","gravatar_id":"","url":"https://api.github.com/users/letkemanpete78","html_url":"https://github.com/letkemanpete78","followers_url":"https://api.github.com/users/letkemanpete78/followers","following_url":"https://api.github.com/users/letkemanpete78/following{/other_user}","gists_url":"https://api.github.com/users/letkemanpete78/gists{/gist_id}","starred_url":"https://api.github.com/users/letkemanpete78/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/letkemanpete78/subscriptions","organizations_url":"https://api.github.com/users/letkemanpete78/orgs","repos_url":"https://api.github.com/users/letkemanpete78/repos","events_url":"https://api.github.com/users/letkemanpete78/events{/privacy}","received_events_url":"https://api.github.com/users/letkemanpete78/received_events","type":"User","site_admin":false},"labels":[{"id":427159020,"node_id":"MDU6TGFiZWw0MjcxNTkwMjA=","url":"https://api.github.com/repos/reactor/reactor-netty/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":19,"created_at":"2018-05-08T17:04:59Z","updated_at":"2018-09-18T01:55:27Z","closed_at":"2018-05-09T02:38:41Z","author_association":"NONE","body":"### Expected behavior\r\nWith the following code I was expecting to get a string value\r\nKotlin Code:\r\n```\r\nvar lastName:String = serverWebExchange\r\n            .formData\r\n            .map<String> { form -> return@map form[\"lastName\"]!![0] }\r\n            .block(Duration.ofSeconds(20))\r\n```\r\n### Actual behavior\r\nHowever I get the following error message\r\n> java.lang.IllegalStateException: block()/blockFirst()/blockLast() are blocking, which is not supported in thread reactor-http-nio-2\r\n\r\n### Steps to reproduce\r\nUnwrap Mono < String > to String value so that it can be used in a function\r\n\r\n### Reactor Netty version\r\nSpringBoot versions >= 2.0.1\r\n\r\n### JVM version (e.g. `java -version`)\r\nJava 9\r\n\r\n### OS version (e.g. `uname -a`)\r\nWindows 10 Pro\r\n\r\nThis code worked with SpringBoot version 2.0.0 and all of it's releases."},"comment":{"url":"https://api.github.com/repos/reactor/reactor-netty/issues/comments/422227459","html_url":"https://github.com/reactor/reactor-netty/issues/351#issuecomment-422227459","issue_url":"https://api.github.com/repos/reactor/reactor-netty/issues/351","id":422227459,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMjIyNzQ1OQ==","user":{"login":"17610070778","id":38308694,"node_id":"MDQ6VXNlcjM4MzA4Njk0","avatar_url":"https://avatars1.githubusercontent.com/u/38308694?v=4","gravatar_id":"","url":"https://api.github.com/users/17610070778","html_url":"https://github.com/17610070778","followers_url":"https://api.github.com/users/17610070778/followers","following_url":"https://api.github.com/users/17610070778/following{/other_user}","gists_url":"https://api.github.com/users/17610070778/gists{/gist_id}","starred_url":"https://api.github.com/users/17610070778/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/17610070778/subscriptions","organizations_url":"https://api.github.com/users/17610070778/orgs","repos_url":"https://api.github.com/users/17610070778/repos","events_url":"https://api.github.com/users/17610070778/events{/privacy}","received_events_url":"https://api.github.com/users/17610070778/received_events","type":"User","site_admin":false},"created_at":"2018-09-18T01:55:27Z","updated_at":"2018-09-18T01:55:27Z","author_association":"NONE","body":"（这段代码是跑在Netty中的）问题已经得到解决。是因为Mono.just()返回的是MonoJust，而执行map方法后，返回的是MonoMap，执行zipWith后，返回的是MonoZip。而MonoJust对象在block()时，直接返回的值，MonoMap以及MonoZip在执行block()时，首先检查当前线程是否是NoBlocking的对象，如果是则不能阻塞，报异常。调试的时候发现Netty的主线程是NoBlocking的代理对象。最后说一下Netty的线程是不可以阻塞的对吗？"}}
{"actor":{"display_login":"17610070778"}}