Dynamic Proxy CXF Web Service - redirect

I have two identical CXF 3.1 web services Service_A and Service_B that have the same WSDL files. Service_A is deployed on Server_X and Service_B is deployed on Service_Y. Is there a way to implement a CXF web service Service_C deployed on Server_Z that will play the role of a dynamic proxy web service. Service_C is supposed to have the same WSDL file as Service_A and Service_B but it will redirect the SOAP requests to Service_A or Service_B and send back the SOAP response to the client.
Thank you in advance!

You can do that. You service C receives the request and calls the corresponding endpoint in either service A or service B in alternating fashion (Round Robin) and returns to the client whatever response the call to the service A or B returned.
Other than that I'd suggest using Apache or Nginx instead of Service C on Server Z to basically do this load-balancing act for you. A load balancer will do a far better job forwarding your client requests to service A or B than from your service C.

Related

Kubernetes: communicate internal services using HTTPS

I have 2 services deployed in Kubernetes
Application A (asp.net core 5 gRPC service)
Application B (asp.net core 5 api)
Application B is accessible via ingress-nginx-controller over https from out side of my cluster.
Application A is expose via Service and only accessible inside my cluster.
My question is how can I connect from Application B to Application A over SSL/TLS?
For HTTPS communication, you can setup certificate with "dotnet dev-certs https". Each pod will need setup self-signed certificate on port 443, for development purpose, but not recommended.
However, GRPC actually can be use with HTTP based, with service mesh support for http2/grpc for service-to-service communication. These steps can be
Call GRPC use HTTP
https://learn.microsoft.com/en-us/aspnet/core/grpc/troubleshoot?view=aspnetcore-3.0#call-insecure-grpc-services-with-net-core-client-2
Setup Linkerd
https://techcommunity.microsoft.com/t5/azure-developer-community-blog/meshing-with-linkerd2-using-grpc-enabled-net-core-services/ba-p/1377867
Hope this helps

Spring Cloud Zuul - Add http proxy details (proxy server, proxy port, credentials etc) to the incoming request before routing

We are planning to build a reverse proxy server for our enterprise to make some external API calls.
Currently, our microservice applications are hosted on the PCF environment. For any external (on the internet) calls, we make use of the PCF proxy server to communicate.
Now my use-case is to build a reverse proxy server(Spring Zuul) to route to external APIs through the PCF proxy. However, the microservice applications wouldn't pass any proxy information on the request to the zuul server. So, this needs to be added by Spring Zuul reverse proxy server.
Problem:
How to add HTTP proxy details to the coming request from zuul server?
Any documentation also would be really helpful.

Do request to Eureka client using server

I hava eureka server at eureka-server.com host and application with appId facade registered at server. Facade application has /users endpoint. Can I call /users endpoint through Eureka server something like this eureka-server.com/facade/users ?
No, Eureka can't proxy your calls through it, it's pure service discovery. But you can add a separate Zuul service with reverse proxy filtering which uses Eureka client to discover routes. Spring Cloud Netflix Zuul component has this out of the box.

Using the same WSO2 ESB proxy service for two or more SOAP requests... is it possible?

I have deployed some proxy services in WSO2 ESB because I have to ask the endpoint for several responses (dataset), according to different soap action. Every response must be set in a file, so I set an appropriate sequence in the outSequence of the proxy service, and this sequence writes the soap answer into a file.
In this way i have to deploy a proxy service and a sequence for EVERY soapAction, so i ask: is there a way for deploying a single proxy service for a given web service and using it with several sequences according to the soapaction to perform?
My question was born by the need to implement several scheduled tasks that take a dataset from an endpoint (webService) and write it into a file, but i don't want to deploy so much proxy service for every kind of dataset I have to request to the web service!
I hope my question is clear.
You do not necessarily create a diffrent proxies for each and every soapAction. You can utilize the filter mediator in the OutSequence of single proxy and do the header base routing to relevant VFS endpoint.

Application in HTTP & HTTPS. But forms on HTTPs

I have a requirement wherein the application must be on both http and https. While the end user must be able to traverse the application in http, all forms should transition to https post submission.
Any advice as to how this can be achieved given that the application is deployed on Tomcat cluster and has a Apache HTTP Server as a load balancer distributing the load in a cluster.