Skip to content
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

Move brokerClient handling from REST controllers to service layer #19524

Open
Tracked by #18254
tmetzke opened this issue Jun 19, 2024 · 0 comments · May be fixed by #19573
Open
Tracked by #18254

Move brokerClient handling from REST controllers to service layer #19524

tmetzke opened this issue Jun 19, 2024 · 0 comments · May be fixed by #19573
Assignees
Labels
component/c8-api All things unified C8 API, e.g. C8 REST component/gateway component/zeebe Related to the Zeebe component/team kind/toil Categorizes an issue or PR as general maintenance, i.e. cleanup, refactoring, etc. scope/gateway Marks an issue or PR to appear in the gateway section of the changelog

Comments

@tmetzke
Copy link
Member

tmetzke commented Jun 19, 2024

Description

  • Introduce services for user task and job resources, similar to the ProcessInstanceServices.
  • Handle brokerClient communication in the services by introducing methods for resource manipulation, e.g. public CompletableFuture<UserTaskRecord> completeUserTask(final long userTaskKey, final DirectBuffer variables, final String action).
  • Service methods create and send broker command requests, asynchronously handle the response, map broker errors and rejections to a common CamundaServiceException (allowing access to the rejection and error), and return completable futures.
  • The REST controllers validate incoming request data, extract the data for the service methods, call the service methods, and handle the response and potential exception asynchronously like they already do, mapping them to respective REST responses.

Reasoning

  • Unified handling of lower-level communication from REST controllers (e.g. to ES/OS and brokers).
  • Simplified REST controllers with service access only, nothing more.
  • Clear separation of concerns between REST controllers and services.
  • Simplified test setup for REST controllers since only service method calls need to be mocked instead of BrokerClient communication.
@tmetzke tmetzke self-assigned this Jun 19, 2024
@tmetzke tmetzke added kind/toil Categorizes an issue or PR as general maintenance, i.e. cleanup, refactoring, etc. scope/gateway Marks an issue or PR to appear in the gateway section of the changelog component/gateway component/zeebe Related to the Zeebe component/team component/c8-api All things unified C8 API, e.g. C8 REST labels Jun 19, 2024
@tmetzke tmetzke linked a pull request Jun 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/c8-api All things unified C8 API, e.g. C8 REST component/gateway component/zeebe Related to the Zeebe component/team kind/toil Categorizes an issue or PR as general maintenance, i.e. cleanup, refactoring, etc. scope/gateway Marks an issue or PR to appear in the gateway section of the changelog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant