How to Expose Dubbo Microservices via HTTP Using Triple Protocol and Gateways

This guide explains how Dubbo 3.3’s new Triple protocol enables high-performance, interface-friendly HTTP access to backend Dubbo microservices, covering centralized and decentralized gateway architectures, multi-protocol publishing, configuration steps, and concrete Kubernetes deployment examples using Higress, Apache APISIX, and Shenyu.

Alibaba Cloud Native
Alibaba Cloud Native
Alibaba Cloud Native
How to Expose Dubbo Microservices via HTTP Using Triple Protocol and Gateways

Dubbo Triple Protocol Overview

Dubbo 3.3 introduces the Triple protocol, which retains Dubbo’s high‑performance RPC while supporting native HTTP/JSON (application/json) access. This eliminates the need for separate protocol‑conversion tools.

Access Architectures

Centralized (Gateway + BFF)

In a centralized model a gateway forwards HTTP requests to a Backend‑for‑Frontend (BFF) service built with Spring Web. The BFF translates HTTP calls into Dubbo invocations.

Decentralized (Gateway Direct)

In a decentralized model the gateway directly forwards HTTP requests to Dubbo services. When the service uses Triple, the gateway can forward plain HTTP/JSON without binary conversion.

Multi‑Protocol Publishing

Dubbo can expose the same service on both the native Dubbo binary protocol and HTTP/JSON on the same port. Add ext-protocol: tri to the protocol configuration.

dubbo:
  protocol:
    dubbo: dubbo
    port: 20880
    ext-protocol: tri

After the change the service listens on port 20880 for HTTP requests. Example:

curl \
  --header "Content-Type: application/json" \
  --data '["Dubbo"]' \
  http://localhost:20880/org.apache.dubbo.protocol.multiple.demo.DemoService/sayHello

Gateway Requirements for HTTP→Dubbo Conversion

Protocol conversion : map HTTP parameters to Dubbo request format.

Dynamic service discovery : support Nacos, Zookeeper, Kubernetes, etc.

Dubbo‑aware routing : filter and route based on Dubbo metadata.

Open‑source gateways that provide these capabilities include Higress, Apache APISIX, and Apache Shenyu.

Native Triple Protocol HTTP Access

Triple natively supports HTTP/1 and HTTP/2, allowing any standard HTTP client (e.g., cURL) to call Dubbo services without additional conversion layers. The gateway only needs to perform routing and service discovery.

Example: Deploying Higress + Nacos + Dubbo Triple on Kubernetes

Deploy Nacos for service registration:

kubectl apply -f https://raw.githubusercontent.com/apache/dubbo-samples/master/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/deploy/nacos/Nacos.yaml

Deploy the Dubbo provider application:

kubectl apply -f https://raw.githubusercontent.com/apache/dubbo-samples/master/2-advanced/dubbo-samples-gateway/dubbo-samples-gateway-higress/dubbo-samples-gateway-higress-triple/deploy/provider/Deployment.yaml

Create a McpBridge resource so Higress can discover services from Nacos:

apiVersion: networking.higress.io/v1
kind: McpBridge
metadata:
  name: nacos-service-resource
  namespace: higress-system
spec:
  registries:
  - domain: nacos-server.default.svc.cluster.local
    nacosGroups:
    - DEFAULT_GROUP
    name: nacos-service-resource
    port: 8848
    type: nacos2

Define an Ingress that routes HTTP paths to the Dubbo service:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    higress.io/destination: gateway-higress-triple-provider.DEFAULT-GROUP.public.nacos
  name: demo
  namespace: default
spec:
  ingressClassName: higress
  rules:
    - http:
        paths:
          - backend:
              resource:
                apiGroup: networking.higress.io
                kind: McpBridge
                name: default
            path: /org.apache.dubbo.samples.gateway.api.DemoService
            pathType: Prefix

After exposing the Ingress, a cURL call reaches the Triple service:

curl "localhost/org.apache.dubbo.samples.gateway.api.DemoService/sayHello?name=HigressTriple"
# => "Hello HigressTriple"

Publishing REST‑Style HTTP Interfaces

When the service uses Triple, adding Spring Web or JAX‑RS annotations to the Java interface publishes both binary Triple and JSON/REST endpoints.

@RequestMapping("/triple/demo")
public interface DemoService {
    @RequestMapping(method = RequestMethod.GET, value = "/hello")
    String sayHello(@RequestParam("name") String name);
}

Clients can call /triple/demo/hello?name=HigressTriple directly, or use gateway rewrite rules to map a friendly path to the original Dubbo method path.

Conclusion

The Dubbo 3.3 Triple protocol enables high‑performance RPC while providing native HTTP/JSON access, simplifying development, testing, and traffic integration. It supports both centralized and decentralized gateway architectures and can be combined with open‑source gateways such as Higress, APISIX, or Shenyu.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Kubernetestriple-protocolHTTP Gateway
Alibaba Cloud Native
Written by

Alibaba Cloud Native

We publish cloud-native tech news, curate in-depth content, host regular events and live streams, and share Alibaba product and user case studies. Join us to explore and share the cloud-native insights you need.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.