|
| 1 | +--- |
| 2 | +type: docs |
| 3 | +title: "Apache Dubbo binding spec" |
| 4 | +linkTitle: "Dubbo" |
| 5 | +description: "Detailed documentation on the Apache Dubbo binding component" |
| 6 | +aliases: |
| 7 | + - "/operations/components/setup-bindings/supported-bindings/dubbo/" |
| 8 | +--- |
| 9 | + |
| 10 | +## Component format |
| 11 | + |
| 12 | +To set up an Apache Dubbo binding, create a component of type `bindings.dubbo`. |
| 13 | +See [this guide]({{% ref "howto-bindings.md#1-create-a-binding" %}}) on how to create and apply a binding configuration. |
| 14 | + |
| 15 | +```yaml |
| 16 | +apiVersion: dapr.io/v1alpha1 |
| 17 | +kind: Component |
| 18 | +metadata: |
| 19 | + name: <NAME> |
| 20 | +spec: |
| 21 | + type: bindings.dubbo |
| 22 | + version: v1 |
| 23 | + metadata: |
| 24 | + - name: interfaceName |
| 25 | + value: "com.example.UserService" |
| 26 | + - name: methodName |
| 27 | + value: "getUser" |
| 28 | + # Optional |
| 29 | + - name: version |
| 30 | + value: "1.0.0" |
| 31 | + - name: group |
| 32 | + value: "mygroup" |
| 33 | + - name: providerHostname |
| 34 | + value: "localhost" |
| 35 | + - name: providerPort |
| 36 | + value: "8080" |
| 37 | +```` |
| 38 | + |
| 39 | +{{% alert title="Note" color="info" %}} |
| 40 | +The Dubbo binding does not require authentication or secret configuration by default. |
| 41 | +However, if your Dubbo deployment requires secure communication, you can integrate Dapr's [secret store]({{% ref component-secrets.md %}}) for sensitive values. |
| 42 | +{{% /alert %}} |
| 43 | + |
| 44 | +## Spec metadata fields |
| 45 | + |
| 46 | +| Field | Required | Binding support | Details | Example | |
| 47 | +| ------------------ | :------: | --------------- | ----------------------------------------- | --------------------------- | |
| 48 | +| `interfaceName` | Y | Output | The Dubbo interface name to invoke. | `"com.example.UserService"` | |
| 49 | +| `methodName` | Y | Output | The method name to call on the interface. | `"getUser"` | |
| 50 | +| `version` | N | Output | Version of the Dubbo service. | `"1.0.0"` | |
| 51 | +| `group` | N | Output | Group name for the Dubbo service. | `"mygroup"` | |
| 52 | +| `providerHostname` | N | Output | Hostname of the Dubbo provider. | `"localhost"` | |
| 53 | +| `providerPort` | N | Output | Port of the Dubbo provider. | `"8080"` | |
| 54 | + |
| 55 | +--- |
| 56 | + |
| 57 | +## Binding support |
| 58 | + |
| 59 | +This component supports **output binding** with the following operation: |
| 60 | + |
| 61 | +* `create`: invokes a Dubbo service method. |
| 62 | + |
| 63 | +--- |
| 64 | + |
| 65 | +## Example: Invoke a Dubbo Service |
| 66 | + |
| 67 | +To invoke a Dubbo service using the binding: |
| 68 | + |
| 69 | +```json |
| 70 | +{ |
| 71 | + "operation": "create", |
| 72 | + "metadata": { |
| 73 | + "interfaceName": "com.example.UserService", |
| 74 | + "methodName": "getUser", |
| 75 | + "version": "1.0.0", |
| 76 | + "providerHostname": "localhost", |
| 77 | + "providerPort": "8080" |
| 78 | + }, |
| 79 | + "data": { |
| 80 | + "userId": "12345" |
| 81 | + } |
| 82 | +} |
| 83 | +``` |
| 84 | + |
| 85 | +The `data` field contains the request payload sent to the Dubbo service method. |
| 86 | + |
| 87 | +--- |
| 88 | + |
| 89 | +## Related links |
| 90 | + |
| 91 | +- [Basic schema for a Dapr component]({{% ref component-schema %}}) |
| 92 | +- [Bindings building block]({{% ref bindings %}}) |
| 93 | +- [How-To: Trigger application with input binding]({{% ref howto-triggers.md %}}) |
| 94 | +- [How-To: Use bindings to interface with external resources]({{% ref howto-bindings.md %}}) |
| 95 | +- [Bindings API reference]({{% ref bindings_api.md %}}) |
0 commit comments