5.4.8. MicroProfile Rest 客户端代码中所需的更改
JBoss EAP 7.3 支持 MicroProfile REST 客户端的 1.3.x 版本。如果您使用的是之前版本的 MicroProfile REST 客户端,则需要在代码中进行一些更新。
重要
MicroProfile REST 客户端仅作为技术预览提供。技术预览功能不包括在红帽生产服务级别协议(SLA)中,且其功能可能并不完善。因此,红帽不建议在生产环境中使用它们。这些技术预览功能可以使用户提早试用新的功能,并有机会在开发阶段提供反馈意见。
如需有关技术预览功能支持范围的信息,请参阅红帽客户门户网站中的技术预览功能支持范围。
org.jboss.resteasy.client.microprofile.MicroprofileClientBuilderResolver
类替换为 org.eclipse.microprofile.rest.client.RestClientBuilder
。例如:
@Path("resource") public interface TestResourceIntf { @Path("test") @GET public String test(); } TestResourceIntf service = RestClientBuilder.newBuilder() .baseUrl("http://localhost:8081/") .build(TestResourceIntf.class); String s = service.test();
如需有关 MicroProfile REST 客户端的更多信息,请参阅 JBoss EAP 开发 Web 服务应用指南中的 MicroProfile REST 客户端。