To set up an Apache Dubbo binding, create a component of type bindings.dubbo
.
See this guide on how to create and apply a binding configuration.
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: <NAME>
spec:
type: bindings.dubbo
version: v1
metadata:
- name: interfaceName
value: "com.example.UserService"
- name: methodName
value: "getUser"
# Optional
- name: version
value: "1.0.0"
- name: group
value: "mygroup"
- name: providerHostname
value: "localhost"
- name: providerPort
value: "8080"
Field | Required | Binding support | Details | Example |
---|---|---|---|---|
interfaceName | Y | Output | The Dubbo interface name to invoke. | "com.example.UserService" |
methodName | Y | Output | The method name to call on the interface. | "getUser" |
version | N | Output | Version of the Dubbo service. | "1.0.0" |
group | N | Output | Group name for the Dubbo service. | "mygroup" |
providerHostname | N | Output | Hostname of the Dubbo provider. | "localhost" |
providerPort | N | Output | Port of the Dubbo provider. | "8080" |
This component supports output binding with the following operation:
create
: invokes a Dubbo service method.To invoke a Dubbo service using the binding:
{
"operation": "create",
"metadata": {
"interfaceName": "com.example.UserService",
"methodName": "getUser",
"version": "1.0.0",
"providerHostname": "localhost",
"providerPort": "8080"
},
"data": {
"userId": "12345"
}
}
The data
field contains the request payload sent to the Dubbo service method.