Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

ZeebeLifecycleEventProducer is ignoring the ZeebeCondition #905

Open
zambrovski opened this issue Aug 15, 2024 · 0 comments
Open

ZeebeLifecycleEventProducer is ignoring the ZeebeCondition #905

zambrovski opened this issue Aug 15, 2024 · 0 comments

Comments

@zambrovski
Copy link
Contributor

zambrovski commented Aug 15, 2024

I have the Spring Boot Starter Camunda on my classpath and would like to disable zeebe (for a specific run mode). For doing so, I set camunda.client.zeebe.enabled=false property and management.health.zeebe.enabled=false property, so the auto configurations of the Zeebe client and its connection to Zeebe Cluster is disabled.

The Zeebe Event Lifecycle Producer still tries to inject the non-existing Zeebe client and fails:

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 0 of method zeebeLifecycleEventProducer in io.camunda.zeebe.spring.client.CamundaAutoConfiguration required a bean of type 'io.camunda.zeebe.client.ZeebeClient' that could not be found.


Action:

Consider defining a bean of type 'io.camunda.zeebe.client.ZeebeClient' in your configuration.

I believe this is because the ZeebeCondition is ignored due to the second condition ( @ConditionalOnMissingBean(SpringZeebeTestContext.class)).

This makes it impossible to deactivate Zeebe by application properties.

As a workaround, I created a fake instance of the SpringZeebeTestContext:

  @Bean
  public SpringZeebeTestContext fakeTestContext() {
    return new SpringZeebeTestContext();
  }

This workaround helps because the condition is now satisfied.

See:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant