Reputation: 107
i'm stuck in something that is going me crazy.
I'm creating an application which exposes some APIs and map each of these API to some external API, so basically my app is a passtrough. The operation is a post which actually works, but here is where the magic happens. So basically my API takes as input a POJO class, which is gonna be called ObjectIN, a processor makes some transformation and send to an external api (not mine) a different POJO called ObjectOUT.
The api is an insertion of an order into a db on the second API environment. Now, i'm testing the case where i'm sending the same payload as input body twice, so i'm expecting a 500 from the 2n API since the order has already been inserted, but if my application sends the insert1 and then the insert2 i got 202 in both cases from the 2nd API. If i make a direct curl on the 2nd API with the same identical body the 1st works returns 202 while the second one return 500 as expected.
I can't really understand what's going on and since i do not handle the 2nd api i'm kinda blind. I think this can be something related to the json that is passed but i normally use a marshal before sending to the .to(2ndAPI) field on my DSL and further the insertion works fine in both cases so the backend of the 2nd api can understand and unmarshal my processed body.
Any suggestions? I can also copy the code but i really tried out pretty everything on my side.
Upvotes: 0
Views: 58