- CPS-821Getting issue details... STATUS
Description/Scope
The scope of this spike is to ascertain:
- How to use messaging (producer, agree topic etc))
- Using existing rest endpoint with additional flag indicating async response
- Also consider asynchronous request option using messaging in the proposal
Associated Jira
Issues/Decisions
# | Issue | Decision | Notes/Jira |
---|---|---|---|
1 | What topic to use? proposed ncmp-async-xxx | ||
2 | Agree proposed change to url | ||
3 | passthrough request need to be able to handle different response types (using accept header) but the async option would have a fixed and possibly different response type. | ||
4 | How many messages are we expecting at peak time? | ||
5 | Should we create a standalone app to demo or are tests sufficient? |
Proposed Diagram
Rest Endpoint with Async Flag
Current | Proposed |
---|---|
<ncmp>/v1/ch/PNFDemo/data/ds/ncmp-datastore:passthrough-running?resourceIdentifier=stores:bookstore | <ncmp>/v1/ch/PNFDemo/data/async/ds/ncmp-datastore:passthrough-running?resourceIdentifier=stores:bookstore |
Kafka config
Response types for passthrough
Will we be able to handle everything "as-is"?
Future or alternative
What are Futures?
CompletableFuture (Java8+)
Java 8 introduced the CompletableFuture class. Along with the Future interface, it also implemented the CompletionStage interface. This interface defines the contract for an asynchronous computation step that we can combine with other steps.
CompletableFuture is at the same time a building block and a framework, with about 50 different methods for composing, combining, and executing asynchronous computation steps and handling errors.
source: https://www.baeldung.com/java-completablefuture
RequestID Generation
Type | Method |
---|---|
UUID |
|