title: Spring Webflux Router Functions not being used
body: <p>I have the following configuration</p>
  
  <pre><code>@Configuration
  @EnableWebFlux
  public class WebfluxConfig {
  
      @Bean
      RouterFunction&lt;?&gt; routerFunction(UserResource userResource) {
          return route(GET("/user"), r -&gt; ok()
                  .body(userResource.findAll(), UserDto.class));
      }
  }
  </code></pre>
  
  <p>When I start the application, it kind of making the expected mapping</p>
  
  <blockquote>
    <p>2018-04-12 12:12:06.682  INFO 54617 --- [           main]
    o.s.w.r.f.s.s.RouterFunctionMapping      : Mapped /user ->
    c.n.a.i.c.WebfluxConfig$$Lambda$764/909878836@14ba7f15</p>
  </blockquote>
  
  <p>However when I try to connect to it, I got 404. And the router predicate has not been invoked once.</p>
  
  <pre><code>curl -v localhost:8080/user
  
  *   Trying ::1...
  * TCP_NODELAY set
  * Connected to localhost (::1) port 8080 (#0)
  
  &gt; GET /user HTTP/1.1
  &gt; Host: localhost:8080
  &gt; User-Agent: curl/7.54.0
  &gt; Accept: */*
  &gt;
  
  &lt; HTTP/1.1 404
  &lt; Content-Type: application/json;charset=UTF-8
  &lt; Transfer-Encoding: chunked
  &lt; Date: Thu, 12 Apr 2018 09:15:52 GMT
  &lt;
  
  * Connection #0 to host localhost left intact
  {"timestamp":"2018-04-12T09:15:52.475+0000","status":404,"error":"Not Found","message":"No message available","path":"/user"}%
  </code></pre>
  
  <p>And here are the logs from server</p>
  
  <pre><code>&gt; 2018-04-12 12:33:03.950 DEBUG 67056 --- [nio-8080-exec-2]
  &gt; o.s.b.w.s.f.OrderedRequestContextFilter  : Bound request context to
  &gt; thread: org.apache.catalina.connector.RequestFacade@51160dcb
  &gt; 2018-04-12 12:33:03.950 DEBUG 67056 --- [nio-8080-exec-2]
  &gt; s.b.a.e.w.s.WebMvcEndpointHandlerMapping : Looking up handler method
  &gt; for path /user 2018-04-12 12:33:03.952 DEBUG 67056 ---
  &gt; [nio-8080-exec-2] s.b.a.e.w.s.WebMvcEndpointHandlerMapping : Did not
  &gt; find handler method for [/user] 2018-04-12 12:33:03.952 DEBUG 67056
  &gt; --- [nio-8080-exec-2] a.e.w.s.ControllerEndpointHandlerMapping : Looking up handler method for path /user 2018-04-12 12:33:03.952 DEBUG
  &gt; 67056 --- [nio-8080-exec-2] a.e.w.s.ControllerEndpointHandlerMapping :
  &gt; Did not find handler method for [/user] 2018-04-12 12:33:03.952 DEBUG
  &gt; 67056 --- [nio-8080-exec-2] s.w.s.m.m.a.RequestMappingHandlerMapping :
  &gt; Looking up handler method for path /user 2018-04-12 12:33:03.953 DEBUG
  &gt; 67056 --- [nio-8080-exec-2] s.w.s.m.m.a.RequestMappingHandlerMapping :
  &gt; Did not find handler method for [/user] 2018-04-12 12:33:03.953 DEBUG
  &gt; 67056 --- [nio-8080-exec-2] o.s.w.s.handler.SimpleUrlHandlerMapping  :
  &gt; Matching patterns for request [/user] are [/**] 2018-04-12
  &gt; 12:33:03.953 DEBUG 67056 --- [nio-8080-exec-2]
  &gt; o.s.w.s.handler.SimpleUrlHandlerMapping  : URI Template variables for
  &gt; request [/user] are {} 2018-04-12 12:33:03.953 DEBUG 67056 ---
  &gt; [nio-8080-exec-2] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapping
  &gt; [/user] to HandlerExecutionChain with handler
  &gt; [ResourceHttpRequestHandler [locations=[class path resource
  &gt; [META-INF/resources/], class path resource [resources/], class path
  &gt; resource [static/], class path resource [public/], ServletContext
  &gt; resource [/]],
  &gt; resolvers=[org.springframework.web.servlet.resource.PathResourceResolver@7c4ca87c]]]
  &gt; and 1 interceptor 2018-04-12 12:33:03.954 DEBUG 67056 ---
  &gt; [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet        :
  &gt; DispatcherServlet with name 'dispatcherServlet' processing GET request
  &gt; for [/user] 2018-04-12 12:33:03.954 DEBUG 67056 --- [nio-8080-exec-2]
  &gt; s.b.a.e.w.s.WebMvcEndpointHandlerMapping : Looking up handler method
  &gt; for path /user 2018-04-12 12:33:03.955 DEBUG 67056 ---
  &gt; [nio-8080-exec-2] s.b.a.e.w.s.WebMvcEndpointHandlerMapping : Did not
  &gt; find handler method for [/user] 2018-04-12 12:33:03.955 DEBUG 67056
  &gt; --- [nio-8080-exec-2] a.e.w.s.ControllerEndpointHandlerMapping : Looking up handler method for path /user 2018-04-12 12:33:03.955 DEBUG
  &gt; 67056 --- [nio-8080-exec-2] a.e.w.s.ControllerEndpointHandlerMapping :
  &gt; Did not find handler method for [/user] 2018-04-12 12:33:03.955 DEBUG
  &gt; 67056 --- [nio-8080-exec-2] s.w.s.m.m.a.RequestMappingHandlerMapping :
  &gt; Looking up handler method for path /user 2018-04-12 12:33:03.956 DEBUG
  &gt; 67056 --- [nio-8080-exec-2] s.w.s.m.m.a.RequestMappingHandlerMapping :
  &gt; Did not find handler method for [/user] 2018-04-12 12:33:03.956 DEBUG
  &gt; 67056 --- [nio-8080-exec-2] o.s.w.s.handler.SimpleUrlHandlerMapping  :
  &gt; Matching patterns for request [/user] are [/**] 2018-04-12
  &gt; 12:33:03.956 DEBUG 67056 --- [nio-8080-exec-2]
  &gt; o.s.w.s.handler.SimpleUrlHandlerMapping  : URI Template variables for
  &gt; request [/user] are {} 2018-04-12 12:33:03.956 DEBUG 67056 ---
  &gt; [nio-8080-exec-2] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapping
  &gt; [/user] to HandlerExecutionChain with handler
  &gt; [ResourceHttpRequestHandler [locations=[class path resource
  &gt; [META-INF/resources/], class path resource [resources/], class path
  &gt; resource [static/], class path resource [public/], ServletContext
  &gt; resource [/]],
  &gt; resolvers=[org.springframework.web.servlet.resource.PathResourceResolver@7c4ca87c]]]
  &gt; and 1 interceptor 2018-04-12 12:33:03.957 DEBUG 67056 ---
  &gt; [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet        :
  &gt; Last-Modified value for [/user] is: -1 2018-04-12 12:33:03.958 DEBUG
  &gt; 67056 --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet        :
  &gt; Null ModelAndView returned to DispatcherServlet with name
  &gt; 'dispatcherServlet': assuming HandlerAdapter completed request
  &gt; handling 2018-04-12 12:33:03.958 DEBUG 67056 --- [nio-8080-exec-2]
  &gt; o.s.web.servlet.DispatcherServlet        : Successfully completed
  &gt; request 2018-04-12 12:33:03.960 DEBUG 67056 --- [nio-8080-exec-2]
  &gt; o.s.b.w.s.f.OrderedRequestContextFilter  : Cleared thread-bound
  &gt; request context: org.apache.catalina.connector.RequestFacade@51160dcb
  &gt; 2018-04-12 12:33:03.960 DEBUG 67056 --- [nio-8080-exec-2]
  &gt; o.s.web.servlet.DispatcherServlet        : DispatcherServlet with name
  &gt; 'dispatcherServlet' processing GET request for [/error] 2018-04-12
  &gt; 12:33:03.960 DEBUG 67056 --- [nio-8080-exec-2]
  &gt; s.b.a.e.w.s.WebMvcEndpointHandlerMapping : Looking up handler method
  &gt; for path /error 2018-04-12 12:33:03.961 DEBUG 67056 ---
  &gt; [nio-8080-exec-2] s.b.a.e.w.s.WebMvcEndpointHandlerMapping : Did not
  &gt; find handler method for [/error] 2018-04-12 12:33:03.961 DEBUG 67056
  &gt; --- [nio-8080-exec-2] a.e.w.s.ControllerEndpointHandlerMapping : Looking up handler method for path /error 2018-04-12 12:33:03.961
  &gt; DEBUG 67056 --- [nio-8080-exec-2]
  &gt; a.e.w.s.ControllerEndpointHandlerMapping : Did not find handler method
  &gt; for [/error] 2018-04-12 12:33:03.962 DEBUG 67056 --- [nio-8080-exec-2]
  &gt; s.w.s.m.m.a.RequestMappingHandlerMapping : Looking up handler method
  &gt; for path /error 2018-04-12 12:33:03.962 DEBUG 67056 ---
  &gt; [nio-8080-exec-2] s.w.s.m.m.a.RequestMappingHandlerMapping : Returning
  &gt; handler method [public
  &gt; org.springframework.http.ResponseEntity&lt;java.util.Map&lt;java.lang.String,
  &gt; java.lang.Object&gt;&gt;
  &gt; org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)]
  &gt; 2018-04-12 12:33:03.962 DEBUG 67056 --- [nio-8080-exec-2]
  &gt; o.s.b.f.s.DefaultListableBeanFactory     : Returning cached instance
  &gt; of singleton bean 'basicErrorController' 2018-04-12 12:33:03.962 DEBUG
  &gt; 67056 --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet        :
  &gt; Last-Modified value for [/error] is: -1 2018-04-12 12:33:03.966 DEBUG
  &gt; 67056 --- [nio-8080-exec-2] o.s.w.s.m.m.a.HttpEntityMethodProcessor  :
  &gt; Written [{timestamp=Thu Apr 12 12:33:03 EEST 2018, status=404,
  &gt; error=Not Found, message=No message available, path=/user}] as
  &gt; "application/json" using
  &gt; [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter@1c00d406]
  &gt; 2018-04-12 12:33:03.966 DEBUG 67056 --- [nio-8080-exec-2]
  &gt; o.s.web.servlet.DispatcherServlet        : Null ModelAndView returned
  &gt; to DispatcherServlet with name 'dispatcherServlet': assuming
  &gt; HandlerAdapter completed request handling 2018-04-12 12:33:03.966
  &gt; DEBUG 67056 --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet   
  &gt; : Successfully completed request
  </code></pre>
  
  <p>What have I did wrong here?</p>