Uploaded image for project: 'Configuration Persistence Service'
  1. Configuration Persistence Service
  2. CPS-830

DMI-NCMP Asynchronously Publish Response Event to Client Topic

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Medium Medium
    • Kohn Release
    • None
    • CPS-Core

      Design see https://wiki.onap.org/display/DW/CPS-821+Spike%3A+Support+Async+read-write+operations+on+CPS-NCMP+interface#CPS821Spike:SupportAsyncreadwriteoperationsonCPSNCMPinterface-ProposedDesign

      Scope of this user story: Response Message format, forwarding to client Topic (or CPS broadcast topic for now)

      https://www.baeldung.com/spring-webclient-resttemplate

      Currently we are using RestTemplate that can be replaced by WebClient. RestTemplate uses Java Servlet API and is therefore synchronous and blocking. Contrarily, WebClient is asynchronous and will not block the executing thread while waiting for the response to come back.

      Spring WebClient vs. RestTemplate

      RestTemplate uses Java Servlet API and is therefore synchronous and blocking. Contrarily, WebClient is asynchronous and will not block the executing thread while waiting for the response to come back. Only when the response is ready will the notification be produced.

      RestTemplate will still be used. The non-blocking approach uses much fewer system resources compared to the blocking one. Hence, WebClient is a preferable choice. 

       

      A/C

      1. Agree use of WebClient
      2. Correctly formatted message (agree with team and stakeholder first) incl. 
        1. Message/Request ID
        2. Original client topic
        3. Response payload
      3. Message gets forwarded to original Client Topic
        1. agree client response format (See spike)
          • Contact kieranmccarthy
          • Note: Try keep it as similar on m2m topic and client topic
      4. Message can be seen on client topic with correct information

       

      Out of scope

      • DMI Plugin will still follow synchronous process but also send async response
      • e2e testing and CSIT (CPS-833)

       

      Testing Steps

      1. Add request via
        1. Publish message to NCMP or
        2. Directly call method/API to invoke async operation
      2. Monitor logs in NCMP & DMI for activity
      3. Monitor m2m topic for message and verify correct information
      4. Monitor client topic for message and verify correct information

            josephkeenan josephkeenan
            josephkeenan josephkeenan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: