我处于向我的应用程序发送多个REST请求的情况,这些请求由我使用Rest操作编写的Apache Camel Route处理。
我希望我的请求以这样的方式进行同步,即路由在存在多个请求时一次只能处理1个请求。通过路由完成1个请求后,仅应处理下一个请求。
下面是我的示例骆驼路线
rest("/ticket/v1").description("To update a ticket.")
.patch()
.param()
.name("id").type(RestParamType.path).description("The ticket ID").dataType("integer")
.endParam()
.produces("application/json")
.consumes("application/json")
.type(TicketRequest.class)
.outType(TicketResponse.class)
.responseMessage().code(200).message("Ticket updated successfully").endResponseMessage()
.responseMessage().code(400).message("Bad Request, please see associated message response").responseModel(Response.class).endResponseMessage()
.responseMessage().code(500).message("Failed to update trouble ticked due to server internal error").responseModel(Response.class).endResponseMessage()
.to("direct:updateTicket");
谢谢你。
让REST服务同步工作真的有意义吗?我的意思是,对请求进行排队。