Skip to content

Commit 75ef469

Browse files
Merge pull request #600 from mulesoft/W-21311839-Add-gRPC-to-ACB-docs-CP
W-21311839-Add-gRPC-to-ACB-docs-CP
2 parents db8afe5 + 14e3b56 commit 75ef469

25 files changed

Lines changed: 406 additions & 30 deletions

modules/ROOT/nav.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,10 @@
7171
* xref:des-designing-api-specs.adoc[]
7272
** xref:des-create-api-specs.adoc[]
7373
** xref:des-create-asyncapi-api-specs.adoc[]
74+
** xref:des-design-grpc-api-spec.adoc[]
7475
** xref:des-create-api-fragments.adoc[]
7576
** xref:des-publish-api-spec-to-exchange.adoc[]
77+
** xref:des-publish-grpc-api-to-exchange.adoc[]
7678
** xref:des-govern-api.adoc[]
7779
** xref:des-delete-api-projects.adoc[]
7880
@@ -102,6 +104,7 @@
102104
* xref:imp-implementing-apis.adoc[]
103105
** xref:imp-implement-api-specs.adoc[]
104106
** xref:imp-asyncapi.adoc[]
107+
** xref:imp-implement-grpc-api-spec.adoc[]
105108
** xref:imp-implement-local-apis.adoc[]
106109
** xref:imp-filter-search-results.adoc[]
107110

modules/ROOT/pages/_partials/acb-component-info.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ To find information about more connectors, see xref:connectors::introduction/int
9797

9898
Use the Connection Management Configuration Panel to easily configure connections to third-party systems directly from the UI.
9999

100-
In this panel, you can create, edit, delete, and test connections directly within the ACB interface, automatically populate connection fields using metadata provided by the connector, and save and manage connection configurations without switching to the XML view.
100+
In this panel, you can create, edit, delete, and test connections directly within the IDE interface, automatically populate connection fields using metadata provided by the connector, and save and manage connection configurations without switching to the XML view.
101101

102102
To open the configuration panel:
103103

104-
* Click on an existing component, or add a new one.
104+
* Select an existing component, or add a new one.
105105
* Click the *+* icon.
106106
+
107107
This action displays the configuration panel, for example:

modules/ROOT/pages/_partials/acb-reusable-steps.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ When the AsyncAPI feature is available for your organization, the Anypoint Code
509509
510510
//
511511
// tag::start-implementation[]
512-
. From *Quick Actions*, click *Implement an API*:
512+
. From *Create*, click *Implement an API*:
513513
+
514514
image:anypoint-code-builder::implement-api-option-mat.png["*Implement an API* link highlighted in the *Getting Started* section"]
515515
. Complete the *Implement an API Specification* form:

modules/ROOT/pages/_partials/acb-start-desktop.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Ensure this option is checked.
7373
[[acb-menu]]
7474
image::anypoint-code-builder-view.png["MuleSoft icon for Anypoint Code Builder in the activity bar"]
7575

76-
. Check that the IDE loads the <<acb-menu, Anypoint Code Builder menu>> with *Quick Actions* and *Documentation* links.
76+
. Check that the IDE loads the <<acb-menu, Anypoint Code Builder menu>>.
7777

7878
. If you have an Anypoint Platform account running in the EU cloud, change the *Mule: Control Plane* setting to *EU cloud*.
7979
+

modules/ROOT/pages/af-create-agent-network.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ To get started try one of these suggested prompts.
2727

2828
. If you're not logged in, log in to your Anypoint Platform account.
2929
. In Anypoint Code Builder choose on of the following:
30-
* In Quick Actions, select *Create an Agent Network*.
30+
* In Create, select *Create an Agent Network*.
3131
* From the Command Palette, run this command: *MuleSoft: Create an Agent Network Project*.
3232
. Enter a name for the project and select the location to create the project.
3333
. Select the business group associated with the target space you created in xref:anypoint-code-builder::af-get-started.adoc[Get Started with Agent Networks]. The business group you select must be the same business group you selected when you created the target space.

modules/ROOT/pages/ai-enabling-api-project-topic-center.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ See the xref:tutorials.adoc[] for details.
4141
include::partial$acb-reusable-steps.adoc[tags="open-ide"]
4242
+
4343
image::anypoint-code-builder-view.png["Anypoint Code Builder icon highlighted in the activity bar"]
44-
. From *Quick Actions*, click *Design an API*:
44+
. From *Create*, click *Design an API*:
4545
+
46-
image::design-api-1.png["*Design an API* link highlighted in the *Quick Actions* section"]
46+
image::design-api-1.png["*Design an API* link highlighted in the *Create* section"]
4747
. Select *Enable this API for Agent Topics and Actions*.
4848
. Complete the *API Specification* form:
4949
+

modules/ROOT/pages/des-create-api-fragments.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ To create an API spec fragment:
5656
include::partial$acb-reusable-steps.adoc[tags="open-ide"]
5757
+
5858
image::anypoint-code-builder-view.png["Anypoint Code Builder icon highlighted in the activity bar"]
59-
. From *Quick Actions*, click *Design an API*:
59+
. From *Create*, click *Design an API*:
6060
+
61-
image::design-api-1.png["*Design an API* link highlighted in the *Quick Actions* section"]
61+
image::design-api-1.png["*Design an API* link highlighted in the *Create* section"]
6262
. In *Design an API*, click the *API Fragment* tab:
6363
+
6464
image:des-api-fragment.png["API Fragment tab on the Design an API page"]

modules/ROOT/pages/des-create-api-specs.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ To create an API spec project in Anypoint Code Builder:
3737
include::partial$acb-reusable-steps.adoc[tags="open-ide"]
3838
+
3939
image::anypoint-code-builder-view.png["Anypoint Code Builder icon highlighted in the activity bar"]
40-
. From *Quick Actions*, click *Design an API*:
40+
. From *Create*, click *Design an API*:
4141
+
42-
image::design-api-1.png["*Design an API* link highlighted in the *Quick Actions* section"]
42+
image::design-api-1.png["*Design an API* link highlighted in the *Create* section"]
4343

4444
. Complete the *API Specification* form:
4545
+

modules/ROOT/pages/des-create-asyncapi-api-specs.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ To create and design an AsyncAPI spec project in Anypoint Code Builder:
3232
include::partial$acb-reusable-steps.adoc[tags="open-ide"]
3333
+
3434
image::anypoint-code-builder-view.png["Anypoint Code Builder icon highlighted in the activity bar"]
35-
. From *Quick Actions*, click *Design an API*:
35+
. From *Create*, click *Design an API*:
3636
+
37-
image::design-api-1.png["*Design an API* link highlighted in the *Quick Actions* section"]
37+
image::design-api-1.png["*Design an API* link highlighted in the *Create* section"]
3838

3939
. Complete the *API Specification* form:
4040
+
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
= Designing a gRPC API Specification with Anypoint Code Builder
2+
:page-deployment-options: cloud-ide, desktop-ide
3+
4+
include::reuse::partial$beta-banner.adoc[tag="anypoint-code-builder"]
5+
6+
Anypoint Code Builder supports designing gRPC API specifications using Protocol Buffers 3 (Protobuf 3). Create and edit `.proto` files, import reusable Protobuf libraries from Anypoint Exchange, and use syntax highlighting and validation. gRPC uses HTTP/2 and supports four RPC patterns:
7+
8+
* Unary
9+
* Client streaming
10+
* Server streaming
11+
* Bidirectional streaming
12+
13+
You author service and message definitions in `.proto` files and can reuse shared types by importing Protobuf fragments (libraries) from Exchange.
14+
15+
== Before You Begin
16+
17+
* xref:start-acb.adoc[].
18+
* Understand the basics of gRPC and Protocol Buffers (Protobuf 3). See https://grpc.io/docs/what-is-grpc/introduction/[Introduction to gRPC] and the https://protobuf.dev/programming-guide/proto3/[Protocol Buffers 3 Language Guide].
19+
* Have some familiarity with xref:access-management::business-groups.adoc[].
20+
21+
== Create a New gRPC API Specification Project
22+
23+
To create a gRPC API spec project in Anypoint Code Builder:
24+
25+
include::partial$acb-reusable-steps.adoc[tags="open-ide"]
26+
27+
. From *Create*, click *Design an API*:
28+
. Complete the *API Specification* form:
29+
+
30+
[%header,cols="20a,60a"]
31+
|===
32+
| Field Name | Field Value
33+
34+
| *Project Name* | Unique name for your project.
35+
36+
This name is used as the API spec title in Exchange, the name of the spec file, and the name of the project's root directory.
37+
38+
include::partial$acb-reusable-steps.adoc[tags="no-project-name-reuse"]
39+
| *Project Location* | Your home directory or another directory you create.
40+
41+
See xref:start-add-folders.adoc[].
42+
43+
include::partial$acb-reusable-steps.adoc[tags="proj-directory-warn"]
44+
| *API Type* | The type of API spec to create.
45+
46+
Select *gRPC API* to create a gRPC project.
47+
48+
| *API Specification Language* | The language for the API specification.
49+
50+
Select *Protobuf 3* for gRPC API projects.
51+
|===
52+
. Click *Create Project*.
53+
+
54+
If prompted, trust the authors of the files in the folder.
55+
+
56+
When the project is ready, the API project opens with a default `.proto` file in the Editor view.
57+
+
58+
. Continue designing your gRPC API spec.
59+
+
60+
As you enter elements, use xref:start-discover-ui.adoc#auto-complete[auto-complete] (or press Ctrl+Space) to display available options within the context.
61+
62+
== Organize gRPC API Projects and Dependencies
63+
64+
A new gRPC API project includes a root `.proto` file (for example, `main.proto` or a file named after your project) that defines your service and messages.
65+
66+
Edit the main `.proto` file to define `service`, `rpc`, and `message` blocks. To reuse shared types, add new `.proto` files in the same project and import them. You can also add a Protobuf fragment as a dependency from Exchange and import it in your specification.
67+
68+
== Publish a gRPC Fragment to Exchange
69+
70+
Publish reusable `.proto` definitions as a fragment to Anypoint Exchange so other gRPC API specifications can import them as dependencies.
71+
72+
A fragment contains shared definitions such as `message` or `enum` blocks.
73+
74+
=== Publish the Fragment
75+
76+
To publish a gRPC fragment to Exchange:
77+
78+
. Ensure that you're logged in to Anypoint Platform.
79+
. Open the project that contains your reusable `.proto` files.
80+
. From the IDE, select the publish action.
81+
. When prompted:
82+
+
83+
* Select the business group.
84+
* Provide the asset name and version.
85+
* Add any required metadata.
86+
. Confirm the publication.
87+
88+
After publishing, the fragment appears in Exchange as an API Fragment asset and can be added as a dependency to other gRPC API specification projects.
89+
90+
To use the fragment in another gRPC API specification:
91+
92+
. Add the fragment as a dependency from Exchange.
93+
. Import the corresponding `.proto` file in your main specification.
94+
. Validate that all references resolve correctly.
95+
96+
== Import a Protobuf Library from Anypoint Exchange
97+
98+
Import reusable Protobuf libraries (fragments) from Anypoint Exchange and add them as dependencies to your gRPC API project. You can reuse messages and services across multiple specifications.
99+
100+
To use a Protobuf fragment published to Exchange:
101+
102+
. Ensure you're logged in to Anypoint Platform.
103+
. Open your gRPC API project.
104+
. Open the Command Palette (Cmd+Shift+P on macOS or Ctrl+Shift+P on Windows).
105+
. Select *MuleSoft: Add Fragment dependency from Exchange*.
106+
. Search for the Protobuf fragment you need and select the version to add.
107+
. After the dependency is added, the library is available under the project.
108+
. In your main `.proto` file, use `import` to reference the library's package and message or service definitions. For example:
109+
+
110+
[source,protobuf]
111+
----
112+
syntax = "proto3";
113+
114+
import "path/to/library.proto";
115+
116+
service MyService {
117+
rpc GetOrder(OrderRequest) returns (OrderResponse);
118+
}
119+
----
120+
. Save the spec. Anypoint Code Builder resolves the dependency and validates references. You can reuse messages and services from the imported library across your gRPC specs.
121+
122+
== Define Technical Details for gRPC Specifications
123+
124+
Specify RPC communication patterns in your service definitions and use built-in validation to verify your Protobuf specification.
125+
126+
=== Declare Communication Patterns for gRPC Services
127+
128+
Anypoint Code Builder and Mule runtime support all four gRPC RPC patterns:
129+
130+
* **Unary** – Single request, single response.
131+
* **Client streaming** – Client sends a stream of messages; server returns a single response.
132+
* **Server streaming** – Client sends a single request; server returns a stream of messages.
133+
* **Bidirectional streaming** – Both client and server send and receive streams of messages.
134+
135+
Define these in your `.proto` file using the appropriate `rpc` declarations and stream modifiers.
136+
137+
=== Verify Specification Accuracy with Syntax Validation
138+
139+
Anypoint Code Builder provides syntax highlighting and validation for Protobuf 3 specifications. Validation is performed using the API Modeling Framework (AMF) parser, so you get inline feedback and error reporting as you edit your `.proto` files. Use the editor and the xref:start-open-output-panel.adoc[output panel] to track validation and scaffolding status.
140+
141+
== See Also
142+
143+
// TODO: Include a link to gRPC Connector docs.
144+
* xref:start-acb.adoc[]
145+
* xref:imp-implement-grpc-api-spec.adoc[]
146+
* xref:des-designing-api-specs.adoc[]
147+
* xref:des-create-api-specs.adoc[]
148+
* xref:des-create-api-fragments.adoc[]
149+
* xref:des-publish-grpc-api-to-exchange.adoc[]
150+
* xref:des-publish-api-spec-to-exchange.adoc[]
151+
* xref:start-discover-ui.adoc#use-autocomplete[Use Auto-Complete in the Editors]

0 commit comments

Comments
 (0)