I am having 2 java spring micro services - spring-boot

from one microservice service I am uploading a file using open feign client and from the other end I am trying to download the same file by invoking the second service from a different JVM, Is there a complete example of file upload and download using open feign client.
Service 1 runs on open feign (1 jvm) and calls service on another jvm which downloads the file without using open feign

Related

Configure Spring to run without web services

I want to create Spring Boot project which runs without web services because I need to use it to process Kafka messages, SQL queries and webflux client.
Is it possible to disable the rest API functionality and to disable tomcat from exposing server on the network?

Connection to a spring boot micro-service from a monolithic spring app

So we have a Spring app which runs on localhost:8080
As part of a requirement we need this application to connect to a micro service. The micro service has 2 components.
One running on localhost:8888 - X
Another on localhost:7777 - Y
We have the spring discovery server running on localhost:8761
How can we connect to the micro service X or Y from the monolithic spring application through the discovery server.
We can directly connect to localhost:8888 or localhost:7777
But is there a way to do it through the discover server
There are 3 ways to do the call from the monolithic app to a microservice registered in the discovery-service:
After adding and enabling discovery service dependencies you can
inject eurekaClient bean and get an application url
("round-robinned" or not).
Use the #LoadBalanced restTemplate and send requests to
"http://service-name/url" where ribbon will change "service-name" to
a valid URL automatically
And finally the best option is to rely on feign client. It uses
discovery service implicitly.

How do I forward requests from a client to a Windows Service running on Windows Server

I have an Angular application deployed to/via IIS. This app is sending requests to REST endpoints exposed by a Spring Boot application which I am running as a Windows Service (The Spring Boot application is accessing a MongoDB but this should not be relevant, I think). The exposed REST interface is accessable via port 8080 on the servers localhost.
The Angular app is accessible as it should be but there seems to be a problem when the web app tries to access the Spring Application's REST interfaces. More specific: The client seems to be receiving HTML documents when he should be receiving JSON files.
I am new to working with IIS so beginner errors are not unlikely. I'm happy to share more information if needed!
Edit: I read again the question, and understood something wrong:
Looks like you were sending requests to your Angular server. For development you should use the embedded web server (https://docs.spring.io/spring-boot/docs/current/reference/html/howto-embedded-web-servers.html) in order to ease your server configuration steps. And from within the windows server, send request to localhost:springboot_port.
Once you want your service to be available for an external client, and to keep your service available/awake (something similar to systemd in Linux), you could try this: https://www.baeldung.com/spring-boot-app-as-a-service

Spring Zero Copy file download

I have to write a Web service that will be hit by a web application to download image.Image URL is not directly exposed to client, it will be be decided by some business logic. I am using Amazon S3 for file storage so how can i implement zero copy file transfer with spring?

Is it possible to deploy multiple Spring Boot applications to a server?

We can create restful API in spring boot jar file?
1)can we split multiple jar file in Apache server?
2) if we split multiple jar file how will identify which jar contain correct rest APIs
How spring boot jar file will work in server?
For Development Environment
You can configure ports via application.properties or via system properties.
Or with option to jvm --server.port=8081
So, there is no problem to run a few APIs on single machine with different ports.
You don't need Apache Server. Spring Boot has it's own embedded for you. So, you can easily use it.
Let's say you have two APIs.
localhost:8081 (Checkout Service)
localhost:8082 (Payment Service)
Hostname and port - it's your identification for each service.
When you trying to search something in Google.
You browser - it's a client.
And Google's servers - it's a server.
The same here. Checkout Service trying to delegate some job to Payment Service. So, Checkout Service - it's a client. And this client should know the address of Payment Service.
For Production Environment
You should think twice, how you will monitor performance, manage scalability and so on.

Resources