otherwise be prepared for possibly interesting threading issues. That is if your using something like Vert.x or Play you may want to try to use its backing client to participate in whatever bus or reactor loop the framework provides. It was created as part of the Spring Web Reactive module and will be replacing the classic RestTemplate in these scenarios. Simply put, WebClient is an interface representing the main entry point for performing web requests. Make sure to check what your framework stack is using for an HTTP client, how it does threading, and ideally use the same client if it offers one. Discover Spring 5s WebClient - a new reactive RestTemplate alternative. You can just copy'n'paste'n'run it on Java 6+. Here's a kickoff example copypasted from their docs. The package summary outlines the involved classes and contains examples. The Java 9 module name is jdk.httpserver.
0 Comments
Leave a Reply. |