-
Notifications
You must be signed in to change notification settings - Fork 39
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
feat: component client samples update #1706
Conversation
<1> `KalixClient` is injected on the constructor. It will be used to build calls to the underlining Entity. | ||
<1> `ComponentClient` is injected on the constructor. It will be used to build calls to the underlining Entity. | ||
<2> Expose the command handler as a `POST` endpoint at specified path. | ||
<3> Check if the added item is carrots. | ||
<4> If it is "carrots" immediately return an error, disallowing adding the item. | ||
<5> For allowed requests, use `kalixClient` to get a deferred call to the entity. | ||
<5> For allowed requests, use `componentClient` to get a deferred call to the entity. | ||
<6> The `deferredCall` is then used with `effects().forward()` to forward the request to the entity. | ||
|
||
NOTE: You might be wondering what the `kalixClient` is about. For now, think of it as a lightweight HTTP client allowing you to reach out to other Kalix services. All details can be found at xref:call-another-service.adoc[] chapter. | ||
NOTE: You might be wondering what the `componentClient` is about. For now, think of it as a lightweight, type safe, HTTP client allowing you to reach out to other Kalix services. All details can be found at xref:call-another-service.adoc[] chapter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note this file actions-as-controller.adoc
was deleted in main with the menu restructure. Now this content is under actions.adoc
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR updated
dbe50be
to
f9277f8
Compare
f9277f8
to
899c3be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ComponentClient is really nice!
References #1335