Questions tagged [micronaut]
Micronaut is a JVM framework for building web applications with a strong focus on microservice applications.
0
votes
1answer
11 views
Micronaut Delete Annotation not creating endpoint
I have the following controller using @Endpoint
import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
import io.micronaut.http.annotation.Body
import io.micronaut.http.annotation....
-3
votes
1answer
10 views
I'm looking for a way to add a handler to Netty in Micronaut
I need to build an ODATA API and am Considering using Micronaut, would like to install a handler in Netty.
Such as https://github.com/apache/olingo-odata4/tree/master/lib/server-api/src/main/java/org/...
0
votes
0answers
15 views
Micronaut Lambda with proxy can't unmarshal object from json body io.micronaut.web.router.exceptions.UnsatisfiedRouteException
In a Micronaut Lambda with proxy integration I have a controller that should unmarshal JSON content into a Ping object:
@Controller("/ping")
class PingController {
private val logger = ...
0
votes
0answers
13 views
Is it possible to access the whole request information in a Micronaut Lambda with proxy integration?
I have developed a Lambda function with Micronaut using proxy support.
I needed to access a header value so I wild guessed I could use a @Header param and it worked:
@Controller("/ping")
class ...
1
vote
1answer
11 views
how to create customized annotation in micronaut?
how to create customized annotation and implement logic for it in micronaut just like @JmsListener in spring ?
@Component
public class ArtemisCusumer {
@JmsListener(destination = "someQueue")
...
2
votes
1answer
37 views
How to create a CRUD API on Amazon Lambda using Micronaut
I want to create a CRUD API using Micronaut and deploy it on AWS Lambda, exposing the different methods with Amazon API Gateway. I could create different Kotlin Projects per endpoint (GET, POST...), ...
0
votes
1answer
26 views
Vaadin - Micronaut integration
I am selecting a new technology for my team. I would like to use Vaadin in some situations but I would like to reduce the number of technologies that my team needs to assimilate. Is it technically ...
0
votes
1answer
17 views
How to configure object mapping for MongoDB with Micronaut and Kotlin + KMongo?
I'm having some difficulty configuring object mapping for MongoDB in Micronaut with Kotlin. I'm getting errors like:
Decoding into a 'Asset' failed with the following exception:
Cannot find a ...
0
votes
1answer
38 views
how to define Bean to `RestTemplate`?
I am trying to use RestTemplate from Spring-client.
I cannot use RestTemplate because this class hasnot bean.
public BusinessBankingTemplate(RestTemplate restTemplate) {
this.restTemplate = ...
1
vote
1answer
25 views
Micronaut's Framework with error `Path Taken`
I am trying to create a scheduler as the guide from this link.
I am stuck and getting this error.
Message: org/springframework/core/log/LogDelegateFactory
Path Taken: new TransactionCheckerJob([...
0
votes
0answers
28 views
Proper means to start an asynchronous helper thread (or callback) in micronaut
I would like to receive real-time callbacks from a service like Google's PubSub and then serve these messages with a Micronaut service - i.e., make the messages available to someone who requests a ...
-1
votes
1answer
35 views
What is @AuthenticationPrincipal alternative for micronaut?
I'm trying to get UserDetails object like below. But, I have some difficulties and impossible to get UserDetails object, so there is only JSONObject in authentication.getAttributes(). Is there any ...
0
votes
0answers
37 views
Micronaut for spring JPA Exception
If I take micronaut for spring on a project with JpaRepository:
@Repository
public interface GreetingRepository extends JpaRepository<Greeting, Long> {
}
I got an error:
Message: No bean of ...
1
vote
0answers
17 views
is there any AWS handler for micronaut app?
I am trying to deploy my application to AWS Elastic Beanstalk and get stuck on database connection.
I already create DB Instance, DB Cluster and i already setting up the Environment's variable like ...
0
votes
1answer
32 views
unable to mock clientmethod returning Single<? extends HttpResponse> using Mockito
I'm building a microservice using Micronaut. This particular service depends on a automatically generated client from another service, that I'd like to mock in my component tests.
However I'm unable ...
0
votes
1answer
24 views
Command line runner for Micronaut
Is there a way to use Micronaut to create a command line application? I mean something similar to Spring Boot command line runner as described here: https://www.baeldung.com/spring-boot-console-app
...
1
vote
1answer
20 views
Debugging in Intelij works through the test spec but not directly through the main code
In an existing micronaut service profile application I added the picocli dependencies, and created a command and a command test spec. When I debug the command through Intellij, the annotated variables ...
0
votes
1answer
19 views
Micronaut cli graphql setup
Is it possible to pass a feature to micronaut cli to integrate a new application with graphQL, for example like this:
mn create-app -f grephql name
0
votes
1answer
47 views
Can micronaut log access logs with logback?
I'm trying to setup access-logs in micronaut, but, as logback-access library uses a servlet filter, I don't see a straight-forward way to do it.
Is there a different solution? Some hidden Micronaut ...
-1
votes
0answers
26 views
Relation between private key , public key and keystore
I have created with keytool a private key file("privatekey.store") and public key file("publickey.store") but in my project i have to mention in configuration the key-store and the trust-store
I didn'...
1
vote
0answers
45 views
REST call example from Micronaut documentation returns error
The example below should process a JSON body reactively by transforming it into a POJO and processing it with a .map() function. However, I get an error on my controller application. Googling the ...
0
votes
0answers
31 views
Can't load application.yml properties in bean constructor [closed]
When trying to configure a bean annotated with @Singleton by using application.yml properties, these properties show 'null' when trying to access them from within a constructor. However, when calling ...
1
vote
1answer
30 views
Why do I receive an error when I consult data in my Micronaut Gorm application?
I have a simple application in Mironaut with three entities, Customer, Contact and Loans.
Customer has a 1 to many relationship with Contact and Loans. I test with Grails / Gorm and it works fine.
I ...
0
votes
1answer
29 views
Micronaut - Configure postgres datasource
I am trying to configure the postgres datasource using micronaut-hirari. I am trying to add some postgres specific (reWriteBatchInserts) data source properties:
datasources:
default:
url: jdbc:...
0
votes
0answers
10 views
Micronaut Swagger Groovy not generating openapi yaml file
I am using Micronaut 1.0.3 with Groovy language. based on this document https://docs.micronaut.io/latest/guide/index.html#openapi created groovy code.
import io.micronaut.runtime.Micronaut
import ...
0
votes
1answer
49 views
How can a stream of data from JPA be streamed with micronaut?
I am currently starting to work with micronaut and kotlin. I have JPA query that results in about 1 million results.
These results i want to stream from this one micronaut service to another.
My ...
0
votes
0answers
41 views
How to use @Parameter in Micronaut?
I'm trying to inject a dependency with micronaut's DI container and would like to use a constructor with arguments/parameters for a bean. I read about the annotation @Parameter, but do not understand ...
0
votes
1answer
33 views
How can I check the type of a parameter implementing an interface?
I am using dependency injection to inject an implementation of an interface. I would like to make it possible to call a method on the injected type with a parameter whose implementation is also being ...
0
votes
1answer
76 views
Is there with micronaut a way to have the “Spring Data JPA” repository autogenerated from an interface like in spring?
Im setting up a new micro service with micronaut and want it to access a database over jpa/hibernate.
Is there an easy way to have the "Spring Data JPA" repositories implementation to be ...
1
vote
1answer
35 views
Micronaut: Authentication Principal generated into request body
I'm trying to generate client code with swagger-codegen from a Micronaut server. The problem arises with authenticated POST and PUT routes (it works fine for GET an DELETE).
When I have a method like ...
0
votes
1answer
11 views
does micronaut have ablity to connect to artemis which suport “amqp/mqtt” protocol just like rabbitmq?
i want to use artemis as message broker.
is there any client library to support that in micronaut ?
just like rabbitmq blow.
<dependency>
<groupId>io.micronaut.configuration</...
1
vote
0answers
28 views
how to sending byte array[] on client and receiving on server? [closed]
The code below is virtual code. How ca I make it work in real code?
The byte[] is encrypted data by DES algorithm.
Sender.java
@Client("/submit")
public interface Sender {
@Post(consumes = ...
0
votes
2answers
28 views
Micronaut HttpClient: Correct way to handle spaces in URIs
I am using micronaut 1.0.3 with Java8. I am trying to understand when and how encoding is required for HttpClient.
First Problem:
When I use HttpClient with spaces in the URI, I get an error: java....
0
votes
1answer
32 views
Micronaut - Get Running environment name in the view
I have a small Micronaut application with a view layer (thymeleaf). Now I want to integrate Google Analytics or some other tracking tool. Of course this should be just loaded in production mode but ...
1
vote
0answers
82 views
How to inject beans and create custom beans in Micronaut cli application
I want to inject beans in micronaut cli application
Example: Below is my Command Class
@command(name = "com/utils", description = "..",
mixinStandardHelpOptions = true, header = {..})
public class ...
0
votes
1answer
28 views
Micronaut does not generate OpenAPI YAML with query parameters
Running latest version of Micronaut (1.0.3) and including Swagger dependencies generates the OpenAPI YAML file. However, it does not include the parameters for query string even when supplying Swagger'...
0
votes
1answer
82 views
How to load css file in Micronaut using Thymeleaf?
How to load a CSS file in Micronaut using Thymeleaf?
Here is my index.html contents:
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf....
0
votes
1answer
58 views
Configure Cassandra with micronaut framework from yaml
I'm using micronaut framework and I'm trying to configure cassandra data access from application.yml
For a standard test use case I'm able to configure the datastax driver
cassandra:
default:
...
0
votes
2answers
64 views
Loading @Singleton Beans from external jar
I'm trying to load into my micronaut CLI application (cli.jar) some classes from an external jar, annotated with @singleton in hope that they will be injected in the application. That doesn't happen, ...
0
votes
1answer
79 views
Micronaut automatic conversion of HTTP request parameters
I am currently struggling trying to setup micronaut in order to automatically convert parameters from the http request uri into pojos.
Specifically I want to achieve something like that:
@Controller
...
0
votes
0answers
81 views
NoSuchBeanException for MapStruct generated classes in Micronaut
When generating mapper-implementations with MapStruct, using "jsr330" componentModel, micronaut will throw a NoSuchBeanException during runtime when trying to inject those.
A workaround would be to ...
1
vote
1answer
68 views
How to Revoke JWT Authentication via Cookie?
i am trying to test JWT Authentication using Micronaut.
i read from this guide, this guide is working, but i still not get it at all.
for example, when user A using username sherlockto login and ...
0
votes
1answer
58 views
Micronaut property injection to class members not working
I can't figure out what I'm doing wrong in the following groovy controller.
The @Value and @Property annotations before the class members g2gApiKey2 and g2gApiKey3 are not being set.
However the @...
2
votes
0answers
54 views
Is Micronaut mishandling the request content-type header?
Given this simple controller, it appears Micronaut is rejecting requests with a "415 Unsupported Media Type" based on the request's content type header on a GET request.
@Controller
class ...
0
votes
0answers
51 views
Sending back an HttpResponse.notFound() results in exception HttpClientResponseException
I have a simple controller:
@Validated
@Controller(value = "/api/issues")
class IssueController(private val service: IssueService) {
private companion object : KLogging()
@Get(value = "/{issue-...
0
votes
2answers
101 views
Micronaut Configure micronaut-jdbc-tomcat Data source for MySQL
In Development I am using below configuration to connect to MySQL database. I like to use Tomcat Data source for MySql Connection. Didn’t find example in the Micronaut document page.
What change ...
2
votes
1answer
75 views
Micronaut not Failfast
I am trying my hands on Micronaut. One of the things I noticed is that Micronaut doesn't failfast.
For example If I have something like this in my bean
@Value("${my.url}")
private String url;
...
3
votes
0answers
48 views
How to create a micronaut AWS Lambda function triggered using an S3Event?
I looked at the micronaut documentation at https://docs.micronaut.io/latest/guide/index.html#functionBean and all examples assume events are coming from API Gateway and the request body is sent out as ...
-1
votes
1answer
55 views
Micronaut JSON post strip the Quotes
In Micronaut Controller parsing the post request using JSON object. I expect it to not include quotes, but it quotes in the database insert.
Posting like this:
curl -X POST --header "Content-Type: ...
1
vote
1answer
63 views
Reactive approach/types in Micronaut for RESTful APIs
I'm not quite clear about these reactive types when dealing with RESTful APIs.
My understanding is that non-reactive request/responses are made of either simple POJO types or the String type. On the ...