-
Notifications
You must be signed in to change notification settings - Fork 556
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
10032: refactor: let `dist` build gateways broker client r=oleschoenburg a=oleschoenburg ## Description Builds the broker client in dist, making it available for injection. Because `BrokerClient` needs to schedule actors, the actor scheduler must be started before. To achieve this, `BrokerClient` gets a `start` method that does the scheduling. ## Related issues <!-- Which issues are closed by this PR or are related --> relates to #9996 Co-authored-by: Ole Schönburg <ole.schoenburg@gmail.com>
- Loading branch information
Showing
15 changed files
with
126 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
dist/src/main/java/io/camunda/zeebe/gateway/BrokerClientComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH under | ||
* one or more contributor license agreements. See the NOTICE file distributed | ||
* with this work for additional information regarding copyright ownership. | ||
* Licensed under the Zeebe Community License 1.1. You may not use this file | ||
* except in compliance with the Zeebe Community License 1.1. | ||
*/ | ||
package io.camunda.zeebe.gateway; | ||
|
||
import io.atomix.cluster.AtomixCluster; | ||
import io.camunda.zeebe.gateway.impl.broker.BrokerClient; | ||
import io.camunda.zeebe.gateway.impl.broker.BrokerClientImpl; | ||
import io.camunda.zeebe.gateway.impl.configuration.GatewayCfg; | ||
import io.camunda.zeebe.scheduler.ActorScheduler; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
final class BrokerClientComponent { | ||
final GatewayCfg config; | ||
final AtomixCluster atomixCluster; | ||
final ActorScheduler actorScheduler; | ||
|
||
@Autowired | ||
BrokerClientComponent( | ||
final GatewayCfg config, | ||
final AtomixCluster atomixCluster, | ||
final ActorScheduler actorScheduler) { | ||
this.config = config; | ||
this.atomixCluster = atomixCluster; | ||
this.actorScheduler = actorScheduler; | ||
} | ||
|
||
@Bean("brokerClient") | ||
BrokerClient createBrokerClient() { | ||
return new BrokerClientImpl( | ||
config, | ||
atomixCluster.getMessagingService(), | ||
atomixCluster.getMembershipService(), | ||
atomixCluster.getEventService(), | ||
actorScheduler); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,9 @@ | |
|
||
public interface BrokerClient extends AutoCloseable { | ||
|
||
void start(); | ||
|
||
@Override | ||
void close(); | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.