Image Downloader with Spring Boot - spring-boot

I am beginner...
I have to write a program that should download an image from a URL (about 100 thousand) and store it in a database. How can I do this with Spring Boot With REST??
(Or with multithreading)
I will be grateful for help.

Related

What's the right way to load a file in application context in spring boot?

I have an XML file (notice.xml) that I want to load into my Spring Boot Application. This file will be served to an API after some modification. I want this file to be loaded into the memory to minimize the I/O. What's the right way to load this file into memory at boot time, or just after start up?
The easiest way is, buy loading the Resource with #Value("classpath:FILENAME)
but there are tons of ways, you can try. To get a better understanding you can look here

I'm working in spring batch. I need to connect to azure blob storage and get all files from there in. In Item Reader of batch how to do this?

In item reader I have to make connection to blob storage ang get all files in container and pass it to Item processor of spring batch. I'm new to spring batch so please help me out.
Project Structure:
Project Structure
Try with using Spring Boot Starter azure-spring-boot-starter-storage to auto-configure Azure Blob storage in Spring projects. This library allows you to interact with Azure Blob storage using Spring
For more details refer this document
There is method called ListBlobs()
Returns an enumerable collection of blob items for the container. After getting all files read them in loop pass It to Item processor of spring batch.
For more details refer this document

Spring JPA Multiple "schema-xx.sql" files?

I'm developing Spring Boot / -JPA application. By default, Spring-Boot loads "data-${platform}.sql" and "schema-${platform}.sql" automatically when the application is started. I found several notes about how to split a single "data-${platform}.sql" file into multiple files and how to use these "data"-files from Spring Boot. But what about "schema-${platform}.sql" files? My current "schema-${platform}.sql" has become quite large and thus confusing. The question now is, if I can split these "schema-sql" file into several files and what do I have to configure in my corresponding JPA classes?
Thanks a lot!

small emebedded database for spring data

I try to write a small web application with a restfull frontend to manage a little amount of data (round about 30 datasets). I want to create a PDF file from the datasets (using iText, but this is not the Problem). I search now a small database, which I can embed in my application an which persists the data somewhere on my Harddisc (if possible no Client / Server database), but I find no example / tutorial for this. All tutorial I found using a database in in-Memory mode, which is not what I need. Is there somewhere a nice tutorial helping me? Which database would you sugest to use in my Situation?
Thanks for your help and
Kind regards,
Andreas Grund
You can use H2, HSQL and Derby databases for embedded database. For example h2 database datasource-url like below :
jdbc:h2:~/Desktop/Database/test;DB_CLOSE_ON_EXIT=FALSE;
And in spring boot you can easily do it ,if you read this document Spring Boot-Embedded Databases

Spring boot and undertow - multipart threshold size doesn't work

spring-boot version : 1.3.5
I set multipart.file-size-threshold=40MB in application properties.
When I am using embedded tomcat, I see that there is no write operations on disk during upload requests.
When I am using undertow, there are still write operations on disk.
How can i upload multiparts without disk writing via undertow?
Thanks.
This is a limitation of Undertow. Looking at its code it doesn't appear to honour the file size threshold and there's a todo to that effect in ManagedServlet.

Resources