Steps to Generate Generate a gRPC connector from a Proto definition¶ This section explains how to generate a gRPC connector from a .proto file using the WSO2 Integrator: MI Connector Generator tool. The gRPC connector enables seamless communication between services, facilitating integration with systems that expose gRPC APIs. By utilizing a .proto file, which defines the service and message structure, the connector is automatically generated, allowing you to implement a fully functional gRPC client in your integration. Prerequisites¶ Before you begin, ensure you have the following: Java Development Kit (JDK) 8 or later Apache Maven 3.6.x or higher Steps to generate the connector¶ There are two ways of generating a gRPC connector from a .proto file: Using the WSO2 Integrator: MI for VS Code extension: This method allows you to generate a connector directly from the VS Code IDE. Using the WSO2 MI Connector Tooling: This method involves using a command-line tool to generate the connector from a .proto file. Option 01: Using the WSO2 Integrator: MI for VS Code extension¶ Follow the steps below to generate the gRPC connector: Launch Visual Studio Code with the MI for VS Code extension installed. Info Follow the Install WSO2 Integrator: MI for VS Code documentation for a complete installation guide. Create a new integration project. Click Create New Project on WSO2 Integrator: MI Project Explorer. For more options to create a new integration project, see Create an Integration Project. Navigate to the Project Overview page. Add a new artifact by clicking on Add artifact. Click on + View More under Create an Integration. Select Connections under Other Artifacts to open the Connector Store form. Click on the For gRPC (Proto) Then select a location for the .proto file and click the import If the given proto file is valid, You can view the generated connection type in the Connections. To use the connector operations, you can create an integration artifact (such as API and sequence) and add it from the Mediator Palette. Option 02: Using the WSO2 MI Connector Tooling¶ Follow the steps below to generate the gRPC connector: Fork the MI connector tooling repository Fork the esb-connector-tooling repository. Build the project using maven Navigate to your project directory (<PROJECT_HOME>/) and build the project using Maven: mvn clean install Locate the tool Once built, the tool will be packaged as a zip file: mi-connector-generator-{version}.zip. You can find this file in the <PROJECT_HOME>/target directory. Extract the tool Extract the mi-connector-generator-{version}.zip file to your preferred location. Run the connector generator Navigate to the extracted folder and go to the bin directory. For macOS/Linux: Use generate.sh: ./generator <proto-file> <output-directory> [miVersion] For Windows: Use generate.bat: generator.bat <proto-file> <output-directory> [miVersion] Replace: <proto-file> with the path to your .proto file. <output-directory> with the path where you want the connector to be generated. [miVersion] with your specific WSO2 Integrator: MI version. Example command¶ For macOS/Linux: ./generator /path/to/order-service.proto /path/to/output-directory 4.7.0 For Windows: generator.bat C:\path\to\order-service.proto C:\path\to\output-directory 4.7.0 By following these steps, you can generate a fully functional gRPC connector from a .proto file, enabling seamless integration with gRPC-based services in WSO2 Integrator: MI. Steps to import generated connector¶ Navigate to the Mediator Palette page Select the Add Module under the Mediator Palette. Select Import Module Select Location to upload the generated connector. After providing the generated connector zip file, click Import You can view the connector type in the Connections To use the connector operations, you can create an integration artifact (such as API and sequence) and add it from the Mediator Palette. Note The gRPC Connector Generator does not yet handle: Streaming RPCs : server, client, or bidirectional streams Custom .proto options: e.g., deadline, any other non-standard option fields Specific data types: oneof unions and deeply nested complex structures For the full list of features the tool does support, see the gRPC generator tool specification guide.