A bit of context.
The company where I work is starting to transition to a modular architecture (something similar to microservices) for our main product, currently monolithic. The first step is to build a service that is currently not present in the product, and we want to build it outside the monolith to stop increasing the size and complexity of it.
This component is a "connector", in the sense that is something that should take care of sending messages to external parties that all use different protocols, standards and formats. It's aim is to provide a simple way for the customer to interact with these external services via standardized API/service. Currently our main product generates the messages, but it does not take care of sending them.
Here is where I do struggle. We want this new connector to expose a REST api that will enable the customer to interact with it, in order to POST a message to send it, GET details on the message, GET the list of sent messages and so on. That is all well and good. The problem is that we also want the application to being able to pick up files from a file share and send them, then show the results via REST api. This is because this is a natural improvement over the current product: monolith place files in folder X, connector picks them up.
But how should it pick them up? I have the feeling that having a microservice being approachable both via REST and react to file events is a bad idea. The servlet container takes care of all the threading when calling it via REST, so what about the files that would be picked up via file share? We are mixing synchronous REST and event-based file share here.
Maybe a better idea is to have something that picks-up the files and POST the file to the connector APIs?
The language of choice is Java, but it's more a design problem!
Thanks in advance.