Issue
Now I want to develop a common mail service for our systems.
As we design, we want to develop a RabbitMQ
producer and consumer. On consumer side, we could develop and deploy a Spring Boot
or Spring Cloud
application, but on producer side we want to give a common mail client like the interface below and make a jar dependency for other system.
interface MailClient {
ListentableFuture send(Message message);
}
But i see spring boot and spring cloud using many declarative method and seems must use a application class, but i just want a class reference and not need deploy. i do not know how to implement it.
Solution
According to the documentation:
Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run".
But Spring Boot is not the silver bullet which matches all situations. If you want to create a library, you can create a regular spring project which builds a jar and stores it in your company's repository, if you have one.
Answered By - jny