-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch from @EnableZeebeClient
to Spring Boot Auto-Configuration
#275
Comments
Any thoughts (maybe @lzgabel @aivinog1 @zambrovski @jangalinski @falko)?
|
@berndruecker. For me, I really like your proposal. 🚀 At the same time, I suggest that you can collect other opinions in the C8 slack group. |
Hi Bernd. I believe the
|
+1 to what Simon said. Having a "spring only" core and an additional spring-boot autoconfiguration/starter is a good idea. |
Thanks @zambrovski!
|
I don't have a grip on the internals, so can't judge the viability, but the ability to use the lib in a non-Boot context seems quite desirable. |
Look at lifecycle of ZeebeClient, it is currently created very late, see #313 |
Probably related (or at least could be fixed differently then: camunda-community-hub/camunda-8-benchmark#59) |
Created #353 which looks good so far 👍 |
I recently added Metrics to Spring-Zeebe and wanted that the user application can bring its own implementation of a MetricRecorder. Therefore, the core library would ship with a NoopMetricsRecorder. I tried to use Spring Configuration magic for this, to only create the NoopMetricsRecorder if no other MetricsRecorder is defined (e.g. @ConditionOnMissingBean). This did not work as expected and it took me a while to figure out the root cause, which is very well explained here: spring-projects/spring-boot#18228
Bottom-line:
@EnableZeebeClient
annotation bypasses the Spring Auto Configuration mechanism@Autowired(required = false) MetricsRecorder
and create the Noop only if null is handed in. This works, but does not feel right.Now I think we should change spring-zeebe:
@EnableZeebeClient
spring.factories
in meta-inf to automatically enable the Zeebe Client if the library is on the classpathzeebe.client.enabled
which can be set tofalse
to disable the client if neededWhy?
Does anybody see any problems with this?
8.2.x would be a good candidate to make such a change. It would generally work backwards compatible, unless somebody has an application that pulls in spring-zeebe-starter, but does not add @EnableZeebeClient. We could log a BIG WARNING in such a case to raise awareness for those situations (which should be very rare).
One open question is:
The text was updated successfully, but these errors were encountered: