title: How to make another rest API call in an Intercepting filter?
body: <p>I am trying to build an application with several microservices.</p>
  <p>Let's say I have 4 microservices A,B,C and D which interact using Rest API (Springboot- webclient).</p>
  <p>A would be the entry point for all external applications to interact with the application via an API gateway.</p>
  <p>However there is no API gateway between microservices A,B,C &amp;  D.</p>
  <p>Hence inorder to trace all the requests and responses, I have introduced a monitoring service that exposes an asynchronous non blocking rest endpoint as follows:</p>
  <p><strong>POST /messages</strong></p>
  <p>which can be invoked by services A,B,C and D to push the requests and response messages.</p>
  <p>I am trying to add a WebClient Filter to invoke another rest call to push messages to monitoring service.</p>
  <p>However since I need to make another rest call in the filter, how can I retrieve the WebClient in the filter.</p>
  <pre><code>WebClient webClient = WebClient.builder()
          .baseUrl(&quot;http://localhost:8080|)
          .filter(PushToMonitoringServiceFilter())
          .build();
  
  
  private ExchangeFilterFunction (PushToMonitoringServiceFilter() {
      return (clientRequest, next) -&gt; {
          //TODO:  Make an API call to push the request??
          return next.exchange(clientRequest);
      };
  }
  </code></pre>
  <p>Also is this a bad idea? is there another pattern to monitor services without using API gateway.</p>