title: How to call two or more web services or REST in parallel with Project Reactor and join the answers
body: <p>Hello I would like to know how to call two or more web services or Rest services in pararelo and compose a response of the calls.</p>
  
  <p>I have found some examples on the web using other technologies but I can not get it to work with a reactor</p>
  
  <pre><code>// start task A asynchronously
  CompletableFuture&lt;ResponseA&gt; futureA = asyncServiceA.someMethod(someParam);
  // start task B asynchronously
  CompletableFuture&lt;ResponseB&gt; futureB = asyncServiceB.someMethod(someParam);
  
  CompletableFuture&lt;String&gt; combinedFuture = futureA
          .thenCombine(futureB, (a, b) -&gt; a.toString() + b.toString());
  
  // wait till both A and B complete
  String finalValue = combinedFuture.join();
  </code></pre>
  
  <p>////////////////////////////////////////////////////////////////////////////////</p>
  
  <pre><code>static void Run()
  {
      //Follow steps at this link for addding a reference to the necessary .NET library:
      //http://stackoverflow.com/questions/9611316/system-net-http-missing-from-    
      //namespace-using-net-4-5
  
      //Create an HTTP Client
      var client = new HttpClient();
  
      //Call first service
      var task1 = client.GetAsync("http://www.cnn.com");
  
      //Call second service
      var task2 = client.GetAsync("http://www.google.com");
  
      //Create list of all returned async tasks
      var allTasks = new List&lt;Task&lt;HttpResponseMessage&gt;&gt; { task1, task2 };
  
      //Wait for all calls to return before proceeding
      Task.WaitAll(allTasks.ToArray());
  
  }
  </code></pre>