Questions tagged [micronaut-rest]
85 questions
0
votes
1 answer
Configuring default micronaut httpClient properties using ConfigurationProperties
I am writing a java library module in Micronaut which has an httpClient. The idea is that my microservices will use this library as a jar dependency and use the httpClient.
Problem Statement : I want to configure my HttpClient without using…

Shrinath
- 534
- 10
- 18
0
votes
2 answers
How to pass the value to the AuthenticationProvider from HttpRequest in Micronaut java with Jnunit 5
Using Micronaut HttpClient to perform the HTTP calls in Junit 5 testing.
I am trying to pass the value to AuthenticationProvider using HttpRequest as below
@MicronautTest
public class ProductCreateTest extends TestContainerFixture {
@Inject
…

San Jaisy
- 15,327
- 34
- 171
- 290
0
votes
1 answer
Authentication null with JUnit 5 testing Micronaut 3.3.4
Trying to protect the controller with micronaut security using JUnit testing, getting authentication as NULL.
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
@MicronautTest
public class ProductCreateTest extends TestContainerFixture {
…

San Jaisy
- 15,327
- 34
- 171
- 290
0
votes
1 answer
Rest end point unit testing using JWT token validation in Micronaut
Using micronaut to create rest end-point which is protected by using micronaut-jwt security
@Post
@IRequirement(resourceName = ClaimType.TAG_PRODUCT, permission = {ClaimValue.TAG_OWNER,ClaimValue.TAG_CREATOR,ClaimValue.TAG_MAINTAINER…

San Jaisy
- 15,327
- 34
- 171
- 290
0
votes
0 answers
Here I am trying to do a simple CRUD operation using micronaut microservices. But getting some errors
I am trying to do some crud operation using micornaut microservices in java.
But getting this error, Please if anyone can help me out.
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.625 s <<< FAILURE! - in…
0
votes
1 answer
Adding headers to incoming request in Micronaut filters
I am writing a service that, for now, will need to implement its own validation of JWT tokens. This will later be handled by a layer before the services.
To do this, I intended to intercept requests using HttpServerFilter…

jokarl
- 1,913
- 2
- 24
- 52
0
votes
1 answer
Returning error from reactor Flux goes infinite
I have updated the Micronaut application from 2.5.XX to 3.0.0. As per the Micronaut documentation, the project reactor is the recommended reactive library to use for reactive programming.
@Controller("/product")
public class ProductController…

San Jaisy
- 15,327
- 34
- 171
- 290
0
votes
1 answer
Grails with micronaut-elasticsearch plugin
I am migrating a project form
grails 3.0.3 and elasticsearch 1.7.3 to
grails 4.0.4 and elasticsearch 7.13.
Unfortunately, the elasticsearch-groovy-plugin is not actively maintained and it seems, that the best option is to switch to…

boraas
- 929
- 1
- 10
- 24
0
votes
1 answer
Micronaut multipart upload - error: "Required argument [CompletedFileUpload] not specified"
I'm trying to upload a multipart file using Micronaut without success.
I'm receiving 400 status code with message: "Required argument [CompletedFileUpload file] not specified".
curl -v -F "file=@image.jpg" localhost:8080/test/param1/param2
How can…

Idemas
- 39
- 5
0
votes
1 answer
Micronaut's netty server http request missing headers
I'm trying to integrate custom authentication service with micronaut security and to do this I've implemented my own AuthenticationProvider and that works fine for basic auth, however I also need to take care of authentication tokens passed in the…

user51010
- 93
- 1
- 7
0
votes
2 answers
Environment based file pickup in Micronaut
Trying to use the different configuration files based on the environment. For example
In the dev environment, I have the below file
application-dev.yml
micronaut:
security:
enabled: true
token:
jwt:
enabled: true
…

San Jaisy
- 15,327
- 34
- 171
- 290
0
votes
0 answers
Micronaut security with OKTA - OAUTH 2.0
I have a Micronaut rest endpoint which is secured by @Secured(SecurityRule.IS_AUTHENTICATED)
@Secured(SecurityRule.IS_AUTHENTICATED)
@Controller("/product")
@Secured({"Admin"})
public record ProductController(IProducer iProducer) {
@Get(uri =…

San Jaisy
- 15,327
- 34
- 171
- 290
0
votes
1 answer
Mapping the RabbitListenerExceptionHandler with the Micronaut Global ExceptionHandler
I am trying to handle the exception thrown from the Rabbit Listener and expose the error to the Rest endpoint.
Rabbit Listener
@Queue(ProductTopicConstants.GET_PRODUCT)
public ProductViewModel find(String id) {
try {
…

San Jaisy
- 15,327
- 34
- 171
- 290
0
votes
1 answer
Failed to convert argument [model] for value [null] due to: Cannot construct instance of `view.model.product.ProductViewModel`
I am using Java 15 record feature with Micronaut 2.2.1, the serialization is not working
{
"message": "Failed to convert argument [model] for value [null] due to: Cannot construct instance of `view.model.product.ProductViewModel` (no Creators,…

San Jaisy
- 15,327
- 34
- 171
- 290
0
votes
1 answer
Handling Consumer Exceptions Rabbit MQ Micronaut 2.2.1
Trying to implement the Handling Consumer Exceptions in Micronaut 2.2.1 https://micronaut-projects.github.io/micronaut-rabbitmq/latest/guide/#consumerExceptions
As per the documentation
If the consumer bean implements RabbitListenerExceptionHandler,…

San Jaisy
- 15,327
- 34
- 171
- 290