Questions tagged [micronaut-client]
104 questions
0
votes
0 answers
Request/Response Pattern with Micronaut AMQP
I am trying to perform Request/Response Pattern with Micronaut AMQP, with below diagram
Producer
@RabbitClient(ProductTopicConstants.FETE_BIRD_EXCHANGE)
@RabbitProperty(name = "replyTo", value = "amq.rabbitmq.reply-to")
public interface…

San Jaisy
- 15,327
- 34
- 171
- 290
0
votes
1 answer
Multiple query values binding in POJO
I have a simple controller and rest API as below in which I want to map 'name', 'price' and 'description' querie values into ProductSearchCriteria :
@Controller("/api/v1/product")
public class ProductController {
private static final…

San Jaisy
- 15,327
- 34
- 171
- 290
0
votes
1 answer
How do I get clientId of the client that made the request that triggered the Client filter?
I am writing an app in which I want to enrich an outgoing request based on some configuration.
Configuration example
clients:
clientA:
header1: value1
header2: value2
client2:
header1: value3
header2: value4
To do that I have…

JSBach
- 4,679
- 8
- 51
- 98
0
votes
0 answers
Micronaut 2.0.0 - Unable to invoke one service from another on kubernetes
I have a service called Identity from which I want to invoke another service called Notification. Both services are built with Java 11, Micronaut 2.0.0 and are to be deployed on kubernetes.
The Notification service's kubernetes manifest look like…

Abhishek
- 681
- 1
- 6
- 25
0
votes
1 answer
Micronaut - Enable CORS in built in security controllers
Micronaut is used in one of my projects. I am enabling JWT security feature of micronaut with built in login, logout controllers. But when I hit /login endpoint, it gives me below error:
Access to XMLHttpRequest at 'micronaut-login-endpoint' from…

Kruti Parekh
- 1,271
- 9
- 21
0
votes
0 answers
How to limit parallel http requests in Micronaut Http Client
I am working on a micronaut project. I am calling some external web services using micronaut declarative http client.
import io.micronaut.http.client.annotation.Client;
import io.reactivex.Single;
@Client("/external-client")
public…

GaneshSreeju
- 303
- 1
- 13
0
votes
1 answer
Micronaut -> Merge the results of 2 Async HttpClient Calls
I have been experimenting with various features of Micronaut. I have couple of questions.
1) I have 2 asynchronous calls to various API. How do I combine the results of 2 API's as we do in RxJava Observable.zip?
2) I am using declarative clients to…

jagannathan rajagopalan
- 424
- 5
- 22
0
votes
1 answer
Micronaut declarative client in grails: how do I mock it?
What is the correct way to mock a declarative REST client when unit testing a Grails service?
Details
I am using Micronaut's declarative HTTP client in my Grails 4 app.
I tried to unit test the client using Ersatz, but I couldn't get it working…

RMorrisey
- 7,637
- 9
- 53
- 71
0
votes
1 answer
Runtime error after converting a micronaut project to micronaut servlet
I am trying to use Micronaut-servlet API for an existing microservice.
Without the servlet API the following worked perfectly well
@Test
public void
saved_movies_are_returned_in_my_list() {
try (RxHttpClient client =…

Sap
- 5,197
- 8
- 59
- 101
0
votes
1 answer
How do I use the Grails environment settings in micronaut client @Header?
I have an environment-specific header property in my Grails application.yml, configured like so:
environments:
development:
apiKey: 'foo'
How do I use this setting in a @Header for the micronaut HTTP declarative client?
I tried this:
//…

RMorrisey
- 7,637
- 9
- 53
- 71
0
votes
1 answer
Micronaut declarative REST client throws an error - @Introduction method interceptor missing
When I autowire the client interface for my Micronaut declarative client, I get this error:
Caused by: java.lang.IllegalStateException: At least one @Introduction method interceptor required, but missing. Check if your @Introduction stereotype…

RMorrisey
- 7,637
- 9
- 53
- 71
0
votes
1 answer
Testing of secured controller
I have the following controller for which I'm trying to test
@Secured(SecurityRule.IS_AUTHENTICATED)
@Controller
class UserController(private val userService: UserService) {
@Get("/principal")
fun getPrincipal(principal: Principal):…

user672009
- 4,379
- 8
- 44
- 77
0
votes
1 answer
Micronaut HttpResponse body CompositeByteBuf type throws io.netty.util.IllegalReferenceCountException: refCnt: 0
I am using Micronaut @Client to call external service which returns me response
of type FullNettyClientHttpResponse and it has body in the form of CompositeByteBuf(freed, components=1); I want to convert CompositeByteBuf to a human readable…

2787184
- 3,749
- 10
- 47
- 81
0
votes
2 answers
How to map errorType using Micronaut client annotation
How to map errorType using Micronaut client annotation, In case of programatically we can provide body type and errorType objects in case of success and failure.
Programmatically calling client:
import io.micronaut.core.type.Argument;
import…

2787184
- 3,749
- 10
- 47
- 81