I'm have a @FeignClient in my app:
@FeignClient(name="${mongo.service.id}", url="${mongo.service.url}")
public interface MongoCustomerClaimInterface {
@GetMapping(path = "/api/customerClaim/countClaims/{businessDate}")
List<TransactionClaimStatusData> countClaimsByStatusToBusinessDate(
@PathVariable @DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
LocalDate businessDate);
}
I call the feign method and passing it a formatted LocalDate variable, and printing it to the log:
LocalDate businessDate = getBusinessDate();
LocalDate formattedDate = LocalDate.parse(businessDate.toString(),
DateTimeFormatter.ISO_DATE);
log.info("formattedDate: " + formattedDate);
claimStatusDataList = mongoCustomerClaimInterface.countClaims(formattedDate);
The call generates 404 error and log:
2020-24-02 18:10:25.433 INFO DashboardServiceImpl - formattedDate: 2020-02-23
2020-24-02 18:10:25.440 DEBUG
RequestMappingHandlerMapping:
Looking up handler method for path /api/customerClaim/countClaims/2/23/20
RequestMappingHandlerMapping:
Did not find handler method for [/api/customerClaim/countClaims/2/23/20]
Although I pass a date in the format yyyy-mm-dd so it will match:
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)- Feign somehow changes the date and then no matching url is found
How can I prevent Feign from doing this and configure a uniform formatter?