title: RabbitMQ Add an object to another one coming from queue in Spring
body: <p>I have this json object that is mapped to this model class:</p>
  <p>Json:</p>
  <pre><code>{
      &quot;type&quot;: &quot;NEW&quot;,
      &quot;operation&quot;: &quot;NEW&quot;,
      &quot;id&quot;: 1,
      &quot;entity&quot;: &quot;DOCUMENT&quot;,
      &quot;entityType&quot;: &quot;NIE&quot;,
      &quot;documents&quot;: {
          &quot;id&quot;: 1,
          &quot;additionals&quot;: {
              &quot;issuing_authority&quot;: &quot;Spain&quot;,
              &quot;country_doc&quot;: &quot;ES&quot;,
              &quot;place_of_birth&quot;: &quot;&quot;,
              &quot;valid_from&quot;: &quot;1995-08-09&quot;,
              &quot;valid_to&quot;: &quot;0001-01-01&quot;
          },
          &quot;code&quot;: &quot;X12345&quot;,
          &quot;typeDocument&quot;: &quot;NIE&quot;
      }
  }
  </code></pre>
  <p>The model class:</p>
  <pre><code>public class PeopleDocumentDTO {
  
      private String processType;
      private String operation;
      private String entity;
      private String entityType;
      private Long id;
      private Document document;
  
      @Getter
      @Setter
      class Customer {
          private String systemId;
          private String customerId;
      }
      private List&lt;Customer&gt; customers;
  }
  </code></pre>
  <p>The thing is that model class also includes a list of customers that have to be added and its coming from another microservice here:</p>
  <pre><code>@Service
  public class WebClientService {
  public Mono&lt;CuCoPerson&gt; getCuCoPerson(Integer cucoId, String GS_AUTH_TOKEN) {
          WebClient webClient = WebClient.create();
  
          return webClient.get()
                  .uri(GET_RELATION_BY_ID + cucoId)
                  .header(&quot;Accept&quot;, &quot;application/json&quot;)
                  .header(&quot;Authorization&quot;, GS_AUTH_TOKEN)
                  .retrieve()
                  .bodyToMono(CuCoPerson.class)
                  .map(cuCoPerson -&gt; {
                      List&lt;CustomerRelation&gt; matches = cuCoPerson.getRelatedCustomers()
                              .stream()
                              .filter(relation -&gt; relation.getSystemId().equals(400) || relation.getSystemId().equals(300) || relation.getSystemId().equals(410))
                              .filter(relation -&gt; relation.getCustomerId().contains(&quot;F&quot;))
                              .collect(Collectors.toList());
                      cuCoPerson.setRelatedCustomers(matches);
                      return cuCoPerson;
                  });
      }
  }
  </code></pre>
  <p>Last but not least, this is my listenerClass where I map my message:</p>
  <pre><code>@RabbitListener(queues = &quot;${event.queue}&quot;)
  public void receivedMessage(Message message) throws JsonProcessingException {
  
          String json = &quot;&quot;;
  
          json = new String(message.getBody(), StandardCharsets.UTF_8);
          System.out.println(json);
  
          logger.info(&quot;Received message: {}&quot;, json);
  
          ObjectMapper objectMapper = new ObjectMapper();
          PeopleDocumentDTO dto = objectMapper.readValue(json, PeopleDocumentDTO.class);
  </code></pre>
  <p>So, how can I add this cuCoPerson to my model DTO?</p>