I had a look at several out-of-the-box connectors and none of them was implemented as connector bean. Is there any reason for that? Are there advantages?
As far as I understood the connector runtime is always running as spring boot application. There are just different ways to use it (e.g. just the dependency or the docker images). So all connectors could be beans or not?
In my opinion connector beans lead to the cleanest code and you have more possibilities. E.g. instead of those suppliers with their static methods you can have beans too, so you can just autowire them where they are needed.
Thats a great question @cma. Please be aware that most if not all connectors were created before the Spring support was added. In addition to that its a good practice for our out-of-the-box connectors to work in environments without requiring any dependencies being present in the runtime itself.
We might migrate some of the OOTB connectors to spring beans if we need to access or share resources between connectors but so far the current concept works fine.
I see some reasons why one would like to reuse other components/beans in custom connectors for things like database connections, json mapping or any other functionality where spring might already provide a feature that could easily be re-used without creating all the components or object hierarchies yourself.
Thanks great answer. This is similar to what I was thinking and because we have mainly custom connectors beans are much more useful for us than for you I guess. Especially the Deserializer with all registered adapters, mail service (configured through env vars), user/group service (e.g. resolve email addresses of all users for the given group names) and services to communicate with other systems are always re-used in our case. The configuration of those components depends on the customer (one runtime per customer per stage).