title: Using Akka streams how can I form a composite case class object from two flows?
body: <p>Here are my case classes:</p>
  
  <pre><code>case class User(id: String, location: Option[Location] = None, age: Option[String] = None) {
  
    override def toString: String = s"User: $id from ${location.toString} age of $age"
  }
  
  case class UserBookRating(user: User, bookISBN: String, rating: String)
  </code></pre>
  
  <p>As you can see, UserBookRating depends on User</p>
  
  <p>I'm streaming data from two separate csv files: Users.csv and BookRatings.csv</p>
  
  <p>Example rows from each file:</p>
  
  <blockquote>
    <p>id, location, age</p>
    
    <p>"10";"chicago, illinois, usa";"26"</p>
  </blockquote>
  
  <p></p>
  
  <blockquote>
    <p>id, isbn, rating</p>
    
    <p>"10";"10240528340","5"</p>
  </blockquote>
  
  <p>I'm using Akka streams with GraphDSL, I have my two sources streaming from each file.  My problem is how can I get the data from both streams in order to form the BookRatings object since it depends on User.  Right now I have two separate streams that form User objects from Users.csv and another stream that forms BookRating objects, but only the id field of User is populated for BookRating object since that is the only information I know from BookRatings.csv file.  How could I combine the data coming from streams so I could form BookRating objects?</p>