A cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services.

Related tags

Miscellaneous motan
Overview

Motan

License Maven Central Build Status OpenTracing-1.0 Badge Skywalking Tracing

Overview

Motan is a cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services.

Related projects in Motan ecosystem:

Features

  • Create distributed services without writing extra code.
  • Provides cluster support and integrate with popular service discovery services like Consul or Zookeeper.
  • Supports advanced scheduling features like weighted load-balance, scheduling cross IDCs, etc.
  • Optimization for high load scenarios, provides high availability in production environment.
  • Supports both synchronous and asynchronous calls.
  • Support cross-language interactive with Golang, PHP, Lua(Luajit), etc.

Quick Start

The quick start gives very basic example of running client and server on the same machine. For the detailed information about using and developing Motan, please jump to Documents.

The minimum requirements to run the quick start are:

  • JDK 1.7 or above
  • A java-based project management software like Maven or Gradle

Synchronous calls

  1. Add dependencies to pom.
<dependency>
    <groupId>com.weibo</groupId>
    <artifactId>motan-core</artifactId>
       <version>1.0.0</version>
</dependency>
<dependency>
    <groupId>com.weibo</groupId>
    <artifactId>motan-transport-netty</artifactId>
    <version>1.0.0</version>
</dependency>

<!-- dependencies below were only needed for spring-based features -->
<dependency>
    <groupId>com.weibo</groupId>
    <artifactId>motan-springsupport</artifactId>
    <version>1.0.0</version>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context</artifactId>
    <version>4.2.4.RELEASE</version>
</dependency>
  1. Create an interface for both service provider and consumer.

    src/main/java/quickstart/FooService.java

    package quickstart;
    
    public interface FooService {
        public String hello(String name);
    }
  2. Write an implementation, create and start RPC Server.

    src/main/java/quickstart/FooServiceImpl.java

    package quickstart;
    
    public class FooServiceImpl implements FooService {
    
        public String hello(String name) {
            System.out.println(name + " invoked rpc service");
            return "hello " + name;
        }
    }

    src/main/resources/motan_server.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:motan="http://api.weibo.com/schema/motan"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
       http://api.weibo.com/schema/motan http://api.weibo.com/schema/motan.xsd">
    
        <!-- service implementation bean -->
        <bean id="serviceImpl" class="quickstart.FooServiceImpl" />
        <!-- exporting service by motan -->
        <motan:service interface="quickstart.FooService" ref="serviceImpl" export="8002" />
    </beans>

    src/main/java/quickstart/Server.java

    package quickstart;
    
    import org.springframework.context.ApplicationContext;
    import org.springframework.context.support.ClassPathXmlApplicationContext;
    
    public class Server {
    
        public static void main(String[] args) throws InterruptedException {
            ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:motan_server.xml");
            System.out.println("server start...");
        }
    }

    Execute main function in Server will start a motan server listening on port 8002.

  3. Create and start RPC Client.

    src/main/resources/motan_client.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:motan="http://api.weibo.com/schema/motan"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
       http://api.weibo.com/schema/motan http://api.weibo.com/schema/motan.xsd">
    
        <!-- reference to the remote service -->
        <motan:referer id="remoteService" interface="quickstart.FooService" directUrl="localhost:8002"/>
    </beans>

    src/main/java/quickstart/Client.java

    package quickstart;
    
    import org.springframework.context.ApplicationContext;
    import org.springframework.context.support.ClassPathXmlApplicationContext;
    
    
    public class Client {
    
        public static void main(String[] args) throws InterruptedException {
            ApplicationContext ctx = new ClassPathXmlApplicationContext("classpath:motan_client.xml");
            FooService service = (FooService) ctx.getBean("remoteService");
            System.out.println(service.hello("motan"));
        }
    }

    Execute main function in Client will invoke the remote service and print response.

Asynchronous calls

  1. Based on the Synchronous calls example, add @MotanAsync annotation to interface FooService.

    package quickstart;
    import com.weibo.api.motan.transport.async.MotanAsync;
    
    @MotanAsync
    public interface FooService {
        public String hello(String name);
    }
  2. Include the plugin into the POM file to set target/generated-sources/annotations/ as source folder.

    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.10</version>
        <executions>
            <execution>
                <phase>generate-sources</phase>
                <goals>
                    <goal>add-source</goal>
                </goals>
                <configuration>
                    <sources>
                        <source>${project.build.directory}/generated-sources/annotations</source>
                    </sources>
                </configuration>
            </execution>
        </executions>
    </plugin>
  3. Modify the attribute interface of referer in motan_client.xml from FooService to FooServiceAsync.

    <motan:referer id="remoteService" interface="quickstart.FooServiceAsync" directUrl="localhost:8002"/>
  4. Start asynchronous calls.

    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext(new String[] {"classpath:motan_client.xml"});
    
        FooServiceAsync service = (FooServiceAsync) ctx.getBean("remoteService");
    
        // sync call
        System.out.println(service.hello("motan"));
    
        // async call
        ResponseFuture future = service.helloAsync("motan async ");
        System.out.println(future.getValue());
    
        // multi call
        ResponseFuture future1 = service.helloAsync("motan async multi-1");
        ResponseFuture future2 = service.helloAsync("motan async multi-2");
        System.out.println(future1.getValue() + ", " + future2.getValue());
    
        // async with listener
        FutureListener listener = new FutureListener() {
            @Override
            public void operationComplete(Future future) throws Exception {
                System.out.println("async call "
                        + (future.isSuccess() ? "success! value:" + future.getValue() : "fail! exception:"
                                + future.getException().getMessage()));
            }
        };
        ResponseFuture future3 = service.helloAsync("motan async multi-1");
        ResponseFuture future4 = service.helloAsync("motan async multi-2");
        future3.addListener(listener);
        future4.addListener(listener);
    }

Documents

Contributors

License

Motan is released under the Apache License 2.0.

Issues
  • 服务端抛出自定义业务异常,在客户端得到的也是MotanServiceException异常信息。

    服务端抛出自定义业务异常,在客户端得到的也是MotanServiceException异常信息。

    跟踪到如下图的客户端的异常信息位置,抛出的也是MotanServiceException异常信息,怎么样能在客户端得到自定义异常信息。 看到之前提出的issue是说可以的,但是我跟踪了代码为啥就不行? 一直走到图中biz exception cause is null这个分支。 补充:服务端和客户端都都是用自定义业务异常类的。

    image

    opened by cheniqit 18
  • 在配合consul的时候出现问题,服务注册到了consul,但是状态一直是failing

    在配合consul的时候出现问题,服务注册到了consul,但是状态一直是failing

    按照文档操作,我的consul启动命令 consul agent -dev ; 项目的配置文件配置连接到这个注册中心,服务可以正常注册,但是现实的服务状态一直是failing!

    opened by freeFeatrue 17
  • motan是否有兴趣加入opentracing标准化追踪?

    motan是否有兴趣加入opentracing标准化追踪?

    你好,我是OpenTracing组织的中国区成员, OpenTracing已经是CNCF级别的追踪标准。

    OpenTracing官网:http://opentracing.io

    motan作为RPC框架,面向微服务的框架,希望能够积极加入。 我希望通过你们的帮助,通过RP提交相应的支持模块,保证OpenTracing的兼容性。

    如果你们感兴趣,请直接回复我。

    opened by wu-sheng 16
  • async-call support for motan

    async-call support for motan

    When we use Motan to make a rpc call, the thread will be blocked until response returned from remote server. This makes code simple but not good enough in some scenarios.

    For example, if we query three lists, the block version is:

    list1 = remoteService.query(param1);
    list2 = remoteService.query(param2);
    list3 = remoteService.query(param3);
    result = merge(list1,list2,list3);
    

    If each query takes 200ms, all queries will take 600ms. But if three query run in parallel. It will take only 200ms.

    There're many ways of parallel executing. We're looking for a way to make rpc call more efficiently without make the code too complex.

    Here's some way we've considered:

    generation async code with JAP

    We could generate async code by compiler, it likes:

    server:
    @Async
    public String hello(String name);
    
    client:
    Future resultFuture = remoteService.hello("motan");
    String result = resultFuture.get();
    

    lambda

    Future resultFuture = MotanAsyncInvoker.invoke(() -> {
        // do something
    });
    String result = resultFuture.get();
    

    async context

    remoteService.hello("motan");
    Future resultFuture pFuture = RpcContext.getContext().getFuture();
    String result = resultFuture.get();
    

    We may start to implement this feature in a few months, after php-yar support and some doc work.

    Any thoughts?

    feature 
    opened by qdaxb 15
  • 关于spring annotation

    关于spring annotation

    我看到提交上来的代码中有支持spring的注解,主持spring注解的新特性以及kryo的序列化是否会合并到下一个版本中。

    opened by Harrytion 15
  • 异步调用返回的结果貌似混淆了

    异步调用返回的结果貌似混淆了

    代码如下: future = service.asyncCall(param); listener = new FutureListener({...}); future.addListener(listener);

    发现经常出现不同param的调用结果出现在同一个回调返回中,比如param1和param2分别对应的结果都出现在同一次operationComplete中(比如param1对应的那次),那么相应的就是param2对应的operationComplete拿不到任何数据

    @rayzhang0603

    opened by rayeaster 14
  • 服务端已经启动成功,但是为什么客户端启动的时候,一直报找不到订阅消息的错误?

    服务端已经启动成功,但是为什么客户端启动的时候,一直报找不到订阅消息的错误?

    服务端日志; 2016-06-22 17:44:22.393 INFO 8072 --- [pool-3-thread-1] serviceStatsLog : [motan-totalAccessStatistic] app: motan module: motan total_count: 0 slow_count: 0 biz_excp: 0 other_excp: 0 avg_time: 0.00ms biz_time: 0.00ms avg_tps: 0 2016-06-22 17:44:22.396 INFO 8072 --- [pool-3-thread-1] serviceStatsLog : [motan-memoryStatistic] 124.68MB of 1797.50 MB (6.9%) used 2016-06-22 17:44:22.397 INFO 8072 --- [pool-3-thread-1] serviceStatsLog : [motan-statisticCallback] identity: motan://192.168.20.208:8002/activeGroup/com.epai.contract.iface.ActivityService/1.0/service connectionCount: 0 taskCount: 0 queueCount: 0 maxThreadCount: 800 maxTaskCount: 800 2016-06-22 17:44:22.397 INFO 8072 --- [pool-3-thread-1] serviceStatsLog : [motan-statisticCallback] identity: motan://192.168.20.208:8003/dataCrawlGroup/com.epai.contract.iface.DataCrawlService/1.0/service connectionCount: 0 taskCount: 0 queueCount: 0 maxThreadCount: 800 maxTaskCount: 800

    错误描述: Caused by: com.weibo.api.motan.exception.MotanFrameworkException: error_message: Failed to subscribe motan://192.168.20.208:0/com.epai.contract.iface.ActivityService?group=activeGroup to zookeeper(zookeeper://127.0.0.1:2181/com.weibo.api.motan.registry.RegistryService?group=default_rpc), cause: null, status: 503, error_code: 20001,r= at com.weibo.api.motan.registry.zookeeper.ZookeeperRegistry.doSubscribe(ZookeeperRegistry.java:98) ~[motan-registry-zookeeper-0.1.1.jar:na] at com.weibo.api.motan.registry.support.AbstractRegistry.subscribe(AbstractRegistry.java:101) ~[motan-core-0.1.1.jar:na] at com.weibo.api.motan.registry.support.FailbackRegistry.subscribe(FailbackRegistry.java:107) ~[motan-core-0.1.1.jar:na] ... 36 common frames omitted

    opened by lijhua 14
  • 一个服务即作客户端又做服务端时,服务端发布不成功?

    一个服务即作客户端又做服务端时,服务端发布不成功?

    该服务的 motan_server.xml 配置如下:

    <motan:registry regProtocol="zookeeper" name="my_zookeeper" address="120.76.157.7:2181" />

    <motan:protocol id="tppUsersMotan" default="true" name="motan"
                    maxServerConnection="80000" maxContentLength="1048576"
                    maxWorkerThread="800" minWorkerThread="20"/>
    
      <motan:basicService export="tppUsersMotan:9090" registry="my_zookeeper"
                        group="motan-tpp-users-rpc" accessLog="false" shareChannel="true" module="giftformama-users-rpc" host="112.124.50.158"
                        application="giftformama" id="serviceBasicConfig"/>
    
    <!-- service implemention bean 发布服务接口 -->
    <bean id="usersServiceImpl" class="com.rekchina.giftformama.users.service.impl.UsersServiceImpl" />
    <bean id="userKidsServiceImpl" class="com.rekchina.giftformama.users.service.impl.UserKidsServiceImpl" />
    <bean id="authCodeServiceImpl" class="com.rekchina.giftformama.users.service.impl.AuthCodeServiceImpl" />
    <bean id="styleImagesServiceImpl" class="com.rekchina.giftformama.users.service.impl.StyleImagesServiceImpl" />
    <bean id="stylesServiceImpl" class="com.rekchina.giftformama.users.service.impl.StylesServiceImpl" />
    
    <!-- exporting service by motan -->
    <motan:service interface="com.rekchina.giftformama.users.service.UsersService" ref="usersServiceImpl" basicService="serviceBasicConfig" />
    <motan:service interface="com.rekchina.giftformama.users.service.UserKidsService" ref="userKidsServiceImpl" basicService="serviceBasicConfig" />
    <motan:service interface="com.rekchina.giftformama.users.service.AuthCodeService" ref="authCodeServiceImpl" basicService="serviceBasicConfig" />
    <motan:service interface="com.rekchina.giftformama.users.service.StyleImagesService" ref="styleImagesServiceImpl" basicService="serviceBasicConfig" />
    <motan:service interface="com.rekchina.giftformama.users.service.StylesService" ref="stylesServiceImpl" basicService="serviceBasicConfig" />
    

    该服务的 motan_client.xml 配置如下: <motan:registry regProtocol="zookeeper" name="my_zookeeper" address="120.76.157.7:2181" />

    <!-- motan协议配置 -->
    <motan:protocol default="true" name="motan" haStrategy="failover"
                    loadbalance="roundrobin" maxClientConnection="10" minClientConnection="2"/>
    
    <!-- 通用referer基础配置 -->
    <motan:basicReferer requestTimeout="200" accessLog="false"
                        retries="2" group="motan-tpp-rpc" module="giftformama-rpc"
                        application="giftformama" protocol="motan" registry="my_zookeeper"
                        id="refererBasicConfig" throwException="false" check="true"/>
    
    <!-- reference to the remote service 调用其他服务发布的接口 -->
    <motan:referer id="userAuthServiceImpl" interface="com.rekchina.giftformama.auth.service.UserAuthService" basicReferer="refererBasicConfig" />
    

    问题是:该服务端的方法有调用其他服务发布的接口,所以既有服务端配置也有客户端配置。单独发布测试都没有问题,一起发布就出现问题了。能调用其他服务端,但是自己服务端发布却失败。通过查看motan_manager,可以看到:发布服务端的server都为0,调用服务的client为1。发布时候没有报任何错误,正常发布,但是服务却不可用在Zookeeper上。

    PS:如果不用这种通用配置方式,而是使用简单的,将每个接口都发布一个端口,这样是可以的。这次不可以主要是换了一种配置方式,就是多个接口共享一个端口,可是这次没成功。麻烦看下,谢谢!

    opened by catslave 13
  • 优雅关机的问题

    优雅关机的问题

    现在有个疑惑就是无法优雅的关机,根据官方文档上描述的设置了REGISTRY_HEARTBEAT_SWITCHER为false后就不会处理请求了,但是我模拟的场景依然可以处理请求数据。操作步骤如下

    1.在192.168.199.195上启动一个服务并设置REGISTRY_HEARTBEAT_SWITCHER为true,此时在管理后台可以查询到服务列表,并且也处于server状态

    2.在192.168.199.103的客户端去调用该服务,可以成功返回

    3.设置192.168.199.195上的REGISTRY_HEARTBEAT_SWITCHER为false,此时在管理后台查询服务时,Unavailable Server = 1.说明设置成功

    4.在192.168.199.103的客户端去调用该服务依然可以成功返回

    预期第四步应该是没有返回才对的,请帮忙解答一下

    opened by estn 13
  • motan消费端部署在tomcat中,无法正常shutdown tomcat

    motan消费端部署在tomcat中,无法正常shutdown tomcat

    执行tomcat的shutdown.sh,无法正常关闭tomcat,只能kill进程。有什么办法吗?

    bug 
    opened by feilaoda 11
  • motan服务端如何进行启动预热

    motan服务端如何进行启动预热

    学习了下motan源码发现,默认consumer负载均衡策略为ActiveWeightLoadBalance-低并发referer获取策略,正好和Dubbo的客户端逐步放量策略是相反的,这样motan服务端新起来的节点瞬间被命中的几率是很高的,加上初始化过程会造成瞬间压力很大。 两个问题:

    1. 请问如何做才能使服务端预热后再提供服务,标准做法是怎样的?
    2. 如果没有官方机制是否可以参考Dubbo通过负载均衡器根据节点新旧程度逐步放量进行,这样做是否有啥坑?
    opened by wzy2008a 1
  • Bump protobuf-java from 3.0.0 to 3.16.1 in /motan-demo

    Bump protobuf-java from 3.0.0 to 3.16.1 in /motan-demo

    Bumps protobuf-java from 3.0.0 to 3.16.1.

    Release notes

    Sourced from protobuf-java's releases.

    Protocol Buffers v3.16.1

    Java

    • Improve performance characteristics of UnknownFieldSet parsing (#9371)

    Protocol Buffers v3.16.0

    C++

    • Fix compiler warnings issue found in conformance_test_runner #8189 (#8190)
    • Fix MinGW-w64 build issues. (#8286)
    • [Protoc] C++ Resolved an issue where NO_DESTROY and CONSTINIT are in incorrect order (#8296)
    • Fix PROTOBUF_CONSTINIT macro redefinition (#8323)
    • Delete StringPiecePod (#8353)
    • Fix gcc error: comparison of unsigned expression in '>= 0' is always … (#8309)
    • Fix cmake install on iOS (#8301)
    • Create a CMake option to control whether or not RTTI is enabled (#8347)
    • Fix endian.h location on FreeBSD (#8351)
    • Refactor util::Status (#8354)
    • Make util::Status more similar to absl::Status (#8405)
    • Fix -Wsuggest-destructor-override for generated C++ proto classes. (#8408)
    • Refactor StatusOr and StringPiece (#8406)
    • Refactor uint128 (#8416)
    • The ::pb namespace is no longer exposed due to conflicts.
    • Allow MessageDifferencer::TreatAsSet() (and friends) to override previous calls instead of crashing.
    • Reduce the size of generated proto headers for protos with string or bytes fields.
    • Move arena() operation on uncommon path to out-of-line routine
    • For iterator-pair function parameter types, take both iterators by value.
    • Code-space savings and perhaps some modest performance improvements in RepeatedPtrField.
    • Eliminate nullptr check from every tag parse.
    • Remove unused _$name$cached_byte_size fields.
    • Serialize extension ranges together when not broken by a proto field in the middle.
    • Do out-of-line allocation and deallocation of string object in ArenaString.
    • Streamline ParseContext::ParseMessage to avoid code bloat and improve performance.
    • New member functions RepeatedField::Assign, RepeatedPtrField::{Add, Assign}.
    • Fix undefined behavior warning due to innocuous uninitialization of value on an error path.
    • Avoid expensive inlined code space for encoding message length for messages

      = 128 bytes and instead do a procedure call to a shared out-of-line routine.

    • util::DefaultFieldComparator will be final in a future version of protobuf. Subclasses should inherit from SimpleFieldComparator instead.

    C#

    • Add .NET 5 target and improve WriteString performance with SIMD (#8147)

    Java

    • deps: update JUnit and Truth (#8319)
    • Detect invalid overflow of byteLimit and return InvalidProtocolBufferException as documented.

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump protobuf-java from 3.2.0 to 3.16.1 in /motan-extension/serialization-extension

    Bump protobuf-java from 3.2.0 to 3.16.1 in /motan-extension/serialization-extension

    Bumps protobuf-java from 3.2.0 to 3.16.1.

    Release notes

    Sourced from protobuf-java's releases.

    Protocol Buffers v3.16.1

    Java

    • Improve performance characteristics of UnknownFieldSet parsing (#9371)

    Protocol Buffers v3.16.0

    C++

    • Fix compiler warnings issue found in conformance_test_runner #8189 (#8190)
    • Fix MinGW-w64 build issues. (#8286)
    • [Protoc] C++ Resolved an issue where NO_DESTROY and CONSTINIT are in incorrect order (#8296)
    • Fix PROTOBUF_CONSTINIT macro redefinition (#8323)
    • Delete StringPiecePod (#8353)
    • Fix gcc error: comparison of unsigned expression in '>= 0' is always … (#8309)
    • Fix cmake install on iOS (#8301)
    • Create a CMake option to control whether or not RTTI is enabled (#8347)
    • Fix endian.h location on FreeBSD (#8351)
    • Refactor util::Status (#8354)
    • Make util::Status more similar to absl::Status (#8405)
    • Fix -Wsuggest-destructor-override for generated C++ proto classes. (#8408)
    • Refactor StatusOr and StringPiece (#8406)
    • Refactor uint128 (#8416)
    • The ::pb namespace is no longer exposed due to conflicts.
    • Allow MessageDifferencer::TreatAsSet() (and friends) to override previous calls instead of crashing.
    • Reduce the size of generated proto headers for protos with string or bytes fields.
    • Move arena() operation on uncommon path to out-of-line routine
    • For iterator-pair function parameter types, take both iterators by value.
    • Code-space savings and perhaps some modest performance improvements in RepeatedPtrField.
    • Eliminate nullptr check from every tag parse.
    • Remove unused _$name$cached_byte_size fields.
    • Serialize extension ranges together when not broken by a proto field in the middle.
    • Do out-of-line allocation and deallocation of string object in ArenaString.
    • Streamline ParseContext::ParseMessage to avoid code bloat and improve performance.
    • New member functions RepeatedField::Assign, RepeatedPtrField::{Add, Assign}.
    • Fix undefined behavior warning due to innocuous uninitialization of value on an error path.
    • Avoid expensive inlined code space for encoding message length for messages

      = 128 bytes and instead do a procedure call to a shared out-of-line routine.

    • util::DefaultFieldComparator will be final in a future version of protobuf. Subclasses should inherit from SimpleFieldComparator instead.

    C#

    • Add .NET 5 target and improve WriteString performance with SIMD (#8147)

    Java

    • deps: update JUnit and Truth (#8319)
    • Detect invalid overflow of byteLimit and return InvalidProtocolBufferException as documented.

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump protobuf-java from 3.2.0 to 3.16.1 in /motan-extension/codec-extension

    Bump protobuf-java from 3.2.0 to 3.16.1 in /motan-extension/codec-extension

    Bumps protobuf-java from 3.2.0 to 3.16.1.

    Release notes

    Sourced from protobuf-java's releases.

    Protocol Buffers v3.16.1

    Java

    • Improve performance characteristics of UnknownFieldSet parsing (#9371)

    Protocol Buffers v3.16.0

    C++

    • Fix compiler warnings issue found in conformance_test_runner #8189 (#8190)
    • Fix MinGW-w64 build issues. (#8286)
    • [Protoc] C++ Resolved an issue where NO_DESTROY and CONSTINIT are in incorrect order (#8296)
    • Fix PROTOBUF_CONSTINIT macro redefinition (#8323)
    • Delete StringPiecePod (#8353)
    • Fix gcc error: comparison of unsigned expression in '>= 0' is always … (#8309)
    • Fix cmake install on iOS (#8301)
    • Create a CMake option to control whether or not RTTI is enabled (#8347)
    • Fix endian.h location on FreeBSD (#8351)
    • Refactor util::Status (#8354)
    • Make util::Status more similar to absl::Status (#8405)
    • Fix -Wsuggest-destructor-override for generated C++ proto classes. (#8408)
    • Refactor StatusOr and StringPiece (#8406)
    • Refactor uint128 (#8416)
    • The ::pb namespace is no longer exposed due to conflicts.
    • Allow MessageDifferencer::TreatAsSet() (and friends) to override previous calls instead of crashing.
    • Reduce the size of generated proto headers for protos with string or bytes fields.
    • Move arena() operation on uncommon path to out-of-line routine
    • For iterator-pair function parameter types, take both iterators by value.
    • Code-space savings and perhaps some modest performance improvements in RepeatedPtrField.
    • Eliminate nullptr check from every tag parse.
    • Remove unused _$name$cached_byte_size fields.
    • Serialize extension ranges together when not broken by a proto field in the middle.
    • Do out-of-line allocation and deallocation of string object in ArenaString.
    • Streamline ParseContext::ParseMessage to avoid code bloat and improve performance.
    • New member functions RepeatedField::Assign, RepeatedPtrField::{Add, Assign}.
    • Fix undefined behavior warning due to innocuous uninitialization of value on an error path.
    • Avoid expensive inlined code space for encoding message length for messages

      = 128 bytes and instead do a procedure call to a shared out-of-line routine.

    • util::DefaultFieldComparator will be final in a future version of protobuf. Subclasses should inherit from SimpleFieldComparator instead.

    C#

    • Add .NET 5 target and improve WriteString performance with SIMD (#8147)

    Java

    • deps: update JUnit and Truth (#8319)
    • Detect invalid overflow of byteLimit and return InvalidProtocolBufferException as documented.

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Use 'volatile' to mark flag variable thread safety.

    Use 'volatile' to mark flag variable thread safety.

    Use 'volatile' to mark flag variable thread safety.

    opened by wangxuetao 1
  • add auto destroy rpccontext for client end

    add auto destroy rpccontext for client end

    add auto destroy rpccontext for client end

    opened by rayzhang0603 0
  • @MotanAsync 注解生成的*Async文件位置错误

    @MotanAsync 注解生成的*Async文件位置错误

    version· : 1.1.9

    @MotanAsync
    public interface MotanDemoService {
        String hello(String name);
    }
    

    生成的类位于根目录下,不在原项目下

    opened by yu199195 5
  • error_message: NettyClient  getChannel error,  status: 503, error_code: 10001

    error_message: NettyClient getChannel error, status: 503, error_code: 10001

    调用偶发 error_message: NettyClient getChannel error,这个是什么原因导致的呢? 异常信息为 com.weibo.api.motan.exception.MotanServiceException: error_message: NettyChannel send request to server Error: url=motan://xxxx:19761/com.antfact.biz.interactive.api.AccountQu eryApi local=/xxxx:33158 requestId=1644367101894328333 interface=xxxApi method=xxxxxx(long,java.util.Set), status: 503, error_code: 10001,r=null

    opened by hapoy9 4
  • motan不同网段server端报超时分析

    motan不同网段server端报超时分析

    • 分析 注:(client和server只建立连接,没有通信)

    不同网段,client是本机,server是k8s容器 同个网段,client/server均为k8s容器

    这个问题关键点在于,motan是基于TCP keep-alive 机制发心跳的,这个参数linux默认是7200s 间隔75s 发9次 cat /proc/sys/net/ipv4/tcp_keepalive_time cat /proc/sys/net/ipv4/tcp_keepalive_intvl cat /proc/sys/net/ipv4/tcp_keepalive_probes 防火墙断连时间 推断 为1小时,其实只要设置tcp_keepalive_time 小于防火墙时间就行。 之前物理机上是30s没报过错, 上容器后默认7200s,不同网段会报错。 建议将这个参数tcp_keepalive_time,写在wiki说明下。

    opened by yy1193889747 1
Releases(1.1.10)
Owner
Weibo R&D Open Source Projects
Weibo R&D Open Source Projects
Tars is a high-performance RPC framework based on name service and Tars protocol, also integrated administration platform, and implemented hosting-service via flexible schedule.

TARS - A Linux Foundation Project TARS Foundation Official Website TARS Project Official Website WeChat Group: TARS01 WeChat Offical Account: TarsClou

THE TARS FOUNDATION PROJECTS 9.3k Jan 13, 2022
Hprose is a cross-language RPC. This project is Hprose 3.0 for PHP

Hprose 3.0 for PHP Introduction Hprose is a High Performance Remote Object Service Engine. It is a modern, lightweight, cross-language, cross-platform

Hprose 2k Jan 12, 2022
A light-weight RPC implement of google protobuf RPC framework.

sofa-pbrpc A light-weight RPC implementation of Google's protobuf RPC framework. Wiki: https://github.com/baidu/sofa-pbrpc/wiki Features High performa

Baidu 2k Jan 11, 2022
Php-rpc-server - JSON RPC server implementation for PHP.

JSON RPC Server implementation for PHP. The json-rpc is a very simple protocol. You can see this by reading the protocol specification. This library i

null 4 Dec 25, 2021
A collection of samples that demonstrate how to call Google Cloud services from PHP.

PHP Docs Samples A collection of samples that demonstrate how to call Google Cloud services from PHP. See our other Google Cloud Platform github repos

Google Cloud Platform 797 Jan 10, 2022
A collection of samples that demonstrate how to call Google Cloud services from PHP.

PHP Docs Samples A collection of samples that demonstrate how to call Google Cloud services from PHP. See our other Google Cloud Platform github repos

Google Cloud Platform 796 Dec 22, 2021
Production-grade rapid controller development with built in love for API and Search

Installation For CakePHP 4.x compatible version: composer require friendsofcake/crud For CakePHP 3.x compatible version: composer require friendsofca

Friends Of Cake 351 Dec 18, 2021
High-performance, low-memory-footprint, single-file embedded database for key/value storage

LDBA - a fast, pure PHP, key-value database. Information LDBA is a high-performance, low-memory-footprint, single-file embedded database for key/value

Simplito 9 Mar 17, 2021
High performance pocketmine 4.0 vote plugin

Voting38 This is a threaded high performance voting plugin for PocketMine-MP API 4.0 You can configure messages and voting rewards in the config. Ther

KingOfTurkey38 2 Jan 6, 2022
This is a port of the original WireGuard UI bits as implemented by Netgate in pfSense 2.5.0 to a package suitable for rapid iteration and more frequent updating on future releases of pfSense.

This is a port of the original WireGuard*** UI bits as implemented by Netgate in pfSense 2.5.0 to a package suitable for sideloading and more frequent updating on future releases of pfSense. This also includes some improvments such as a proper status page (found under Status / WireGuard Status) and improved assigned interface handling.

R. Christian McDonald 187 Jan 6, 2022
A high-level machine learning and deep learning library for the PHP language.

Rubix ML A high-level machine learning and deep learning library for the PHP language. Developer-friendly API is delightful to use 40+ supervised and

Rubix 1.5k Jan 12, 2022
Zephir is a compiled high level language aimed to the creation of C-extensions for PHP.

Zephir - is a high level programming language that eases the creation and maintainability of extensions for PHP. Zephir extensions are exported to C c

Zephir Language 3.1k Jan 20, 2022
Rubix ML - A high-level machine learning and deep learning library for the PHP language.

A high-level machine learning and deep learning library for the PHP language. Developer-friendly API is delightful to use 40+ supervised and

Rubix 1.5k Jan 12, 2022
The game is implemented as an example of scalable and high load architecture combined with modern software development practices

Crossword game The game is implemented as an example of scalable and high load architecture combined with modern software development practices Exampl

Roman 50 Dec 27, 2021
Making multiple identical function calls has the same effect as making a single function call.

Making multiple identical function calls has the same effect as making a single function call.

李铭昕 4 Oct 16, 2021
PHP Text Analysis is a library for performing Information Retrieval (IR) and Natural Language Processing (NLP) tasks using the PHP language

php-text-analysis PHP Text Analysis is a library for performing Information Retrieval (IR) and Natural Language Processing (NLP) tasks using the PHP l

null 436 Jan 3, 2022
A repository for showcasing my knowledge of the PHP programming language, and continuing to learn the language.

Learning PHP (programming language) I know very little about PHP. This document will list all my knowledge of the PHP programming language. Basic synt

Sean P. Myrick V19.1.7.2 1 Nov 26, 2021