<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/incubator-dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/incubator-dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: xxx</li>
<li>Operating System version: xxx</li>
<li>Java version: xxx</li>
</ul>
<h1 dir="auto">Http Request Solutions</h1>
<p dir="auto">We are going to export dubbo service for front-end request(eg: h5 outside). We are doubt about the advantage and disadvantage of below two solutions, anyone have good ideas for that?</p>
<p dir="auto">Generally, there are two ways to support that.<br>
Solution1: Add proxy(through GenericService) for the http request (http -&gt; proxy -&gt; dubbo)<br>
Solution2: Support dubbo &amp; http protocol in service side (eg: dubbox/jsonrpc).</p>
<h2 dir="auto">For Solution1:</h2>
<h3 dir="auto">Advantage:</h3>
<ol dir="auto">
<li>It's easy for the user, no need to maintain both http &amp; dubbo protocols.</li>
<li>No need to maintain two types of configurations (one for dubbo, another for http). Following two conditions may confuse the user. Firstly, xxx config support for dubbo and http, but they are in different key. Secondly, yyy config is supported in dubbo, not for http. User maybe confused on so much of the configs.</li>
</ol>
<h3 dir="auto">Disadvantage:</h3>
<ol dir="auto">
<li>The latency is high for the proxy mode.<br>
For dubbo protocol:  1k request/100k response/3000QPS, average response is 1-2ms, and able to support 7000-8000QPS in 8Core server.<br>
For the proxy mode: 1K request/100K response/600QPS, the average response is 14ms, only with 600QPS.</li>
<li>The proxy CPU is very high.<br>
For dubbo protocol: With 7000-8000QPS, the service CPU is about 80-90%, with 600QPS, the service CPU below 5-10% maybe.<br>
For proxy mode: With 600QPS, service CPU is low, but the proxy's CPU is almost full (80-90%). That means, it need 4-5times of the server to host the request.</li>
</ol>
<h2 dir="auto">For Solution2:</h2>
<h3 dir="auto">Advantage:</h3>
<ol dir="auto">
<li>The latency is very low, as it's directly connect to the service.</li>
</ol>
<h3 dir="auto">Disadvantage:</h3>
<ol dir="auto">
<li>User have to maintain both dubbo &amp; http protocol, as described in solution 1 .</li>
</ol>
<p dir="auto">We are confused to find a better solution. Am i in a wrong way, or anyone have good suggestions or solutions for http request?</p>
<p dir="auto">Thanks for any suggestions.</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/incubator-dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/incubator-dubbo/wiki/FAQ">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.6.2</li>
<li>Operating System version: win10</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Step to reproduce this issue</h3>
<p dir="auto">1、the code in <strong>ThriftProtocol</strong><br>
String serviceKey = serviceKey(channel.getLocalAddress().getPort(), serviceName, null, null);<br>
DubboExporter exporter = (DubboExporter) exporterMap.get(serviceKey);<br>
2、why set the serviceVersion and serviceGroup null ? I do not understand</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="com.alibaba.dubbo.remoting.RemotingException: Not found exported service: com.zbss.common.api.config.service.ConfigService$Iface:20080 in [service-config/com.zbss.common.api.config.service.ConfigService$Iface:20080], may be version or group mismatch , channel: consumer: /192.168.3.63:61251 --&gt; provider: /192.168.3.63:20080, message:RpcInvocation [methodName=getVendorConfig, parameterTypes=[class java.lang.String], arguments=[123], attachments={interface=com.zbss.common.api.config.service.ConfigService$Iface}]
	at com.alibaba.dubbo.rpc.protocol.thrift.ThriftProtocol$1.reply(ThriftProtocol.java:67)
	at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:96)
	at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:172)
	at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51)
	at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:80)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)"><pre class="notranslate"><code class="notranslate">com.alibaba.dubbo.remoting.RemotingException: Not found exported service: com.zbss.common.api.config.service.ConfigService$Iface:20080 in [service-config/com.zbss.common.api.config.service.ConfigService$Iface:20080], may be version or group mismatch , channel: consumer: /192.168.3.63:61251 --&gt; provider: /192.168.3.63:20080, message:RpcInvocation [methodName=getVendorConfig, parameterTypes=[class java.lang.String], arguments=[123], attachments={interface=com.zbss.common.api.config.service.ConfigService$Iface}]
	at com.alibaba.dubbo.rpc.protocol.thrift.ThriftProtocol$1.reply(ThriftProtocol.java:67)
	at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:96)
	at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:172)
	at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51)
	at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:80)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
</code></pre></div>