How can we simulate webflux client (reactive) using Apache JMeter - jmeter

I cannot find any option for Headers to use application/x-nd-json or any other for simulating streaming client in Apache JMeter for Load test.

I think you need to go for JSR223 Sampler and use WebClient for connecting to your WebFlux endpoints and executing the requests, something like:
def client = org.springframework.web.reactive.function.client.WebClient
.create('https://your-server-host:your-server-port')
def result = client.get()
.uri('your-endpoint')
.retrieve()
.bodyToMono(your-entity.class)
result.subscribe(System.out::println)
You can also consider creating your own plugin for JMeter

Related

How to leverage Armeria's fantastic JSON to GRPC transcoding functions to springboot project

We have a existing springboot project which has terrible API management system. So we wanna do something like grpc-gateway related work. But we don't want to add sidecar to our existing service. We found that Armeria has a wonderful json grpc transcoding function. How do we leverage this thing to our existing spring boot project.
We found that Armeria has a wonderful json grpc transcoding function.
I guess a minimal example may look like the following:
final GrpcService grpcService = GrpcService.builder()
.addService(new MyGrpcService())
.enableHttpJsonTranscoding(true) // enable http json transcoding
.build();
final ServerBuilder sb = Server.builder();
sb.service(grpcService).serviceUnder("/foo", grpcService); // add the grpc service to the server
final Server server = sb.build();
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
server.stop().join();
}));
server.start().join(); // start the server
How do we leverage this thing to our existing spring boot project.
Armeria also offers spring-boot integration. An example can be found in the following repository.
You can also ask at slack or github issues if you have any additional/follow up questions.

how to use httpclient processor in Spring cloud Dataflow

I am trying out spring cloud dataflow. My specific usecase is to dump the response from a GET request to a log. I am trying to use the httpclient processor for this. But i dont understand how come it is a processor, and not a source. If it a processor, what should be the input source to it. Any example would do great.
It requires an incoming Message to trigger the http request. The message may specify the URL, HTTP Method, etc. using SpEL expressions but these may also be statically configured as well. For example, you can use the time source to trigger a request every second.

How do we connect Spring WebClient to a Unix Domain Socket?

Spring's WebClient underlyingly uses Netty which access to Unix domain sockets. I am trying to make it access /var/run/docker.sock so that I can perform operations using the API as I need /services which is not supported by the docker-java library.
My current workaround is to create a socat container that exposes the Docker socket to TCP within an internal network which in turn allows me to use WebClient's HTTP connections.
Though come to think of it, having this workaround gives one benefit of not needing to put a larger Java application on the manager node.
However, I am still curious how to connect to the unix domain docket.
You can create a Netty HttpClient following their documentation regarding Unix Domain Sockets here.
import io.netty.channel.unix.DomainSocketAddress;
import reactor.netty.http.client.HttpClient;
HttpClient client = HttpClient.create()
.remoteAddress(() -> new DomainSocketAddress("/var/run/docker.sock"));
Then you can tell WebClient to use this HttpClient like this.
WebClient.builder()
.clientConnector(new ReactorClientHttpConnector(client))
.build();
You can expose the docker daemon over TCP and use the REST API.

Example of RabbitMQ with RPC in Spring Integration

After make a search about different ways to implement it, im stuck.
What im looking for is to realize this example (https://www.rabbitmq.com/tutorials/tutorial-six-spring-amqp.html) with Spring Integration.
I had found interesting post as this (Spring integration with Rabbit AMQP for "Client Sends Message -> Server Receives & returns msg on return queue --> Client get correlated msg") but didn't help me with what i need.
My case mill be a system where a client call the "convertSendAndReceive" method and a server (basede on Spring Integration) will response.
Thanks
According to your explanation it sounds like Outbound Gateway on the Client side and Inbound Gateway on the Server side pair is what you need.
Spring Integration AMQP support provides those implementations for you with built-in correlation functionality: https://docs.spring.io/spring-integration/docs/5.0.0.RELEASE/reference/html/amqp.html

Spring ResponseEntity - how to return HTTP 100 Continue

Having rest services using Spring-boot 1.5.8.RELEASE some of the services may take time to process.
My idea is to use HTTP 100 Continue so the response will not time out and then return the final response.
I haven't find any way how to do that
Thanks for any hint

Resources