Avatar
0
Huu Tuyen Nguyen Beginner
gọi api theo route
Em muốn sử dụng Exchange trong đường đi của camel để gọi đến api rsClient

để nhận chuỗi data json, phần xử lý nằm ở Processor. Trong processor cần có đầu output để gửi cho https://gorest.co.in/public/v1/users vậy e cần dùng exchange để xét output như nào để có thể request tới api trên và nhận đc kết quả. E cảm ơn!

<cxf:rsServer id="restServer" address="/user"
loggingFeatureEnabled="true"
serviceClass="fis.integration.core.endpoint.UserEndpoint">
<cxf:providers>
<bean id="jsonProvider"
class="org.codehaus.jackson.jaxrs.JacksonJsonProvider" />
</cxf:providers>
</cxf:rsServer>
<cxf:rsClient id="getRestApi"
address="https://gorest.co.in/public/v1/users"
serviceClass="fis.integration.core.InterfaceService.UserEndpoint"
loggingFeatureEnabled="true">

</cxf:rsClient>

  • Answer
Remain: 5
1 Answer
Avatar
monkey Beginner
monkey Beginner
Cái chỗ này khả năng không được em ạ: address="https://gorest.co.in/public/v1/users" vì nó là cái api bên ngoài, nó không tuân theo chuẩn em đang dùng, nên anh nghĩ em phải tạo ra lớp service hoặc code luôn trong UserEndpoint và lấy dữ liệu về từ api đó sau đó trả cho LB em ạ.
  • 0
  • Reply