# mulesoft gRPC Connector - Full Documentation --- product: gRPC Connector version: 1.0 is-latest-version: true --- # gRPC Connector 1.0 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Connector for gRPC (gRPC Connector) enables you to connect to the gRPC API. gRPC Connector enables Mule applications to communicate with gRPC services, providing both client and server capabilities for high-performance, cross-platform RPC communication. For information about compatibility and fixed issues, refer to the gRPC Connector Release Notes. ## Before You Begin To use this connector, you must be familiar with: - The gRPC Connector’s API - Anypoint Connectors - Mule runtime engine (Mule) - Elements and global elements in a Mule flow - How to create a Mule app using Anypoint Code Builder or Anypoint Studio Before creating an app, you must have: - Credentials to access the gRPC target resource - Anypoint Platform - The latest versions of Anypoint Code Builder or Anypoint Studio ## Supported gRPC Patterns This connector supports all four gRPC communication patterns.
PatternDescription

Unary

Single request, single response

Server Streaming

Single request, multiple responses streamed from server

Client Streaming

Multiple requests from client, single response

Bidirectional Streaming

Multiple requests and responses streamed in both directions

## Key Capabilities - Protocol Buffer Support Native support for protobuf descriptor files (`.desc`) - Dynamic Metadata Resolution Automatic type resolution based on IDL definitions - Connection Management Managed channels with connection pooling and validation - Conversation Management Support for stateful streaming conversations - Async Operations Non-blocking asynchronous operation execution - TLS Support Configurable TLS/SSL for secure connections - Custom Headers Support for default headers on connections - Custom Status Codes Server sources can return a specific gRPC status code and description to the client ## Architecture ### Component Diagram ![A flowchart illustrating the architecture of a gRPC connector within a Mule application as it communicates with a gRPC server](/mulesoft/current/en-us/grpc-connector/latest/_images/grpc-connector-architecture.png) ### Conversation Management The connector maintains stateful conversations for streaming operations: - Server Conversations Maps `conversationId` to `ServerConversation` containing shared FrameWrapperQueue for multiple streaming requests - Client Conversations Maps conversationId to ClientConversation with request observer and response future - Bidirectional Conversations Maps `conversationId` to `BidiConversation` for bidirectional streaming with request or response observers ## Next Step After you complete the prerequisites, you’re ready to create an app and configure the connector using [Anypoint Studio](https://docs.mulesoft.com/grpc-connector/latest/grpc-connector-studio) or [Anypoint Code Builder](https://docs.mulesoft.com/grpc-connector/latest/grpc-connector-acb). ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Use Exchange to Discover Connectors, Templates, and Examples](https://docs.mulesoft.com/connectors/introduction/intro-use-exchange) - [gRPC Connector Reference](https://docs.mulesoft.com/grpc-connector/latest/grpc-connector-reference) - [Salesforce Help](https://help.salesforce.com) --- product: gRPC Connector version: 1.0 is-latest-version: true --- # gRPC Connector 1.0 Reference > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Connector for gRPC (gRPC Connector) enables you to connect to the gRPC API. ## Configurations --- ### Client Client configuration for connecting to gRPC services. #### Parameters
NameTypeDescriptionDefault ValueRequired

Name

String

The name for this configuration. Connectors reference the configuration with this name.

x

Connection

The connection types to provide to this configuration.

x

Deadline

Deadline configuration for gRPC calls. This deadline applies to all operations unless overridden at the operation level.

Response Wait Time

Number

Time to wait for server response after sending each message in client streaming. Overridable at the operation level. A value of 0 means no wait (return immediately with an empty continuation response).

0

Response Wait Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Response Wait Time field.

MILLISECONDS

Name

String

The identifier of this element used to reference it in other components.

x

Expiration Policy

Configures the minimum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration. This doesn’t mean that the platform expires the instance at the exact moment that it becomes eligible. Mule purges the instances as appropriate.

#### Connection Types ##### Google Service Account Auth Provider Use when the gRPC server expects Google-style service account auth (such as Google Cloud). ###### Parameters
NameTypeDescriptionDefault ValueRequired

Host

String

The host address of the gRPC server.

x

Port

Number

The port number of the gRPC server.

443

IDL Definition

One of:

The Interface Definition Language (IDL) definition for the gRPC service.

x

Request headers

Object

Request headers to include in gRPC requests.

Connection Timeout

Number

The timeout for establishing connections to the remote service.

30

Connection Timeout Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Connection Timeout field.

SECONDS

Connection Mode

One of:

Connection mode: TLS (default, for production) or PlainText (for development). If not specified, TLS with default settings is used automatically.

x

Private key id

String

Identifier of the private key for the service account. Part of service credentials.

x

Client id

String

Identifier of the client. Part of service credentials.

x

Client email

String

Client email for the service account. Part of service credentials.

x

Private key

One of:

Private key for the service account. Part of service credentials. Can be provided as text or from a file.

x

Reconnection

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.

##### No Auth Use when the gRPC server does not require authentication (such as local or internal services). ###### Parameters
NameTypeDescriptionDefault ValueRequired

Host

String

The host address of the gRPC server.

x

Port

Number

The port number of the gRPC server.

443

IDL Definition

One of:

The Interface Definition Language (IDL) definition for the gRPC service.

x

Request headers

Object

Custom headers to include in gRPC requests.

Connection Timeout

Number

The timeout for establishing connections to the remote service.

30

Connection Timeout Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Connection Timeout field.

SECONDS

Connection Mode

One of:

Connection mode: TLS (default, for production) or PlainText (for development). If not specified, TLS with default settings is used automatically.

x

Reconnection

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.

##### Oauth Client Credentials Use OAuth 2.0 to delegate user authentication to the service hosting the user account. For more information, refer to [Configuring OAuth 2.0 for Connectors](https://docs.mulesoft.com/connectors/introduction/intro-config-oauth2), [Configuring OAuth 2.0 for Connectors on CloudHub](https://docs.mulesoft.com/connectors/introduction/intro-config-oauth2-cloudhub), or [OAuth Support in the SDK](https://docs.mulesoft.com/mule-sdk/latest/oauth). Use when the gRPC server expects OAuth 2.0 client credentials. The connector obtains a token and sends it in the authorization header. ###### Parameters
NameTypeDescriptionDefault ValueRequired

Host

String

The host address of the gRPC server.

x

Port

Number

The port number of the gRPC server.

443

IDL Definition

One of:

The Interface Definition Language (IDL) definition for the gRPC service.

x

Request headers

Object

Custom headers to include in gRPC requests.

Connection Timeout

Number

The timeout for establishing connections to the remote service.

30

Connection Timeout Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Connection Timeout field.

SECONDS

Connection Mode

One of:

Connection mode: TLS (default, for production) or PlainText (for development). If not specified, TLS with default settings is used automatically.

x

Authorization Key

String

The header key used for authorization.

Authorization

Reconnection

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.

Client Id

String

The OAuth client ID as registered with the service provider.

x

Client Secret

String

The OAuth client secret as registered with the service provider.

x

Token Url

String

The service provider’s token endpoint URL.

https://example.com/oauth2/token

Scopes

String

The OAuth scopes to be requested during the dance. If not provided, it defaults to those in the annotation.

Auth Server Tls Context

References a TLS config to use to do HTTP request during the OAuth dance.

Auth Server Proxy Config

Any

References the proxy configuration which through the HTTP request during the OAuth dance.

Object Store

String

A reference to the object store that should be used to store each resource owner id’s data. If not specified, runtime will automatically provision the default one.

## Supported Operations - [\[Client\] Bidirectional Stream Message](#BidirectionalStreaming) - [\[Client\] Client Streaming Call](#ClientStreaming) - [\[Client\] Server Stream Message](#ServerStreamingCallWithDelegation) - [\[Client\] Iterate Server Stream Message](#ServerStreamingCallWithResponse) - [\[Client\] Unary Message](#UnaryCall) - [Unauthorize](#Unauthorize) ## Associated Sources - [\[Client\] Bidirectional Stream Listener](#BidiStreamingListener) - [\[Client\] Server Stream Listener](#ServerStreamingDelegatedListener) - [\[Client\] Server Stream Subscriber](#ServerStreamingSubscriberSource) --- ### GRPC Server Configuration Server configuration for exposing gRPC methods. #### Parameters
NameTypeDescriptionDefault ValueRequired

Name

String

The name for this configuration. Connectors reference the configuration with this name.

x

Connection

The connection to provide to this configuration.

x

Max Inbound Message Size

Number

Maximum size of an inbound message in bytes (default: 4MB, same as gRPC-Java). Must be a positive value.

4194304

Name

String

The identifier of this element used to reference it in other components.

x

#### Connection Types ##### Grpc Server Reference an `` for the gRPC endpoint and provide the protobuf descriptor for your service. ###### Parameters
NameTypeDescriptionDefault ValueRequired

Listener Config

String

Reference to the <http:listener-config> used to expose the gRPC server endpoint.

x

IDL Definition

Protobuf descriptor definition for the gRPC service.

x

Reconnection

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.

## Supported Operations - [\[Server\] End Stream](#EndStream) - [\[Server\] Respond Server Stream Message](#SendStreamMessage) ## Associated Sources - [\[Server\] Bidirectional Streaming Listener](#BidirectionalStreamingMethod) - [\[Server\] Client Stream Listener](#ClientStreamingMethod) - [\[Server\] Server Stream Listener](#ServerStreamingMethod) - [\[Server\] Unary Listener](#UnaryMethod) ## Operations ## \[Client\] Bidirectional Stream Message `` Connect to a Bidirectional Streaming RPC. This operation initiates a request, and its responses are collected by the corresponding [\[Client\] Bidirectional Stream Listener](#BidiStreamingListener). [\[Client\] Bidirectional Stream Message](#BidirectionalStreaming) and [\[Client\] Bidirectional Stream Listener](#BidiStreamingListener) are mapped to each other via **Routing ID**. This operation can be used to initiate the client up-stream, send requests, and also close the client up-stream. Each of these client steps can be mapped using a common request ID. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Method

String

The gRPC method name to invoke.

x

Routing Id

String

Identifier to map this call with its corresponding listener.

Request Id

String

Identifier to map related client streaming steps.

Content

Binary

The request payload to send to the gRPC server.

End Streaming

Boolean

Indicates whether to close the client streaming.

false

Request Headers

Object

Custom headers to include in the gRPC request.

Deadline

Configures the deadline for this specific gRPC call. Overrides the configuration-level deadline if specified.

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

Reconnection Strategy

A retry strategy in case of connectivity errors.

### Output

Type

String

### For Configurations - [Client](#Client) ### Throws - GRPC:ABORTED - GRPC:ALREADY\_EXISTS - GRPC:CANCELLED - GRPC:CONNECTIVITY - GRPC:DATA\_LOSS - GRPC:DEADLINE\_EXCEEDED - GRPC:FAILED\_PRECONDITION - GRPC:GRPC\_UNKNOWN - GRPC:INTERNAL - GRPC:INVALID\_ARGUMENT - GRPC:NOT\_FOUND - GRPC:OUT\_OF\_RANGE - GRPC:PERMISSION\_DENIED - GRPC:RESOURCE\_EXHAUSTED - GRPC:RETRY\_EXHAUSTED - GRPC:TRANSFORMATION - GRPC:UNAUTHENTICATED - GRPC:UNAVAILABLE - GRPC:UNIMPLEMENTED - GRPC:VALIDATION ## \[Client\] Client Streaming Call `` Connect to a Client Streaming RPC. This single operation can be used to initiate streaming, send requests, and close the client streaming request. Each of these steps is correlated via a common request ID. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Method

String

The gRPC method name to invoke.

x

Request Id

String

Identifier to map related client streaming steps.

Content

Binary

The request payload to send to the gRPC server.

End Streaming

Boolean

Indicates whether to close the client streaming.

false

Request Headers

Object

Custom headers to include in the gRPC request.

Deadline

Configures the deadline for this specific gRPC call. Overrides the configuration-level deadline if specified.

Response Wait Time

Number

Time to wait for server response after sending each message. Overrides the configuration-level value if specified.

Response Wait Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Response Wait Time field.

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

Reconnection Strategy

A retry strategy in case of connectivity errors.

### Output

Type

Binary

Attributes Type

### For Configurations - [Client](#Client) ### Throws - GRPC:ABORTED - GRPC:ALREADY\_EXISTS - GRPC:CANCELLED - GRPC:CONNECTIVITY - GRPC:DATA\_LOSS - GRPC:DEADLINE\_EXCEEDED - GRPC:FAILED\_PRECONDITION - GRPC:GRPC\_UNKNOWN - GRPC:INTERNAL - GRPC:INVALID\_ARGUMENT - GRPC:NOT\_FOUND - GRPC:OUT\_OF\_RANGE - GRPC:PERMISSION\_DENIED - GRPC:RESOURCE\_EXHAUSTED - GRPC:RETRY\_EXHAUSTED - GRPC:TRANSFORMATION - GRPC:UNAUTHENTICATED - GRPC:UNAVAILABLE - GRPC:UNIMPLEMENTED - GRPC:VALIDATION ## \[Client\] Server Stream Message `` Connect to a Server Streaming RPC. This operation initiates a request, and its responses are collected by the corresponding Server Streaming Delegated Listener. The Server Streaming Delegator and Server Streaming Delegated Listener are mapped to each other via the routing ID. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Method

String

The gRPC method name to invoke.

x

Routing Id

String

Identifier to map this call with its corresponding listener.

x

Content

Binary

The request payload to send to the gRPC server.

#[payload]

Request Headers

Object

Custom headers to include in the gRPC request.

Deadline

Configures the deadline for this specific gRPC call. Overrides the configuration-level deadline if specified.

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

Reconnection Strategy

A retry strategy in case of connectivity errors.

### Output

Type

String

### For Configurations - [Client](#Client) ### Throws - GRPC:ABORTED - GRPC:ALREADY\_EXISTS - GRPC:CANCELLED - GRPC:CONNECTIVITY - GRPC:DATA\_LOSS - GRPC:DEADLINE\_EXCEEDED - GRPC:FAILED\_PRECONDITION - GRPC:GRPC\_UNKNOWN - GRPC:INTERNAL - GRPC:INVALID\_ARGUMENT - GRPC:NOT\_FOUND - GRPC:OUT\_OF\_RANGE - GRPC:PERMISSION\_DENIED - GRPC:RESOURCE\_EXHAUSTED - GRPC:RETRY\_EXHAUSTED - GRPC:TRANSFORMATION - GRPC:UNAUTHENTICATED - GRPC:UNAVAILABLE - GRPC:UNIMPLEMENTED - GRPC:VALIDATION ## \[Client\] Iterate Server Stream Message `` Connect to a Server Streaming RPC. This operation returns a StreamedResponseIterable to iterate over server response-stream. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Method

String

The gRPC method name to invoke.

x

Content

Binary

The request payload to send to the gRPC server.

#[payload]

Request Headers

Object

Custom headers to include in the gRPC request.

Deadline

Configures the deadline for this specific gRPC call. Overrides the configuration-level deadline if specified.

Poll Timeout (milliseconds)

Number

The timeout, in milliseconds, when polling for the next streamed response element.

500

Output Mime Type

String

The mime type of the payload that this operation outputs.

Output Encoding

String

The encoding of the payload that this operation outputs.

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Target Variable

String

Name of the variable that stores operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

Reconnection Strategy

A retry strategy in case of connectivity errors.

### Output

Type

Array of Binary

### For Configurations - [Client](#Client) ### Throws - GRPC:ABORTED - GRPC:ALREADY\_EXISTS - GRPC:CANCELLED - GRPC:CONNECTIVITY - GRPC:DATA\_LOSS - GRPC:DEADLINE\_EXCEEDED - GRPC:FAILED\_PRECONDITION - GRPC:GRPC\_UNKNOWN - GRPC:INTERNAL - GRPC:INVALID\_ARGUMENT - GRPC:NOT\_FOUND - GRPC:OUT\_OF\_RANGE - GRPC:PERMISSION\_DENIED - GRPC:RESOURCE\_EXHAUSTED - GRPC:RETRY\_EXHAUSTED - GRPC:TRANSFORMATION - GRPC:UNAUTHENTICATED - GRPC:UNAVAILABLE - GRPC:UNIMPLEMENTED - GRPC:VALIDATION ## \[Client\] Unary Message `` Invokes a standard gRPC method that accepts a single request and returns a single response. Use this operation to perform an individual, one-off gRPC call to a remote service method. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Method

String

A String object.

x

Content

Binary

An InputStream object.

#[payload]

Request Headers

Object

Custom headers to include in the gRPC request.

Deadline

Configures the deadline for this specific gRPC call. Overrides the configuration-level deadline if specified.

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Target Variable

String

Name of the variable that stores operation’s output.

Target Value

String

An expression to evaluate against the operation’s output and store the expression outcome in the target variable.

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

Reconnection Strategy

A retry strategy in case of connectivity errors.

### Output

Type

Binary

### For Configurations - [Client](#Client) ### Throws - GRPC:ALREADY\_EXISTS - GRPC:CONNECTIVITY - GRPC:DATA\_LOSS - GRPC:DEADLINE\_EXCEEDED - GRPC:FAILED\_PRECONDITION - GRPC:GRPC\_UNKNOWN - GRPC:INTERNAL - GRPC:INVALID\_ARGUMENT - GRPC:NOT\_FOUND - GRPC:OUT\_OF\_RANGE - GRPC:PERMISSION\_DENIED - GRPC:RESOURCE\_EXHAUSTED - GRPC:RETRY\_EXHAUSTED - GRPC:TRANSFORMATION - GRPC:UNAUTHENTICATED - GRPC:UNAVAILABLE - GRPC:UNIMPLEMENTED - GRPC:VALIDATION ## Unauthorize `` Deletes all the access token information of a given resource owner ID so that it’s impossible to execute any operation for that user without doing the authorization dance again. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

### For Configurations - [Client](#Client) ## \[Server\] End Stream `` Ends the streaming response. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Attributes

Streaming attributes from the server streaming source.

x

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Error Mappings

Array of Error Mapping

Set of error mappings.

### For Configurations - [GRPC Server Configuration](#Server) ## \[Server\] Respond Server Stream Message `` Sends a message in a streaming response. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Attributes

Streaming attributes from the server streaming source.

x

Stream Message

Any

The message content to send to the client.

#[payload]

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Error Mappings

Array of Error Mapping

Set of error mappings.

### For Configurations - [GRPC Server Configuration](#Server) ## Sources ## \[Client\] Bidirectional Stream Listener `` Connects to a Bidirectional Streaming RPC. Server responses from the corresponding [\[Client\] Bidirectional Stream Message](#BidirectionalStreaming) are collected here. [\[Client\] Bidirectional Stream Message](#BidirectionalStreaming) and [\[Client\] Bidirectional Stream Listener](#BidiStreamingListener) are mapped to each other via **Routing ID**. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Routing ID

String

Identifier to map this listener with its corresponding call.

x

Primary Node Only

Boolean

Whether this source should only be executed on the primary node when running in a cluster.

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Redelivery Policy

Defines a policy for processing the redelivery of the same message.

Reconnection Strategy

A retry strategy in case of connectivity errors.

### Output

Type

Binary

Attributes Type

### For Configurations - [Client](#Client) ## \[Client\] Server Stream Listener `` Connects to a Server Streaming RPC. Server responses from the corresponding Server Streaming Delegator are collected here. The Server Streaming Delegator and Server Streaming Delegated Listener are mapped to each other via the routing ID. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Routing ID

String

Identifier to map this listener with its corresponding delegator.

x

Primary Node Only

Boolean

Whether this source should only be executed on the primary node when running in a cluster.

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Redelivery Policy

Defines a policy for processing the redelivery of the same message.

Reconnection Strategy

A retry strategy in case of connectivity errors.

### Output

Type

Binary

Attributes Type

### For Configurations - [Client](#Client) ## \[Client\] Server Stream Subscriber `` Connect to a Server Streaming RPC. This source acts as a subscriber by sending the request when it starts. The request is provided at design time through the payload attribute. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Method

String

The gRPC method name to invoke.

x

Request Headers

Object

Custom headers to include in the gRPC request.

Deadline

Configures the deadline for this specific gRPC call. Overrides the configuration-level deadline if specified.

Primary Node Only

Boolean

Whether this source should only be executed on the primary node when running in a cluster.

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Redelivery Policy

Defines a policy for processing the redelivery of the same message.

File Path

String

The path to the file containing the request payload.

x

Reconnection Strategy

A retry strategy in case of connectivity errors.

### Output

Type

Binary

### For Configurations - [Client](#Client) ## \[Server\] Bidirectional Streaming Listener `` This source handles multiple client requests and produces multiple server responses. In bidirectional streaming: - The client sends multiple messages (independently). - The server sends multiple responses (independently). - Both streams operate independently and can send or receive messages at any time. Flow Execution Model: - The flow executes once per client message (automatic iteration; execution might be in parallel for different messages). - A shared `streamState` map (`Map`) persists across all flow executions for the same stream. - Each flow execution returns a response as the payload and can update state via ``. - When the client completes sending messages, the flow is executed one last time with `clientStreamCompleted=true`. Example Use Cases: - Interactive Processing (such as market ticker subscriptions) - Client sends subscription requests. - Server responds with price updates as they change. - Client-controlled Streaming (such as paginated data export) - Client sends flow control tokens. - Server sends data chunks on demand. Example usage in a Mule flow: ```xml ``` ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Method Name

String

The fully qualified gRPC method name to listen on (for example, market.Market/SubscribeTickers).

x

Output Mime Type

String

The mime type of the payload that this source outputs.

Output Encoding

String

The encoding of the payload that this source outputs.

Primary Node Only

Boolean

Whether this source should only be executed on the primary node when running in a cluster.

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Redelivery Policy

Defines a policy for processing the redelivery of the same message.

Reconnection Strategy

A retry strategy in case of connectivity errors.

Stream Output

Output parameter group for bidirectional streaming responses.

Status Code

String

The gRPC status the client should receive. Preferably the code name (for example, NOT_FOUND), which is self-documenting and validated against io.grpc.Status.Code. The numeric value (for example, 5) is also accepted. When unset, unrecognized, or OK, the original error cause is propagated and the client receives UNKNOWN.

Description

String

The gRPC status description (message) the client should receive. When unset, the error’s own description is used.

### Output

Type

Any

Attributes Type

### For Configurations - [GRPC Server Configuration](#Server) ## \[Server\] Client Stream Listener `` This source handles multiple client requests and produces a single response. In client streaming, the client sends a stream of requests and the server responds with a single response after processing all the requests. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Method Name

String

The fully qualified gRPC method name to listen on (for example, retail.Retail/StreamItems).

x

Output Mime Type

String

The mime type of the payload that this source outputs.

Output Encoding

String

The encoding of the payload that this source outputs.

Primary Node Only

Boolean

Whether this source should only be executed on the primary node when running in a cluster.

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Redelivery Policy

Defines a policy for processing the redelivery of the same message.

Reconnection Strategy

A retry strategy in case of connectivity errors.

Output

Output structure for client streaming methods.

Status Code

String

The gRPC status the client should receive. Preferably the code name (for example, NOT_FOUND), which is self-documenting and validated against io.grpc.Status.Code. The numeric value (for example, 5) is also accepted. When unset, unrecognized, or OK, the original error cause is propagated and the client receives UNKNOWN.

Description

String

The gRPC status description (message) the client should receive. When unset, the error’s own description is used.

### Output

Type

Any

Attributes Type

### For Configurations - [GRPC Server Configuration](#Server) ## \[Server\] Server Stream Listener `` This source handles a single client request and produces multiple responses. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Method Name

String

The fully qualified gRPC method name to listen on (for example, retail.Retail/PriceItemStream).

x

Output Mime Type

String

The mime type of the payload that this source outputs.

Output Encoding

String

The encoding of the payload that this source outputs.

On Capacity Overload

Enumeration, one of:

  • WAIT

  • DROP

Strategy applied when the flow receives more messages than it has capacity to handle.

WAIT

Primary Node Only

Boolean

Whether this source should only be executed on the primary node when running in a cluster.

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Redelivery Policy

Defines a policy for processing the redelivery of the same message.

Reconnection Strategy

A retry strategy in case of connectivity errors.

Status Code

String

The gRPC status the client should receive. Preferably the code name (for example, NOT_FOUND), which is self-documenting and validated against io.grpc.Status.Code. The numeric value (for example, 5) is also accepted. When unset, unrecognized, or OK, the original error cause is propagated and the client receives UNKNOWN.

Description

String

The gRPC status description (message) the client should receive. When unset, the error’s own description is used.

### Output

Type

Any

Attributes Type

### For Configurations - [GRPC Server Configuration](#Server) ## \[Server\] Unary Listener `` This source handles a single client request and produces a single response. ### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Method Name

String

The fully qualified gRPC method name to listen on (for example, retail.Retail/GetItem).

x

Output Mime Type

String

The mime type of the payload that this source outputs.

Output Encoding

String

The encoding of the payload that this source outputs.

Primary Node Only

Boolean

Whether this source should only be executed on the primary node when running in a cluster.

Config Ref

ConfigurationProvider

The name of the configuration to use to execute this component.

x

Streaming Strategy

Configures how Mule processes streams. Repeatable streams are the default behavior.

Redelivery Policy

Defines a policy for processing the redelivery of the same message.

Reconnection Strategy

A retry strategy in case of connectivity errors.

Response Unary

Binary

The response content to send to the client.

#[payload]

Status Code

String

The gRPC status the client should receive. Preferably the code name (for example, NOT_FOUND), which is self-documenting and validated against io.grpc.Status.Code. The numeric value (for example, 5) is also accepted. When unset, unrecognized, or OK, the original error cause is propagated and the client receives UNKNOWN.

Description

String

The gRPC status description (message) the client should receive. When unset, the error’s own description is used.

### Output

Type

Any

Attributes Type

### For Configurations - [GRPC Server Configuration](#Server) ## Types ### Reconnection Configures a reconnection strategy for an operation.
FieldTypeDescriptionDefault ValueRequired

Fails Deployment

Boolean

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.

Reconnection Strategy

The reconnection strategy to use.

### Reconnect Configures a standard reconnection strategy, which specifies how often to reconnect and how many reconnection attempts the connector source or operation can make.
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often in milliseconds to reconnect.

Blocking

Boolean

If false, the reconnection strategy will run in a separate, non-blocking thread.

Count

Number

How many reconnection attempts to make.

### Reconnect Forever Configures a forever reconnection strategy by which the connector source or operation attempts to reconnect at a specified frequency for as long as the Mule app runs.
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often in milliseconds to reconnect.

Blocking

Boolean

If false, the reconnection strategy will run in a separate, non-blocking thread.

### TLS Configures TLS to provide secure communications for the Mule app.
FieldTypeDescriptionDefault ValueRequired

Enabled Protocols

String

A comma-separated list of protocols enabled for this context.

Enabled Cipher Suites

String

A comma-separated list of cipher suites enabled for this context.

Trust Store

Configuration for the trust store.

Key Store

Configuration for the key store.

Revocation Check

Configuration for certificate revocation checking.

### Trust Store Configures the truststore for TLS.
FieldTypeDescriptionDefault ValueRequired

Path

String

The location (which will be resolved relative to the current classpath and file system, if possible) of the trust store.

Password

String

The password used to protect the trust store.

Type

String

The type of store used.

Algorithm

String

The algorithm used by the trust store.

Insecure

Boolean

If true, Mule stops performing certificate validations. Setting this to true can make connections vulnerable to attacks.

### Key Store Configures the keystore for the TLS protocol. The keystore you generate contains a private key and a public certificate.
FieldTypeDescriptionDefault ValueRequired

Path

String

The location (which will be resolved relative to the current classpath and file system, if possible) of the key store.

Type

String

The type of store used.

Alias

String

When the key store contains many private keys, this attribute indicates the alias of the key that should be used. If not defined, the first key in the file will be used by default.

Key Password

String

The password used to protect the private key.

Password

String

The password used to protect the key store.

Algorithm

String

The algorithm used by the key store.

### Standard Revocation Check Configures standard revocation checks for TLS certificates.
FieldTypeDescriptionDefault ValueRequired

Only End Entities

Boolean

Only verify the last element of the certificate chain.

Prefer Crls

Boolean

Try CRL instead of OCSP first.

No Fallback

Boolean

Do not use the secondary checking method (the one not selected before).

Soft Fail

Boolean

Avoid verification failure when the revocation server can not be reached or is busy.

### Custom OCSP Responder Configures a custom OCSP responder for certification revocation checks.
FieldTypeDescriptionDefault ValueRequired

Url

String

The URL of the OCSP responder.

Cert Alias

String

Alias of the signing certificate for the OCSP response (must be in the trust store), if present.

### CRL File Specifies the location of the certification revocation list (CRL) file.
FieldTypeDescriptionDefault ValueRequired

Path

String

The path to the CRL file.

### Deadline Configures the deadline for gRPC calls. A deadline specifies the maximum duration for a gRPC operation to complete. If the operation exceeds this deadline, it is automatically cancelled.
FieldTypeDescriptionDefault ValueRequired

Duration

Number

The duration value for the deadline.

10

Units

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

The time unit for the Duration field.

SECONDS

### Expiration Policy Configures the maximum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.
FieldTypeDescriptionDefault ValueRequired

Max Idle Time

Number

A scalar time value for the maximum amount of time a dynamic configuration instance should be allowed to be idle before it’s considered eligible for expiration.

Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

A time unit for the Max Idle Time field.

### Server Streaming Attributes Represents attributes or metadata for streaming operations. This class provides channel and routing information for gRPC streaming calls.
FieldTypeDescriptionDefault ValueRequired

End Of Stream

Boolean

Indicates whether the stream has ended.

Error

Boolean

Indicates whether an error occurred during streaming.

Error Message

String

The error message if an error occurred.

Request Id

String

The request identifier.

Routing Id

String

The routing identifier.

### Repeatable In Memory Stream Configures the in-memory streaming strategy by which the request fails if the data exceeds the MAX buffer size. Always run performance tests to find the optimal buffer size for your specific use case.
FieldTypeDescriptionDefault ValueRequired

Initial Buffer Size

Number

The amount of memory that will be allocated to consume the stream and provide random access to it. If the stream contains more data than can be fit into this buffer, then the buffer expands according to the bufferSizeIncrement attribute, with an upper limit of maxInMemorySize.

Buffer Size Increment

Number

This is by how much the buffer size expands if it exceeds its initial size. Setting a value of zero or lower means that the buffer should not expand, meaning that a STREAM_MAXIMUM_SIZE_EXCEEDED error is raised when the buffer gets full.

Max Buffer Size

Number

The maximum amount of memory to use. If more than that is used then a STREAM_MAXIMUM_SIZE_EXCEEDED error is raised. A value lower than or equal to zero means no limit.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

The unit in which all these attributes are expressed.

### Repeatable File Store Stream Configures the repeatable file-store streaming strategy by which Mule keeps a portion of the stream content in memory. If the stream content is larger than the configured buffer size, Mule backs up the buffer’s content to disk and then clears the memory.
FieldTypeDescriptionDefault ValueRequired

In Memory Size

Number

Defines the maximum memory that the stream should use to keep data in memory. If more than that is consumed content on the disk is buffered.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

The unit in which In Memory Size is expressed.

### Redelivery Policy Configures the redelivery policy for executing requests that generate errors. You can add a redelivery policy to any source in a flow.
FieldTypeDescriptionDefault ValueRequired

Max Redelivery Count

Number

The maximum number of times a message can be redelivered and processed unsuccessfully before triggering process-failed-message.

Message Digest Algorithm

String

The secure hashing algorithm to use. If not set, the default is SHA-256.

Message Identifier

Defines which strategy is used to identify the messages.

Object Store

ObjectStore

The object store where the redelivery counter for each message is stored.

### Redelivery Policy Message Identifier Configures how to identify a redelivered message and how to find out when the message was redelivered.
FieldTypeDescriptionDefault ValueRequired

Use Secure Hash

Boolean

Whether to use a secure hash algorithm to identify a redelivered message.

Id Expression

String

Defines one or more expressions to use to determine when a message has been redelivered. This property may only be set if useSecureHash is false.

### Error Mapping Configures the error mapping.
FieldTypeDescriptionDefault ValueRequired

Source

Enumeration, one of:

  • ANY

  • REDELIVERY_EXHAUSTED

  • TRANSFORMATION

  • EXPRESSION

  • SECURITY

  • CLIENT_SECURITY

  • SERVER_SECURITY

  • ROUTING

  • CONNECTIVITY

  • RETRY_EXHAUSTED

  • TIMEOUT

The source error type to map.

Target

String

The target error type to map to.

x

### Client Streaming Attributes Represents attributes or metadata for client streaming operations. Returned with every client streaming operation response to indicate the current state of the conversation.
FieldTypeDescriptionDefault ValueRequired

End Of Stream

Boolean

Indicates whether the stream has ended.

Message Sent

Boolean

Indicates whether a message was sent in this step.

Request Id

String

The request identifier.

### Bidi Streaming Server Attributes Attributes for bidirectional streaming gRPC methods. Bidirectional streaming allows both client and server to send multiple messages independently. The client can send multiple requests while the server sends multiple responses. Key characteristics: - Flow executes once per client message (automatic iteration, parallel execution) - Flow can send 0, 1, or N responses per message using [\[Server\] Respond Server Stream Message](#SendStreamMessage). - Shared streamState map persists across all flow executions for state management - Final execution with `clientStreamCompleted=true` when client finishes sending Use cases: - Interactive processing (such as market ticker subscriptions) - Client sends subscription requests. - Server sends price updates as they change. - Client-controlled streaming (such as paginated data export) - Client sends flow control tokens. - Server sends data chunks on demand.
FieldTypeDescriptionDefault ValueRequired

Client Stream Completed

Boolean

Whether the client has finished sending (true on final execution).

Connection Id

String

Unique stream identifier.

Headers

Object

Inbound gRPC request metadata, with keys lowercased (for example, attributes.headers.authorization).

Message Count

Number

Total messages received so far.

Message Index

Number

Current message number (1-based).

Method Name

String

Fully qualified gRPC method name.

Stream State

Object

Shared state map across all messages (thread-safe ConcurrentHashMap).

Timestamp

DateTime

When the stream is initiated.

### Bidi Streaming Output Output parameter group for bidirectional streaming responses. This class captures both the response (body) and the updated streaming state from flow execution. The handler uses this to: 1. Send the response as the gRPC reply. 2. Update its local streamState with the returned values for the next message. Example usage in a Mule flow: ```xml { count: (attributes.streamState.count default 0) + payload.qty, amount: (attributes.streamState.amount default 0.0) + (payload.qty * payload.price) } ```
FieldTypeDescriptionDefault ValueRequired

Response

Binary

The response message to send to the client.

#[payload]

Stream State

Object

Updated streaming state to persist for the next message. Values set here are available in attributes.streamState for subsequent messages.

#[{}]

### Client Streaming Server Attributes Attributes for client streaming gRPC methods. Simplified to match apikit pattern: per-message execution with stream state.
FieldTypeDescriptionDefault ValueRequired

Headers

Object

Inbound gRPC request metadata, with keys lowercased (for example, attributes.headers.authorization).

Message Count

Number

Number of messages received so far.

Stream Completed

Boolean

Whether this is the final message in the stream. When true, the flow should return the final response.

Stream State

Object

Shared mutable state across all messages. The flow can read or update this map to maintain aggregated values.

### Client Streaming Output Output structure for client streaming methods, matching apikit pattern.
FieldTypeDescriptionDefault ValueRequired

Response

Binary

The response message to send to the client (only used on final execution when client stream completes).

#[payload]

Stream State a

Object

Updated stream state to persist across messages. Values set here are available as attributes.streamState in subsequent executions.

For Map<String, Object> types, Mule SDK automatically generates corresponding XML:

<grpc:stream-states><grpc:stream-state key="…​" value="…​"/></grpc:stream-states>

#[{}]

### Server Streaming Server Attributes Server-side attributes for server streaming gRPC methods. In server streaming, the client sends a single request, the Mule flow executes, and the server sends multiple responses using [\[Server\] Respond Server Stream Message](#SendStreamMessage) and [\[Server\] End Stream](#EndStream).
FieldTypeDescriptionDefault ValueRequired

Connection Id

String

Unique identifier for this streaming connection (used to route [Server] Respond Server Stream Message and [Server] End Stream).

Headers

Object

Inbound gRPC request metadata, with keys lowercased (for example, attributes.headers.authorization).

Method Name

String

Fully qualified gRPC method name (for example, retail.Retail/PriceItemStream).

### Unary Server Attributes Attributes for unary gRPC server sources. Available as `#[attributes]` in DataWeave expressions.
FieldTypeDescriptionDefault ValueRequired

Connection Id

String

Always an empty string for unary calls (no persistent stream).

Headers

Object

Inbound gRPC request metadata, with keys lowercased (for example, attributes.headers.authorization).

Method Name

String

Fully qualified gRPC method name (for example, retail.Retail/GetItem).

### Single Binary Protobuf Protobuf contract parameterization. Provides unified access to protobuf descriptors and metadata types for both client operations and server sources through the IdlDefinition interface.
FieldTypeDescriptionDefault ValueRequired

Protobuf Descriptor File

String

The path to the Protocol Buffer descriptor file.

x

### Private Key Text Private key provided as inline text.
FieldTypeDescriptionDefault ValueRequired

Key

String

The private key content.

x

### Private Key File Private key provided from a file.
FieldTypeDescriptionDefault ValueRequired

Private Key File Path

String

The path to the file containing the private key.

x

--- product: gRPC Connector version: 1.0 is-latest-version: true --- # gRPC Connector 1.0 XML and Maven Support > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Although you can manually code a Mule app in XML, it is more efficient to use Anypoint Code Builder or Studio: - If you manually code a Mule runtime engine (Mule) app in XML, either from the Anypoint Code Builder or Studio XML editor, or from a text editor, you can access the connector from your app by adding reference statements to both your XML Mule flow and the Apache Maven `pom.xml` file. - If you add the connector in Anypoint Code Builder or Studio, the XML is automatically populated the code with the connector’s namespace and schema location and it also adds a dependency to the `pom.xml` file. ## Add a Namespace for the Connector Paste the following code inside the `mule` tag of the header of your configuration XML: ```xml http://www.mulesoft.org/schema/mule/grpc http://www.mulesoft.org/schema/mule/grpc/current/mule-grpc.xsd ``` This example shows how the namespace statements are placed in the `` XML block: ```xml ``` ## Add a POM File Dependency The Apache Maven `pom.xml` file generated by Anypoint Studio contains dependencies for a Mule app. If you code a Mule app manually, include this XML snippet in your `pom.xml` file to enable access to this connector: ```xml com.mulesoft.connectors mule-grpc-connector x.x.x mule-plugin ``` Replace `x.x.x` with the version that corresponds to the connector you are using. To obtain the most up-to-date `pom.xml` file information: 1. Go to [Anypoint Exchange](https://www.mulesoft.com/exchange/). 2. In Exchange, click **Login** and supply your Anypoint Platform username and password. 3. In Exchange, search for `grpc`. 4. Select the connector. 5. Click **Dependency Snippets** near the upper right of the screen. ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Salesforce Help](https://help.salesforce.com) --- product: gRPC Connector version: 1.0 is-latest-version: true --- # Using Anypoint Code Builder to Configure gRPC Connector 1.0 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Cloud IDE (Beta) is scheduled for retirement on August 31, 2026. August 30, 2026 is the last day you can access Cloud IDE (Beta). Download your projects to work from Desktop IDE. Learn more in [Migrate a Project from Cloud IDE to Desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/int-import-mule-project#migrate-cloud-to-desktop). To use Anypoint Code Builder to configure a connector or module, create a basic integration project in Anypoint Code Builder, add connectors and other components to your Mule application to process your business logic, and configure the attributes. ## Before You Begin Before creating an integration project, you must: - [Set up and access the Anypoint Code Builder web or desktop IDE](https://docs.mulesoft.com/anypoint-code-builder/start-acb) - Have credentials to access the connector’s API - Ensure that the Visual Studio Code Extension Pack for Java is installed. To use this connector, you must be familiar with: - The connector’s API - Anypoint Connectors - Mule runtime engine (Mule) ## Create a New Integration Project To create a new integration project: 1. In the activity bar of the IDE, click the ![Anypoint Code Builder icon](/mulesoft/current/en-us/connectors/_images/acb-icon-ms-logo.png) (**Anypoint Code Builder**) icon. 2. From **Quick Actions**, click **Develop an Integration**: ![Develop an Integration link highlighted in the Getting started section](/mulesoft/current/en-us/anypoint-code-builder/_images/develop-integration-option-mat.png) 3. Complete the following in the **Develop an Integration** form:
AttributeValue

Project Name

Unique name for your project.

This name is used as the title and name of the integration project file. For example, if the project name is "Salesforce Integration," the project file name is salesforce-integration.

Project Location

Your home directory or another directory you create. Click Browse to select a different directory for the integration project.

Don’t create the project within another project directory.

4. Select the type of project to create by selecting either the **Empty Project** or **Template or Example** card. 5. Select the **Mule runtime** and **Java Version** for your app. 6. Click **Create Project**. ## Add the Connector to Your Integration Project Anypoint Connectors provide operations for retrieving, modifying, and sending data to and from systems. In addition to the [built-in connectors](https://docs.mulesoft.com/anypoint-code-builder/acb-reference#builtin-connectors) that Anypoint Code Builder provides, you can download many other connectors from Anypoint Exchange. To import a connector from Exchange and add it to your configuration: 1. In the Explorer view, open the configuration XML file for your project, such as `my-project-name.xml`. 2. Click the ![Show Mule graphical mode icon](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-tree-view.png) (**Show Mule graphical mode**) icon in the activity bar to open the canvas UI if it doesn’t open automatically. 3. Add the connector the same way you added other components from the canvas UI: 1. In the canvas UI, click the ![Add component icon](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-plus.png) (**Add component**) icon. 2. In the **Add Component** panel, click **Connectors**. 3. Click the connector name and then click the operation to add, such as **Publish**: ![Add Publish operation from Anypoint MQ Connector](/mulesoft/current/en-us/anypoint-code-builder/_images/int-add-connector-operation.png) If the connector is not available locally, click the ![Search in Exchange icon](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-search-exchange.png) (**Search in Exchange**) toggle: ![Search in Exchange toggle](/mulesoft/current/en-us/anypoint-code-builder/_images/int-connector-search-exchange.png)
1Search locally
2Search in Exchange
4. Select the connector to add to your project. 5. Select the operation from the **Add Component** panel. Adding a connector to an integration project does not make that connector available to other projects in your Anypoint Code Builder workspace. ## Configure the Source For the Flow A trigger (source) starts the flow when specified conditions are met. If a connector has its own associated sources, you can use a connector-specific trigger to initiate the flow. Each connector trigger has a unique configuration. You can configure the following sources for this connector: - **HTTP > Listener** Initiates a flow each time it receives a request on the configured host and port - **Scheduler** Initiates a flow when a time-based condition is met For example, to configure an HTTP Listener trigger, follow these steps: 1. Click the **Listener** component on the canvas UI. 2. (Optional) Click the edit icon to change the name of the **Listener** component. 3. (Optional) If you created a configuration file for the connector, select it. 4. In the **General** tab, in the **Path** field, enter the relative path for the path set in the HTTP configuration element. See [Configure Paths](https://docs.mulesoft.com/http-connector/latest/http-listener-ref#configure-paths). 5. Select the **Advanced** tab to configure the following attributes:
AttributeDescriptionRequired

Allowed methods

To allow all HTTP methods (default), do not define this attribute. To restrict certain methods, specify all allowed HTTP methods, for example, GET, POST, as a comma-separated list.

No

Response streaming mode

Whether to use streaming when the response is sent.

No

Output MIME type

MIME type of the payload that this component outputs.

No

Parameters

Appends a key-value pair for a reader property to the value of the Output MIME attribute. Multiple key-value pairs are allowed.

No

Output encoding

Encoding of the payload that this component outputs.

No

Streaming Strategy

Configures the way data streams are consumed in Mule apps.

No

Primary node only

Select this option to execute the Listener trigger on the primary node only when running in a cluster.

No

Redelivery policy

Configures the redelivery policy for executing requests that generate errors. You can add a redelivery policy to any source in a flow.

No

Reconnection strategy

When an operation in a Mule application fails to connect to an external server, the default behavior is for the operation to fail immediately and return a connectivity error. You can modify the default behavior by configuring the reconnection strategy for the operation.

No

Response

See HTTP Response Attributes.

No

Error Response

HTTP error response returns a status code for the error.

No

Body

Body of the error message.

No

Headers

Headers to include in the error message.

No

Status code

Status code of the error response, for example, 500.

No

Reason phrase

Reason for the error, for example, Gateway Timeout or Internal Server Error.

No

## Add Components to Your Project Add components to your integration project to build a flow: 1. In the **Explorer** view, open the XML file for your project, such as `my-project-name.xml`. 2. Select **Build a Flow** from the start card to create an empty flow: ![Anypoint Code Builder canvas with starting cards with the options to start from scratch, build a flow, or build a subflow](/mulesoft/current/en-us/connectors/_images/acb-build-flow.png) 3. Change the name of the flow: 1. Click **Flow**. 2. Click the edit icon. ![Arrow pointing to the flow name edit pencil icon](/mulesoft/current/en-us/connectors/_images/acb-change-flow-name.png) 3. Enter the flow name, and click the checkmark. 4. In the canvas UI, click the ![Add component icon](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-plus.png) (**Add component**) icon. 5. In the **Add Component** panel, search for and select your component from the results. The following example shows the **Listener** component from the **HTTP** search results: ![Listener component highlighted in the Add Component section](/mulesoft/current/en-us/anypoint-code-builder/_images/main-tutorial-add-first-listener.png) The configuration XML file now includes the XML for the HTTP Listener into the `` element, for example: ```XML ``` ## Configure the Component Attributes After you add components to your integration project, configure the attributes in the component UI, or configure the attributes directly in the XML code editor. Connector XML tags start with a namespace followed by an operation, following the syntax `namespace:operation`, such as `` for a **Select** operation in Anypoint Connector for Database (Database Connector). You can use autocomplete from an expression (**fx**) field for a component to select DataWeave functions from the Core module and other values accepted in this field. ### Client Configuration ```xml ``` ### Server Configuration ```xml ``` ### Client Operations #### \[Client\] Bidirectional Stream Message ```xml #[payload] ``` #### \[Client\] Client Streaming Call ```xml #[payload] ``` #### \[Client\] Server Stream Message ```xml #[payload] ``` #### \[Client\] Iterate Server Stream Message ```xml #[payload] ``` #### \[Client\] Unary Message ```xml #[%dw 2.0 output application/x-protobuf messageType='package.MessageType', descriptorUrl="path/to/service.desc" --- { field1: "value1", field2: 123 }] ``` ### Client Sources #### \[Client\] Bidirectional Stream Listener ```xml ``` #### \[Client\] Server Stream Listener ```xml ``` #### \[Client\] Server Stream Subscriber ```xml ``` ### Server Operations #### \[Server\] End Stream ```xml ``` #### \[Server\] Respond Server Stream Message ```xml ``` ### Server Sources #### \[Server\] Bidirectional Streaming Listener ```xml ``` #### \[Server\] Client Stream Listener ```xml ``` #### \[Server\] Server Stream Listener ```xml ``` #### \[Server\] Unary Listener ```xml ``` To return a specific gRPC status code and description to the client instead of the default `UNKNOWN` status, add a `` child element and set its `statusCode` and `description` attributes. The `statusCode` attribute accepts either the status code name (case-insensitive, for example, `NOT_FOUND`) or its number (0 through 16): ```xml ``` ## Create a New Configuration XML File Anypoint Code Builder creates the initial Mule configuration XML file in `src/main/mule` within the Mule project. This file contains global configurations and flow structures. You can create additional configuration files, for example, to store global configurations. To create a new XML configuration file: 1. In the Explorer view, right-click the **mule** folder (`src/main/mule`) and select **New File**. Alternatively, use the menu. Show me how Select the `mule` folder, and then: - In the desktop IDE, select **File** > **New Mule Configuration File**. - In the cloud IDE, click the ![](/mulesoft/current/en-us/anypoint-code-builder/_images/icon-menu.png) (menu) icon, and select **File** > **New File**. 2. Enter a name for the new file with the `.xml` extension. 3. In the Editor view for the new file, press Ctrl+Space to display available options. 4. Select **Empty mule configuration**: ![New Mule configuration option in auto-correct](/mulesoft/current/en-us/anypoint-code-builder/_images/int-new-mule-config.png) This command adds the following code to the file: ```xml ``` ## See Also - [Anypoint Code Builder Overview](https://docs.mulesoft.com/anypoint-code-builder/) - [Creating Integrations](https://docs.mulesoft.com/anypoint-code-builder/int-create-integrations) - [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb) - [Anypoint Code Builder Components and Commands Reference](https://docs.mulesoft.com/anypoint-code-builder/acb-reference) - [Defining and Securing Properties for a Mule Application](https://docs.mulesoft.com/anypoint-code-builder/int-create-secure-configs) - [Triggering Flows in Your Development Environment](https://docs.mulesoft.com/anypoint-code-builder/int-trigger-flows) - [Configuring Components](https://docs.mulesoft.com/anypoint-code-builder/int-configure-components) - [Debugging Mule Applications](https://docs.mulesoft.com/anypoint-code-builder/int-debug-mule-apps) - [Salesforce Help](https://help.salesforce.com) --- product: gRPC Connector version: 1.0 is-latest-version: true --- # Using Anypoint Studio to Configure gRPC Connector 1.0 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Studio (Studio) editors help you design and update your Mule applications, properties, and configuration files. To add and configure a connector in Studio: 1. [Create a Mule project](#create-mule-project). 2. [Add the connector to your Mule project](#add-connector-to-project). 3. [Configure a source for the connector’s flow](#configure-source). 4. [Add a connector operation to the flow](#add-connector-operation). 5. [Configure a global element for the connector](#configure-global-element). 6. [Configure the other connector fields](#configure-other-fields). When you run the connector, you can view the app log to check for problems in real time, as described in [View the App Log](#view-app-log). If you are new to configuring connectors in Studio, see [Using Anypoint Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio). If, after reading this topic, you need additional information about the connector fields, see the [gRPC Connector Reference](https://docs.mulesoft.com/grpc-connector/latest/grpc-connector-reference). ## Create a Mule Project In Studio, create a new Mule project in which to add and configure Anypoint Connector for gRPC (gRPC Connector): 1. In Studio, select **File > New > Mule Project**. 2. Enter a name for your Mule project and click **Finish**. ## Add the Connector to Your Mule Project Add gRPC Connector to your Mule project to automatically populate the XML code with the connector’s namespace and schema location and add the required dependencies to the project’s `pom.xml` file: 1. In **Mule Palette**, click **(X) Search in Exchange**. 2. In **Add Dependencies to Project**, type `grpc` in the search field. 3. Click **gRPC Connector** in **Available modules**. 4. Click **Add**. 5. Click **Finish**. Adding a connector to a Mule project in Studio does not make that connector available to other projects in your Studio workspace. ## Configure a Source A source initiates a flow when a specified condition is met. You can configure one of these sources to use with gRPC Connector: - **HTTP > Listener** Initiates a flow each time it receives a request on the configured host and port - **Scheduler** Initiates a flow when a time-based condition is met - **gRPC Connector sources** See [gRPC Connector 1.0 Reference](https://docs.mulesoft.com/grpc-connector/latest/grpc-connector-reference) for sources. For example, to configure an **HTTP > Listener** source, follow these steps: 1. In **Mule Palette**, select **HTTP > Listener**. 2. Drag **Listener** to the Studio canvas. 3. On the **Listener** configuration screen, optionally change the value of the **Display Name** field. 4. Specify a value for the **Path** field. 5. Click the plus sign (**+**) next to the **Connector configuration** field to configure a global element that can be used by all instances of the **HTTP > Listener** source in the app. 6. On the **General** tab, specify the connection information for the connector. 7. On the **TLS** tab, optionally specify the TLS information for the connector. 8. On the **Advanced** tab, optionally specify reconnection information, including a reconnection strategy. 9. Click **Test Connection** to confirm that Mule can connect with the specified server. 10. Click **OK**. ## Add a Connector Operation to the Flow When you add a connector operation to your flow, you are specifying an action for that connector to perform. To add an operation for gRPC Connector, follow these steps: 1. In **Mule Palette**, select **gRPC** and then select the desired operation. 2. Drag the operation onto the Studio canvas, next to the source. ## Configure a Global Element for the Connector When you configure the connector, configure a global element that all instances of that connector in the app can use. Configuring a global element requires you to provide the connection settings the connector needs to access the gRPC service or expose a gRPC server. To configure the global element for gRPC Connector, follow these steps: 1. Select the operation or source in the Studio canvas. 2. In the **General** configuration screen for the operation or source, click the **Add** icon to access the global element configuration fields. 3. In the **General** tab, in **Connection**, select the configuration type to use: - **Client** for connecting to gRPC services as a client. Then select the connection type: - [Google Service Account Auth Provider](https://docs.mulesoft.com/grpc-connector/latest/grpc-connector-reference#Client_GoogleServiceAccountAuthProvider) - [No Auth](https://docs.mulesoft.com/grpc-connector/latest/grpc-connector-reference#Client_NoAuth) - [Oauth Client Credentials](https://docs.mulesoft.com/grpc-connector/latest/grpc-connector-reference#Client_OauthClientCredentials) - **Server** for exposing gRPC methods. Then configure [Grpc Server](https://docs.mulesoft.com/grpc-connector/latest/grpc-connector-reference#Server_GrpcServer). You can reference a configuration file that contains ANT-style property placeholders (recommended), or you can enter your connection details in the global configuration properties. For information about the benefits of using property placeholders and how to configure them, refer to [Anypoint Connector Configuration](https://docs.mulesoft.com/connectors/introduction/intro-connector-configuration-overview). 4. In the **Advanced** tab, optionally specify reconnection information, including a reconnection strategy. 5. Click **Test Connection** to confirm that Mule can connect with the specified server (for client configuration). 6. Click **OK**. ## Configure Additional Connector Fields After you configure a global element for gRPC Connector, configure the other required fields for the connector. The required fields vary depending on which connector operation you use. ## View the App Log To check for problems, you can view the app log as follows: - If you’re running the app from Anypoint Platform, the app log output is visible on the Anypoint Studio console window. - If you’re running the app using Mule from the command line, the app log output is visible in your operating system console. Unless the log file path is customized in the app’s log file (`log4j2.xml`), you can also view the app log in the default location `MULE_HOME/logs/.log`. You can configure the location of the log path in the app log file `log4j2.xml`. ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Using Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [gRPC Connector Reference](https://docs.mulesoft.com/grpc-connector/latest/grpc-connector-reference) - [Salesforce Help](https://help.salesforce.com)