Skip to content

Instantly share code, notes, and snippets.

View likhoman's full-sized avatar

Artem Likhomanenko likhoman

View GitHub Profile
package org.github.likhoman.mtls.client;
import io.netty.handler.ssl.SslContext;
import nl.altindag.sslcontext.SSLFactory;
import nl.altindag.sslcontext.util.NettySslContextUtils;
import org.apache.http.conn.ssl.DefaultHostnameVerifier;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
package org.github.likhoman.mtls.client.ws;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.integration.annotation.ServiceActivator;
import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.config.EnableIntegration;
import org.apache.http.HttpVersion;
import org.apache.http.client.fluent.Request;
import org.apache.http.entity.ContentType;
import java.io.IOException;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadLocalRandom;
public class HttpClientDemo {
@Service
public class SomeService {
public Mono<ServerResponse> piu(Mono<String> body) {
final SomeProcess someProcess = new SomeProcess();
return ServerResponse
.ok()
.body(
BodyInserters.fromPublisher(
body