Questions tagged [micronaut-client]

104 questions
1
vote
0 answers

Micronaut HTTP Client handeling empty parameters in GET requests

Micronaut declarative HTTP Client question I need to construct a GET request that looks like this: URL/index?xxx=42&singledatapoint&Unadjusted If I use MN’s declarative HTTP Client, like…
brianjohnsen
  • 145
  • 8
1
vote
1 answer

exceptionOnErrorStatus in ClientConfiguration of Declarative Client not being applied in Micronaut version 3.7.3

I have provided a configuration class to my Declarative HttpClient, to force throwing an exception on error (status>400), or maybe I misunderstood the exceptionOnErrorStatus configuration option. @Client(value = "/", configuration =…
Luis Muñiz
  • 4,649
  • 1
  • 27
  • 43
1
vote
1 answer

Micronaut keep data http response compressed

I am hitting a REST server that is exposing a GET endpoint with headers Content-Encoding = gzip and Content-Type = application/json, so the server compresses the data before sending the response. I am trying to make a sort of backup on S3 of…
1
vote
0 answers

Micronaut's HTTP client keeps throwing HttpClientResponseException even when disabled

I have a simple Micronaut 3.4.2 application. I'm trying to use the HttpClient to test some (HTTP) resources. I've disabled the default behavior for responses that throw HttpClientResponseException, but still, I'm getting that exception back no…
x80486
  • 6,627
  • 5
  • 52
  • 111
1
vote
1 answer

Spring's @WebMvcTest equivalent in micronaut

How can I run only controller in @MicronautTest without running repositories/services only mocking them like in spring @WebMvcTest do? @RestController @RequestMapping("/api") public class EmployeeRestController { @Autowired …
Andrew Sasha
  • 1,254
  • 1
  • 11
  • 21
1
vote
1 answer

how do I receive an empty response in micronaut declarative client?

I am sending a PATCH request to a server which gives me back a 200 and no body (perfectly acceptable) however I can't work out how to configure the micronaut @Patch annotation to deal with this. No matter what I try it tries to decode the empty…
shmish111
  • 3,697
  • 5
  • 30
  • 52
1
vote
0 answers

Read Timeout exception in Micronaut

I have a the below method calling 3rd Party client: public String fetchName() { Flowable response = client.retrieve(HttpRequest.GET(uri) .header(AUTH, getToken()), Map.class); return…
CoderHat
  • 33
  • 6
1
vote
1 answer

Exception stacktrace and cause not mapped to the custom global exception handling in Micronaut 2.5.8

Trying to handle the global exception handling in Micronaut, but the exception stack trace and cause are not thrown to the ExceptionHandler. public class GlobalException extends RuntimeException{ public GlobalException(Throwable…
San Jaisy
  • 15,327
  • 34
  • 171
  • 290
1
vote
0 answers

How to Mock a Client Interface in Micronaut for Server which is used in Server StartupEvent

I have a @Client annotated interface which is used to access a particular URL and fetch some data when my Application starts in a OnApplicationEvent(ServerStartupEvent event) method. The problem is when I use @Micronaut Test, it instantiates the…
Puneet
  • 45
  • 8
1
vote
1 answer

Micronaut java httpclient creation with the existing server

I have a Micronaut application running with the below configuration: micronaut: server: cors: enabled: true port: 8080 Now I have an enhancement where I want to call a 3rd party URL and get the response in my application (one of…
CoderHat
  • 33
  • 6
1
vote
1 answer

How to ignore (skip deserialisation) for a malformed LocalDate field in Kotlin?

I have the Micronaut Http Client with Kotlin which loads data from another micro service. The date formatting from this micro service is not valid sometimes. Example: normal pattern is dd-MM-yyyy, but when there is no date micro service returns it…
1
vote
1 answer

HttpClient throws null pointer exception in my class which extends MicronautRequestHandler

I am getting NullPointerException for httpClient in the code mentioned below: @Introspected public class CustomEventHandler extends MicronautRequestHandler, APIGatewayV2HTTPResponse> { private static final Logger LOGGER =…
1
vote
1 answer

Micronaut's HttpClient: event-loop-group, num-of-threads, thread-factory: how do they work in conjunction?

I come from the Spring Framework and now I'm on a micronaut project. I know very little about netty and its concepts yet and with that I have a doubt that the micronaut documentation is not clear to me. I'm in doubt about the settings…
Marlon Patrick
  • 2,366
  • 1
  • 18
  • 26
1
vote
0 answers

Micronaut's HttpClient: connection pool, connection-pool-idle-timeout and connect-ttl: how do they work in conjunction?

I'm in doubt about the settings below: micronaut.http.client.connect-ttl micronaut.http.client.connection-pool-idle-timeout I would like to understand: What is the purpose of the settings below? How do they differ? How do they work together? Are…
Marlon Patrick
  • 2,366
  • 1
  • 18
  • 26
1
vote
1 answer

Uploading multiple files to the MultipartBody using declarative client Micronaut

Trying to upload multiple files to using Micronaut declarative client. Http client @Client("http://localhost:8080/product") public interface IHttpClient { @Post(consumes = MediaType.TEXT_PLAIN, produces = MediaType.MULTIPART_FORM_DATA) …
San Jaisy
  • 15,327
  • 34
  • 171
  • 290