Questions tagged [micronaut]
Micronaut is a JVM framework for building web applications with a strong focus on microservice applications.
1,728
questions
0
votes
0
answers
14
views
micronaut declarative client fail to parse json response
I'm using a declarative http client for testing APIs.
The interface clarification is as below.
@Client("/iceberg/v1")
public interface TestClient {
@Get("/namespaces")
...
0
votes
0
answers
35
views
How to Upload files to Azure Blob Storage using Micronaut?
How can we upload/downlaod files to/from Azure Blob Storage using Micronaut Object Storage API?
From this site, we can see the gradle implementation. But there is no samples available for Micronaut.
...
0
votes
0
answers
24
views
Unable to get MicronautTest to work with a POST against the HttpClient
I'm implementing a web API as a micronaut service. I have tests against the GET endpoints working, but cannot get the POST endpoints working correctly. I receive an error response 'BAD REQUEST'. The ...
1
vote
0
answers
31
views
Global transaction event handling in Micronaut 3
I want to register a global transaction before commit event handler on Application startup. What is the best way to do this?
I tried @TransactionalEventListener annotation but this requires a call to ...
0
votes
1
answer
36
views
Micronaut multi module project - Error instantiating bean of type [XXX]
I am creating my first micronaut gradle multimode application
Project structure
Root project 'finance'
+--- Project ':application'
\--- Project ':main'
root build.gradle.kts
plugins {
id("...
0
votes
0
answers
10
views
Compilation Error in Micronaut Data Repository with Kotlin Interfaces for Hibernate Reactive Entities
I'm encountering a compilation error when defining Kotlin interfaces for my Hibernate Reactive entities and using Micronaut Data repositories. The error occurs specifically when implementing the ...
0
votes
0
answers
12
views
Recommend me ways to route my PDF file to another service
I am writing a backend code in kotlin/micronaut. The scenario which I am facing is that my backend will recieve a PDF file from client and I have to redirect that PDF file to another endpoint(This ...
0
votes
0
answers
18
views
I want to integrate micronaut functionality in sample oneM2M project and to calculate the execution time of the functions
I am not to integrate micronaut in sample oneM2M osgi project .I want to calculate the execution time of the functions using micronaut,but micronaut is running as a seperate application. But not with ...
0
votes
1
answer
91
views
+50
WebSocket connection attempt not interrupted by Flux timeout in Micronaut
I am encountering an issue while working with WebSocket connections in Micronaut 3.9.0. I am attempting to set a timeout for the WebSocket connection, and despite my efforts, the timeout doesn't seem ...
0
votes
1
answer
30
views
Micronaut Docker issue with httpClient
Facing issues with read timeout and slow HTTP responses when running my Micronaut application as a docker Container. The application is hitting another rest API using HTTPClient ( tried both ...
1
vote
1
answer
61
views
Do I need a background job to consume messages from Kafka?
Is it necessary to run a background job to continuously consume messages from Kafka's topic?
I'm trying to write an application using Micronaut in Kotlin as Kafka Consumer, is there any way to consume ...
0
votes
1
answer
54
views
How to use json naming strategy in @Serdeable annotation
I have upgraded my Micronaut application to 4.1.6 and from then i'm facing serialization & deserialization strategy issue. With the older version of micronuat i'm able to get the snake-case ...
0
votes
0
answers
29
views
Create generic MicronautRequestHandler to handle any AWS Event and APIGatewayProxy request
I am trying to create Micronaut AWS-Lambda application to handle and support any AWS Event processing in addition to APIGatewayProxy request using MicronautRequestHandler.
Basically the challenge is, ...
0
votes
1
answer
55
views
Micronaut Object Storage - How to implement Micronaut Object Storage for AWS and Azure(with out Aws/Azure package)
How can we implement Object Storage service for both AWS S3 and Azure Blob Storage using Java Micronaut.? Found a git rep: https://github.com/micronaut-projects/micronaut-object-storage, but difficult ...
0
votes
0
answers
13
views
Excluding child class schema in Swagger documentation
I am working with Swagger/OpenAPI annotations in Java to document my API, and I have a scenario where I want to exclude schema from a child class in the generated Swagger documentation. Here's a ...
0
votes
0
answers
28
views
Micronaut redirect user to dashboard after login
Currently, the login-success property as per the documentation, accepts a String.
I want to redirect a user to their dashboard after login
/user/{id}/dashboard
How can I make it so that the user is ...
1
vote
1
answer
16
views
Micronaut 4, KSP, AllOpen: Need to add explicit `open` to the method
I'm attempting to port a Micronaut 3 app to Micronaut 4, but the allOpen seems to have mysteriously stopped working. I can add open to the class and function definitions and things work as designed. ...
0
votes
0
answers
20
views
Mockk, Kotest - How to test reactive subscribe onError callback?
I have this simple function calling http request
override fun refreshDocument(
investmentIntermediary: InvestmentIntermediary,
receivedDocumentUuid: String
) {
if (...
0
votes
0
answers
21
views
How to change redirect location in micronaut ProxyHttpClient and HttpServerFilter
I'm using ProxyHttpClient in HttpServerFilter to proxy requests to another service as described in documentation https://docs.micronaut.io/latest/guide/#proxyClient . Works fine, but in some cases ...
0
votes
0
answers
19
views
Micronaut Redis Test Resources not working
I am not able to get Test Resources (Redis) running in our project.
I am not able to find the problem in a couple of days. I started a new minimal project to identifier and isolate the problem, which ...
0
votes
0
answers
39
views
Yaml dependency error with micronaut app start up
How to resolve the error. I am not sure which snake yaml dependency can resolve the micronaut project start-up error.
2023-11-02 22:36:41 ERROR i.m.r.Micronaut(handleStartupException):338 - Error ...
0
votes
0
answers
20
views
Micronaut: How can I use serialization inclucion ALWAYS with Micronaut Serialization?
How is it possible to configure the Micronaut Serde objectMapper to include all properties when serializing, and not just the non-null values?
For Jackson the similar code looks like this:
new com....
0
votes
0
answers
38
views
Micronaut: JsonProperty missing in OpenAPI Generator for serializationLibrary micronaut_serde_jackson
We are generating Micronaut code from OpenApi files using the OpenApi Generator. When using Jackson as a serialization library this works fine, but when we try to switch to Micronaut Serialization and ...
0
votes
0
answers
16
views
Micronaut: No bean of PrimaryRepositoryOperations found
Expected Behavior
Micronaut R2DBC should run without any PrimaryRepositoryOperations bean being missing.
Actual Behaviour
I have a project that uses micronaut data r2dbc with postgresql with the ...
0
votes
0
answers
20
views
Google Oauth with Micronaut
I currently have an app that has a mobile app frontend (Kotlin) with micronaut as the backend. I want to implement Google OAuth on the backend. Would I send the authorization code that the mobile app ...
0
votes
0
answers
60
views
micronaut httpclient is replacing ampersands and equal signs in my url, but I dont want it to
Short Version
after reading the httpclient logs, I'm seeing that some characters are being url-encoded. I dont want that to happen.
Long Version
the url I'm calling is split into <base url>+<...
0
votes
0
answers
25
views
Error handling in controller with reactor and micronaut
In this controller I'm trying to catch an exception called RedisException.class which is thrown from messageService and instead return a http response 503 to the user.
MessageService method signature ...
1
vote
0
answers
32
views
How to handle size issue in feign.okhttpclient
I have an API declared in MicroNaut and writing component-tests for it. For this purpose, I have declared a APIHelper which is an interface and have definitions for all the api and initiate it using:
...
0
votes
0
answers
22
views
micronaut error reading application yml file
We have updated micronaut from version 3.8.7 to 4.1.1.
We have included this conf in the application yml:
inbound:
validations:
FIELD_ONE:
description: Check bla bla bla
type: BASIC
...
0
votes
0
answers
91
views
org.testcontainers.ext.ScriptUtils$ScriptLoadException: Could not load classpath init script with Micronaut project using Test-Resources
I am stuck on this since two days, while I am trying to implement the Test-resources capability of Micronaut framework.
Here is the content of my application-test.properties :
datasources.default....
0
votes
0
answers
43
views
Unable to generate a POST endpoint in Micronaut from OpenAPI
I am trying to use openapi-generator with Micronaut but the build fails with:
warning: Error:
Cannot invoke "String.equals(Object)" because the return value of "io.swagger.v3.oas....
0
votes
0
answers
38
views
Request body failure in Micronaut OpenAPI server generation
If I uncomment the requestBody section of the following OpenAPI specification:
paths:
/rentals:
post:
tags:
- rentals
operationId: create
# requestBody:
# content:...
0
votes
1
answer
24
views
Obtaining a request attribute in an OpenAPI-generated controller in Micronaut
I've generated a controller in Micronaut from an OpenAPI spec, but it's missing a way to access to the attributes in the request object. Consider the following OpenAPI spec:
...
paths:
/api/auth/...
0
votes
0
answers
30
views
Spock unit test MockBean is not working on Micronaut 3 RequestScope bean
My project runs on micronaut 3, and I am trying to run test cases with Spock framework. Here is the dependencies and plugins I have added for test cases:
plugins {
id("groovy")
// ......
0
votes
0
answers
13
views
Micronaut Hibernate JPA MariaDB - saveAll 20K data High CPU usage
I am using Micronaut Hibernate JPA, and MariaDB as database in my project. I use JPA repositories for database transactions. I receive lots of data (20K-100K) each second and I need to save them to a ...
0
votes
0
answers
19
views
heroku not registering system.properties
im developing gradle micronaut app
during deployment i see
-----> Installing OpenJDK 1.8... done
which causes errors
i've declared a system.properties file in project root folder containing single ...
0
votes
0
answers
47
views
Multitenancy in micronaut java
If I hit the post method I got the error Internal Server Error: No GORM implementations configured. Ensure GORM has been initialized correctly
In MultiTenantResolver, resolveCurrentTenantIdentifier is ...
0
votes
0
answers
108
views
Micronaut test @MockBean not working for AWS S3Client
I have been trying to test a service class which has S3Client as dependency. When I'm running the test getting below error.
Error:
Groovyc: Error generating bean definition class for dependency ...
0
votes
0
answers
36
views
Bean Injection Issue from dependency jar for micronaut
I have a common modules that defines caffiene-cache for us like
@Factory
public class CaffeineCacheFactory {
@Value("${cache.max.size}")
private long maximumSize;
@Value("$...
0
votes
1
answer
35
views
@PropertySource for different yaml files in Micronaut
I'm working on Micronaut 4.1.3 and I can't use @PropertySource in getting the value of yaml file aside from application.yml / .properties.
@PropertySource("classpath:new.yaml")
public class ...
0
votes
0
answers
80
views
micronaut 4 org.hibernate.HibernateException: Could not obtain transaction-synchronized Session for current thread
After I upgraded my project to micronaut 4 I am getting the error:
org.hibernate.HibernateException: Could not obtain transaction-synchronized Session for current thread
when calling: ...
0
votes
0
answers
56
views
How can I add a custom annotation in Micronaut for tests
How can I add a custom annotation to be used only in test classes that use Spock in a Micronaut application? For example, @Sql, which could receive a list of SQL script paths? Even though I have ...
0
votes
1
answer
90
views
Micronaut Micrometer Opentelemetry integration
I'm migrating a micronaut-based service that currently users micrometer and opentracing with a statsd exporter to send information to datadog to user opentelemetry instead and send the traces and ...
0
votes
0
answers
30
views
How to reuse traceId from incoming request?
I want to trace spans across multiple services, but I don't know how to reuse/import incoming traceId. If I use @NewSpan annotation, it generates a new traceId, if it is first in the request.
If there ...
0
votes
0
answers
74
views
Why is my Java LocalDate being saved as the Previous Day inside Postgres?
Summary
If I create a Java LocalDate object (ex: "2023-09-28") and save it to my Postgres db the previous day gets stored (ex: "2023-09-27").
The stored database value is always 1 ...
0
votes
0
answers
97
views
error: Public method inherits AOP advice but is declared final. Micronaut 4
During my upgrade to micronaut 4, the data classes with the annotation
io.micronaut.configuration.hibernate.jpa.proxy.GenerateProxy
Cause build error:
error: Public method inherits AOP advice but is ...
0
votes
1
answer
75
views
Getting "Incompatible types: HibernateProxy and ErrorRowError" when upgrading to Micronaut4
I am upgrading our application to Micronaut 4 (from 3).
Their guide states we have to migrate from javax to jakarta.
Here is one of the classes that is causing the error (kotlin):
import java.util....
0
votes
1
answer
133
views
Micronaut deserialize into LocalDateTime
I've got a request body class that looks like this:
import com.fasterxml.jackson.annotation.JsonFormat;
import io.micronaut.serde.annotation.Serdeable;
import jakarta.validation.constraints.NotNull;
...
0
votes
0
answers
144
views
Could not resolve io.micronaut.gradle:micronaut-gradle-plugin:4.0.3
After creating new application on https://micronaut.io/launch/.
I cannot run it due to exception:
A problem occurred configuring root project 'delivery-tracker-service-v2'.
> Could not resolve all ...
0
votes
0
answers
44
views
How to return type of Stream of Objects with a Micronaut Repository
I am trying to return a Stream instead of a Collection<> in a repository method written with the micronaut framework.
Documentation says this is supported and to do 2 things:
Make the method ...