@FeignClient is not failing in Type Mismatch
up vote
0
down vote
favorite
I am intentionally trying to simulate a failure condition. I have a service which returns JSON of a User
object. However, in @FeignClient
@RequestMapping
I am returning another object i.e. Event
.
In this case, I was expecting Feign to fail deserializing the JSON to the Event
POJO. But it is not failing. Moreover, the response Event
object is also not null.
So my question is, is this the behavior by design? What I can do to make Feign fail in this kind of situation.
Here is my FeignClient.
@FeignClient(name = "userProxy", url = "${securei.url}")
public interface UserProxy {
@RequestMapping(value = IUser.USER_LOGIN, method = RequestMethod.GET, params = {"u", "p"})
public Event login(@RequestParam("u") String username, @RequestParam("p") String password);
}
Here the actual login service returns the User JSON, however I have provided Event as the return type. Still, it is not failing.
java spring spring-boot spring-cloud-netflix netflix-feign
|
show 2 more comments
up vote
0
down vote
favorite
I am intentionally trying to simulate a failure condition. I have a service which returns JSON of a User
object. However, in @FeignClient
@RequestMapping
I am returning another object i.e. Event
.
In this case, I was expecting Feign to fail deserializing the JSON to the Event
POJO. But it is not failing. Moreover, the response Event
object is also not null.
So my question is, is this the behavior by design? What I can do to make Feign fail in this kind of situation.
Here is my FeignClient.
@FeignClient(name = "userProxy", url = "${securei.url}")
public interface UserProxy {
@RequestMapping(value = IUser.USER_LOGIN, method = RequestMethod.GET, params = {"u", "p"})
public Event login(@RequestParam("u") String username, @RequestParam("p") String password);
}
Here the actual login service returns the User JSON, however I have provided Event as the return type. Still, it is not failing.
java spring spring-boot spring-cloud-netflix netflix-feign
1
Please provide the relevant part of your code. Add a Minimal, Complete, and Verifiable example including proper example input/output data.
– Bsquare
Nov 21 at 8:35
Please see my recent edit.
– Soumitri Pattnaik
Nov 21 at 8:42
Did you specify @EnableFeignClients somewhere?
– Bsquare
Nov 21 at 9:14
@Bsquare yes, I have the application class annotated with that.
– Soumitri Pattnaik
Nov 21 at 9:16
@Bsquare actually FeignClient works fine as it should be, It's just not failing.
– Soumitri Pattnaik
Nov 21 at 9:19
|
show 2 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am intentionally trying to simulate a failure condition. I have a service which returns JSON of a User
object. However, in @FeignClient
@RequestMapping
I am returning another object i.e. Event
.
In this case, I was expecting Feign to fail deserializing the JSON to the Event
POJO. But it is not failing. Moreover, the response Event
object is also not null.
So my question is, is this the behavior by design? What I can do to make Feign fail in this kind of situation.
Here is my FeignClient.
@FeignClient(name = "userProxy", url = "${securei.url}")
public interface UserProxy {
@RequestMapping(value = IUser.USER_LOGIN, method = RequestMethod.GET, params = {"u", "p"})
public Event login(@RequestParam("u") String username, @RequestParam("p") String password);
}
Here the actual login service returns the User JSON, however I have provided Event as the return type. Still, it is not failing.
java spring spring-boot spring-cloud-netflix netflix-feign
I am intentionally trying to simulate a failure condition. I have a service which returns JSON of a User
object. However, in @FeignClient
@RequestMapping
I am returning another object i.e. Event
.
In this case, I was expecting Feign to fail deserializing the JSON to the Event
POJO. But it is not failing. Moreover, the response Event
object is also not null.
So my question is, is this the behavior by design? What I can do to make Feign fail in this kind of situation.
Here is my FeignClient.
@FeignClient(name = "userProxy", url = "${securei.url}")
public interface UserProxy {
@RequestMapping(value = IUser.USER_LOGIN, method = RequestMethod.GET, params = {"u", "p"})
public Event login(@RequestParam("u") String username, @RequestParam("p") String password);
}
Here the actual login service returns the User JSON, however I have provided Event as the return type. Still, it is not failing.
java spring spring-boot spring-cloud-netflix netflix-feign
java spring spring-boot spring-cloud-netflix netflix-feign
edited Nov 21 at 8:53
asked Nov 21 at 8:30
Soumitri Pattnaik
1,29711029
1,29711029
1
Please provide the relevant part of your code. Add a Minimal, Complete, and Verifiable example including proper example input/output data.
– Bsquare
Nov 21 at 8:35
Please see my recent edit.
– Soumitri Pattnaik
Nov 21 at 8:42
Did you specify @EnableFeignClients somewhere?
– Bsquare
Nov 21 at 9:14
@Bsquare yes, I have the application class annotated with that.
– Soumitri Pattnaik
Nov 21 at 9:16
@Bsquare actually FeignClient works fine as it should be, It's just not failing.
– Soumitri Pattnaik
Nov 21 at 9:19
|
show 2 more comments
1
Please provide the relevant part of your code. Add a Minimal, Complete, and Verifiable example including proper example input/output data.
– Bsquare
Nov 21 at 8:35
Please see my recent edit.
– Soumitri Pattnaik
Nov 21 at 8:42
Did you specify @EnableFeignClients somewhere?
– Bsquare
Nov 21 at 9:14
@Bsquare yes, I have the application class annotated with that.
– Soumitri Pattnaik
Nov 21 at 9:16
@Bsquare actually FeignClient works fine as it should be, It's just not failing.
– Soumitri Pattnaik
Nov 21 at 9:19
1
1
Please provide the relevant part of your code. Add a Minimal, Complete, and Verifiable example including proper example input/output data.
– Bsquare
Nov 21 at 8:35
Please provide the relevant part of your code. Add a Minimal, Complete, and Verifiable example including proper example input/output data.
– Bsquare
Nov 21 at 8:35
Please see my recent edit.
– Soumitri Pattnaik
Nov 21 at 8:42
Please see my recent edit.
– Soumitri Pattnaik
Nov 21 at 8:42
Did you specify @EnableFeignClients somewhere?
– Bsquare
Nov 21 at 9:14
Did you specify @EnableFeignClients somewhere?
– Bsquare
Nov 21 at 9:14
@Bsquare yes, I have the application class annotated with that.
– Soumitri Pattnaik
Nov 21 at 9:16
@Bsquare yes, I have the application class annotated with that.
– Soumitri Pattnaik
Nov 21 at 9:16
@Bsquare actually FeignClient works fine as it should be, It's just not failing.
– Soumitri Pattnaik
Nov 21 at 9:19
@Bsquare actually FeignClient works fine as it should be, It's just not failing.
– Soumitri Pattnaik
Nov 21 at 9:19
|
show 2 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53407941%2ffeignclient-is-not-failing-in-type-mismatch%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Please provide the relevant part of your code. Add a Minimal, Complete, and Verifiable example including proper example input/output data.
– Bsquare
Nov 21 at 8:35
Please see my recent edit.
– Soumitri Pattnaik
Nov 21 at 8:42
Did you specify @EnableFeignClients somewhere?
– Bsquare
Nov 21 at 9:14
@Bsquare yes, I have the application class annotated with that.
– Soumitri Pattnaik
Nov 21 at 9:16
@Bsquare actually FeignClient works fine as it should be, It's just not failing.
– Soumitri Pattnaik
Nov 21 at 9:19