Questions tagged [micronaut-rest]
85 questions
1
vote
1 answer
How to Mock a Declarative Client in Micronaut?
I have Class in which I call a method from a declarative client. But for my test I don't want it to call the actual URL. Instead I want to Mock it. How can I do that as it is not a class but an Interface annotated with @Client?
Example code:- here.…

Puneet
- 45
- 8
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

user3769960
- 91
- 1
- 5
1
vote
1 answer
What should be the return type of reactive controller methods in Micronaut?
I am new to Micronaut and looking at the samples I can't figure the right return type for controller methods. I need an API method that accepts a String, validates the input, fetches some data from database and returns ObjectA for successful…

dev
- 11,071
- 22
- 74
- 122
1
vote
1 answer
No bean of type [xxxx.xxxx.xxxx] exists. Make sure the bean is not disabled by bean requirements Micronaut messaging application
I have below project structure
The main project DEMO has a dependency on the Gradle project SERVICE which implements the interface from the PORT project.
Demo build.gradle
dependencies {
implementation project(':port')
runtime…

San Jaisy
- 15,327
- 34
- 171
- 290
1
vote
1 answer
Micronaut Reactive Streams: Emission rate is not maintained
I'm trying to test streaming a Flux with a delay of 1000 millis for each element.
@Get(value = "/carts/reactive", produces = MediaType.APPLICATION_JSON_STREAM)
public Flux getCartsReactive() {
return Flux.range(1, 10)
…

Anoop Hallimala
- 625
- 1
- 11
- 25
1
vote
0 answers
Route parameter in Micronaut declarative http client
I have an API gateway using the declarative Http client and trying to pass the route parameter to the other microservice application as below
@Client(id="feteBirdProduct", path = "/sub-category")
public interface ISubCategoryClient extends…

San Jaisy
- 15,327
- 34
- 171
- 290
1
vote
1 answer
Throw RabbitListenerException from the Listener method in Micronaut
I have a consumer exception handler in Micronaut as below
@Singleton
@Primary
@Replaces(DefaultRabbitListenerExceptionHandler.class)
public class RabbitListenerCustomExceptionHandler implements RabbitListenerExceptionHandler {
private static…

San Jaisy
- 15,327
- 34
- 171
- 290
1
vote
0 answers
Micronaut testing with declarative HTTP client Junit 5
Trying to do the Junit 5 E2E functional testing using Micronaut declarative HTTP client.
public interface IProductOperation {
@Get(value = "/search/{text}")
@Secured(SecurityRule.IS_ANONYMOUS)
Maybe> freeTextSearch(@NotBlank String…

San Jaisy
- 15,327
- 34
- 171
- 290
1
vote
1 answer
Custom Security Rules not working Micronaut 2.2.1
I am trying to implement the custom security rules with Micronaut 2.2.1, but it is not working.
public @interface RequiredPermission {
String resourceIdName();
String permission();
}
Security Rules
@Singleton
public class AdminRequirement…

San Jaisy
- 15,327
- 34
- 171
- 290
1
vote
0 answers
OAuth/OIDC in open api 3 with Micronaut swagger
I am trying to Authorize the API endpoint with identity OKTA from the Micronaut swagger definition.
Below is the configuration for the OKTA
micronaut:
application:
name: demo
security:
authentication: idtoken
oauth2:
clients:
…

San Jaisy
- 15,327
- 34
- 171
- 290
1
vote
1 answer
Validating the POJO record with Micronaut not working
Using Micronaut bean validation for the record class is not working
compile 'io.micronaut:micronaut-validation:2.2.1'
Record class
@Introspected
public record ProductViewModel
(
@JsonProperty("id")
String…

San Jaisy
- 15,327
- 34
- 171
- 290
1
vote
0 answers
Reactive and Non-Blocking Method Micronaut with apache kafka
I am trying to get the Non-Blocking response from the Micronaut kafka implementation, however the return value in not working.
public class ProductManager implements IProductManager{
private final ApplicationContext applicationContext;
…

San Jaisy
- 15,327
- 34
- 171
- 290
1
vote
2 answers
micronaut @RequestScope - not creating bean per incoming http-request
I have a class the following class as RequestScope bean:
@RequestScope
class RequestContext {
private String requestId;
private String traceId;
private String authorisedId;
private String routeName;
// few more fields
@Inject…

Sreerag
- 1,381
- 3
- 11
- 16
1
vote
0 answers
micronaut ssl: no netty_tcnative_windows_x86_64 in java.library.path
I am trying to configure SSL in micronaut application. I have configured the keystore and truststore and validated that certificates are valid. However while running the application I am getting below exception.
12:01:54.564 [main] DEBUG…

Not a bug
- 4,286
- 2
- 40
- 80
1
vote
1 answer
How do we know exact name of features and available features in Micronaut?
mn create-app my-project --features mongo-reactive,security-jwt
I found this on the official website of Micronaut. I would like to know how do I know the exact name of features and features supported by Micronaut.

vishal.kangralkar
- 113
- 10