Skip to main content

19 posts tagged with "apache shenyu"

View All Tags

[Co-authoring the future with ShenYu]

· 4 min read

Self Introduction:#

Hello everyone, I'm Le Zhang, with the github-id: kerwin612. I am extremely grateful to the Apache ShenYu community for recognizing my contributions and giving me the opportunity to become a Committer for this outstanding open-source project. Today, I would like to share my experience participating in the Apache ShenYu project, the growth I have achieved, and some suggestions.

Getting to know Apache ShenYu#

My journey with Apache ShenYu began during my exploration of gateway technology options for my company. Upon discovering the ShenYu project, I was immediately intrigued by its high performance, multi-protocol support, easy scalability, and the wealth of ready-to-use plugins it offered. As a result, I decided to delve deeper into it and successfully ran the dev version of ShenYu in my local environment.

My way to Open source#

As a full-stack engineer, I have a certain understanding of both front-end and back-end technologies, which enabled me to comprehensively understand and experience ShenYu. During my trial period, I identified numerous areas for optimization and decided to take action. I created a task list, tackled each issue one by one, and submitted my improvements to the community.

On the front-end side, my optimizations primarily included:

  • Thoroughly reviewing the entire website's styling and fixing multiple style anomalies. Although these anomalies seemed minor, they directly impacted users' visual experience. By addressing these issues, I was able to enhance the cleanliness and aesthetics of ShenYu's front-end interface, thereby improving users' overall experience.

  • Implementing multiple experience enhancements. These enhancements ranged from adjusting the position of a button to improving the interaction logic of an interface. By making these optimizations, I made ShenYu's front-end interface more intuitive and significantly enhanced users' convenience.

  • Actively addressing over twenty front-end-related issues. These issues included both problems encountered by users during their usage and suggestions for improvement proposed by community members. I carefully analyzed the causes of each issue and successfully resolved them, contributing to the stability of ShenYu's front-end.

On the back-end side, my contributions mainly focused on:

  • Handling over ten back-end-related issues. These issues encompassed bug fixes and feature enhancements. Through referencing documentation, debugging code, and ultimately seeking feedback from project managers, I resolved each issue.

  • Implementing a new isBlank conditional judgment function. This function facilitates the determination of whether a request contains a specific parameter, providing convenience for back-end logical processing.

  • Developing a new plugin, basic-auth. This plugin enables basic authentication and authorization functionality. Through collaboration with other community members, I successfully completed the plugin's development and testing, integrating it into ShenYu.

My experience in Apahce ShenYu Community

As I submitted more and more pull requests, I gradually delved deeper into the core of the Apache ShenYu community. Here, I felt the enthusiasm and openness of the community members. They were always willing to share knowledge and experience, helping me better understand and use ShenYu. After a period of hard work and accumulation, I received an invitation from the ShenYu community to officially become a Committer of this outstanding team.

Becoming an Apache Committer is not only an honor for me but also a responsibility and commitment. It represents the community's trust and recognition of me, and it also strengthened my determination to contribute to the community. I am well aware that becoming a Committer is merely a new starting point. In the days ahead, I will continue to participate in ShenYu's optimization and development work, constantly enhancing my skills and capabilities. I will keep up with community updates and demands, actively participate in community activities and discussions, and contribute even more to ShenYu's growth.

Moreover, I plan to further delve into the technical details and architectural principles of Apache ShenYu, enabling me to better provide technical support and solutions to the community. I believe that through continuous learning and practice, I can become a more accomplished Committer and make even greater contributions to Apache ShenYu's development.

Finally, I want to express my gratitude to the Apache ShenYu community for giving me this opportunity and trust, as well as to all community members for their support and assistance. I am confident that with our collective efforts, Apache ShenYu will continue to excel!

Thanks all!

[Apache ShenYu 2.6.0 Version Release]

· 14 min read

Apache ShenYu#

Apache ShenYu is a responsive API gateway developed using Java Reactor. With its high performance, dynamic and flexible traffic control, hot swap, easy deployment and other features, out of the box to provide users with a full lifecycle of 'API' gateway, including 'API' registration, service proxy, protocol conversion, 'API' documentation and 'API' governance and other functions. Apache ShenYu graduated as an Apache top-level project in 'July 2022'.

website: https://shenyu.apache.org

GitHub: https://github.com/apache/shenyu

Version preview#

Six months later, Apache ShenYu released version 2.6.0, which submitted a total of 280+ Pull requests, added about 20+ new features, added several enhancements, refactored several features, and fixed several bugs. A total of 78 contributors participated, with a cumulative total of 350+ contributors.

version records: https://github.com/apache/shenyu/compare/v2.5.1...v2.6.0

New Feature#

  1. Supports the plug-in upload function and gateway hot load plug-in

the specific use please see: https://shenyu.apache.org/zh/docs/next/developer/custom-plugin

specific pr please see: https://github.com/apache/shenyu/pull/4392

  1. Apollo is supported as the data synchronization and registry
sheneyu:  sync:    apollo:      appId: shenyu      meta: http://localhost:8080      env: dev      clusterName: test      namespace: application

specific pr please see: https://github.com/apache/shenyu/pull/4532

  1. The springboot client can be dynamically configured on the shenyu client

  2. Add the TCP plug-in

the specific use please see: https://shenyu.apache.org/zh/docs/next/plugin-center/proxy/tcp-plugin

specific pr please see: https://github.com/apache/shenyu/pull/4607

https://github.com/apache/shenyu/pull/4766

  1. Support springmvn(boot) to collect api-meta data from shenyu client

specific pr please see: https://github.com/apache/shenyu/pull/4600

  1. Add support for the shenyu ingress controller

the specific use please see: https://shenyu.apache.org/zh/docs/user-guide/kubernetes-controller/build-deploy

https://shenyu.apache.org/zh/docs/user-guide/kubernetes-controller/config

specific pr please see: https://github.com/apache/shenyu/pull/4620

配置如下:

shenyu:  netty:    http:      sni:        enabled: true        mod: k8s #k8s模式适用        defaultK8sSecretNamespace: shenyu-ingress #默认secret资源的namespace        defaultK8sSecretName: default-cert #默认secret资源名字
  1. Add a zookeeper, naocs, Apollo, HttpLongPolling, consul as shenyu service discovery

specific pr please see: https://github.com/apache/shenyu/pull/4636

https://github.com/apache/shenyu/pull/4657

https://github.com/apache/shenyu/pull/4802

https://github.com/apache/shenyu/pull/4795

https://github.com/apache/shenyu/pull/4800

https://github.com/apache/shenyu/issues/4562

  1. Add Huawei Cloud lts log collection

specific pr please see: https://github.com/apache/shenyu/pull/4812

  1. Add opengauss database support

specific pr please see: https://github.com/apache/shenyu/pull/4856

10.添加polaris作为shenyu的数据同步和注册中心

shenyu:  sync:    polaris:      url: 127.0.0.1:8093      namespace:      fileGroup:

specific pr please see: https://github.com/apache/shenyu/pull/4410

https://github.com/apache/shenyu/pull/4897

  1. Add shenyu matching cache
shenyu:  selectorMatchCache:    ## selector L1 cache    cache:      enabled: false      initialCapacity: 10000 # initial capacity in cache      maximumSize: 10000 # max size in cache    ## selector L2 cache, use trie as L2 cache    trie:      enabled: false      cacheSize: 128 # the number of plug-ins      matchMode: antPathMatch  ruleMatchCache:    ## rule L1 cache    cache:      enabled: true      initialCapacity: 10000 # initial capacity in cache      maximumSize: 65536 # max size in cache    ## rule L2 cache, use trie as L2 cache    trie:      enabled: false      cacheSize: 1024 # the number of selectors      matchMode: antPathMatch

the specific use please see: https://shenyu.apache.org/zh/docs/next/user-guide/property-config/client-property-config

specific pr please see: https://github.com/apache/shenyu/pull/4417

https://github.com/apache/shenyu/pull/4536

  1. Added support for prometheus for shenyu admin

specific pr please see: https://github.com/apache/shenyu/pull/4336

  1. Expose the endpoints of shenyu actuator

Note: You can use pr to view the memory data of shenyu gateway

specific pr please see: https://github.com/apache/shenyu/pull/4637

Check the configuration of actuator:

management:  endpoints:    web:      exposure:        include: "*" # or health,info

Enhanced#

  1. Add tags attribute to API doc client

the specific use please see: https://shenyu.apache.org/docs/user-guide/api-doc/shenyu-annotation-apidoc

specific pr please see: https://github.com/apache/shenyu/pull/4362

  1. Add Brpc integration tests

specific pr please see: https://github.com/apache/shenyu/pull/4319

3.Brpc supports shared thread pools

specific pr please see: https://github.com/apache/shenyu/pull/4402

  1. Add mapping types for cryptorRequst and cryptorResponse

specific pr please see: https://github.com/apache/shenyu/pull/4418

  1. Encryption plug-in supports multiple field encryption

specific pr please see: https://github.com/apache/shenyu/pull/4435

  1. Add the p2c load balancing algorithm

specific pr please see: https://github.com/apache/shenyu/pull/4451

  1. Generate a plug-in string using base64 and store it in the plug-in data

the specific use please see: https://shenyu.apache.org/zh/docs/next/developer/custom-plugin

specific pr please see: https://github.com/apache/shenyu/pull/4473

  1. Add the shortest response load balancing algorithm

specific pr please see: https://github.com/apache/shenyu/pull/4488

  1. Add a hash load balancing test case

specific pr please see: https://github.com/apache/shenyu/pull/4383

  1. Add the DetailSerivice test case

specific pr please see: https://github.com/apache/shenyu/pull/4450

  1. Provide broad routing policies

Specific configurations are as follows:

shenyu:    switchConfig:       local: true       collapseSlashes: false #true表示开启宽泛路径支持

specific pr please see: https://github.com/apache/shenyu/pull/4522

  1. Add shenyu-common enums package test cases

specific pr please see: https://github.com/apache/shenyu/pull/4541

  1. Add shenyu-common dto package test cases

specific pr please see: https://github.com/apache/shenyu/pull/4549/

  1. Add the model package test case of add shenyu-admin

specific pr please see: https://github.com/apache/shenyu/issues/4540

  1. Add the shenyu match cache test case

specific pr please see: https://github.com/apache/shenyu/pull/4557

  1. Support k8s probe

specific pr please see: https://github.com/apache/shenyu/pull/4567

  1. Add a service package test for shenyu-admin

specific pr please see: https://github.com/apache/shenyu/pull/4579

  1. Add json support to the API documentation

specific pr please see: https://github.com/apache/shenyu/pull/4591

  1. The SPEL of the mock plugin is secure by default

specific pr please see: https://github.com/apache/shenyu/pull/4606

  1. Add ShenyuClientApiDocExecutorSubscriber test cases

specific pr please see: https://github.com/apache/shenyu/pull/4632

  1. Add test cases for shenyu-client-sofa module

specific pr please see: https://github.com/apache/shenyu/pull/4688

  1. Add 'tag relation' to 'shenyu api doc'

specific pr please see: https://github.com/apache/shenyu/pull/4362

  1. Add start and stop scripts for windows

specific pr please see: https://github.com/apache/shenyu/pull/4673

  1. Add a test case for 'ShenyuSdkClientFactory'

specific pr please see: https://github.com/apache/shenyu/pull/4645

  1. Add websocket synchronization support for shenyu e2e springcloud plugin

specific pr please see: https://github.com/apache/shenyu/pull/4698

  1. Support divide plugin automatically offline

specific pr please see: https://github.com/apache/shenyu/pull/4702

  1. Add the springcloud service instance cache

specific pr please see: https://github.com/apache/shenyu/pull/4705

the specific use please see: https://shenyu.apache.org/zh/docs/next/plugin-center/proxy/spring-cloud-plugin

shenyu:    springCloudCache:       enabled: false # 为true是开启springcloud缓存
  1. Changing the password supports i18n

specific pr please see: https://github.com/apache/shenyu/pull/4758

29.shenyu discovery supports websocket synchronization

specific pr please see: https://github.com/apache/shenyu/pull/4768

  1. Upgrade 'springboot' version to '2.7.13'

specific pr please see: https://github.com/apache/shenyu/pull/4783

  1. Add nacos and zookeeper synchronization test for e2e-springcloud

specific pr please see: https://github.com/apache/shenyu/pull/4747

  1. Add 'api doc client' annotation generation property

specific pr please see: https://github.com/apache/shenyu/pull/4845

  1. Support 'zookeeper' client automatically offline

specific pr please see: https://github.com/apache/shenyu/pull/4806

  1. Support 'Apollo client' automatic offline

specific pr please see: https://github.com/apache/shenyu/pull/4855

  1. Support swagger documents and store them in a database

specific pr please see: https://github.com/apache/shenyu/pull/4849

  1. Support 'nacos client' automatic offline

specific pr please see: https://github.com/apache/shenyu/pull/4890

  1. Add the alibaba dubbo e2e test case

specific pr please see: https://github.com/apache/shenyu/pull/4859

  1. Add the apache dubbo e2e test case

specific pr please see: https://github.com/apache/shenyu/pull/4899

  1. Add shenyu spring sdk test cases

specific pr please see: https://github.com/apache/shenyu/pull/4913

  1. Add sofa e2e test

specific pr please see: https://github.com/apache/shenyu/pull/4919

  1. Add a test case for Apollo data synchronization

specific pr please see: https://github.com/apache/shenyu/pull/4918

  1. Add the Connection pool configuration for the database (hakari)

specific pr please see: https://github.com/apache/shenyu/pull/4938

  1. Add 'idea icon' for shenyu

specific pr please see: https://github.com/apache/shenyu/pull/4951

Refactor#

  1. Reconstruct shenyu admin

specific pr please see: https://github.com/apache/shenyu/pull/4355

  1. Optimize the least active balance algorithm

specific pr please see: https://github.com/apache/shenyu/pull/4342

  1. Optimize the compatibility of the first version of shenyu sign plugin

specific pr please see: https://github.com/apache/shenyu/pull/4332

the specific use please see: https://shenyu.apache.org/docs/plugin-center/security/sign-plugin

  1. Optimize the shenyu upstream check logic

specific pr please see: https://github.com/apache/shenyu/pull/4386

  1. Optimize the global version of the project

specific pr please see: https://github.com/apache/shenyu/pull/4394

  1. Optimize the code of 'ShenyuConsulConfigWatch'

specific pr please see: https://github.com/apache/shenyu/pull/4400

  1. Optimize shenyu prefix tree matching logic

specific pr please see: https://github.com/apache/shenyu/pull/4414

  1. Optimize the verification when the rule condition is submitted

specific pr please see: https://github.com/apache/shenyu/pull/4403

  1. Optimize the shenyu-client-websocket client registration code

specific pr please see: https://github.com/apache/shenyu/pull/4462

  1. Add shenyu admin's Micrometer dependent license

specific pr please see: https://github.com/apache/shenyu/pull/4409

  1. Update the maven-assembly-plugin packaging plug-in to version 3.5.0

specific pr please see: https://github.com/apache/shenyu/pull/4673

  1. Optimize the ordering of global plug-ins

specific pr please see: https://github.com/apache/shenyu/pull/4429

  1. Use BearerToken instead of StatelessToken in shenyu admin

specific pr please see: https://github.com/apache/shenyu/pull/4516

  1. Reconstructs the shenyu-logging module

specific pr please see: https://github.com/apache/shenyu/pull/4526

  1. Verify api doc

specific pr please see: https://github.com/apache/shenyu/pull/4564

  1. Optimize shenyu prefix tree and support '*' matching

specific pr please see: https://github.com/apache/shenyu/pull/4569

  1. Optimize the hot loading of plug-ins

specific pr please see: https://github.com/apache/shenyu/pull/4392

  1. Optimize the putPlugin method of 'ShenyuWebHandler'

specific pr please see: https://github.com/apache/shenyu/pull/4598

  1. Refactor Shenyu webfilter

specific pr please see: https://github.com/apache/shenyu/pull/4614

  1. Refactor the oauth2 plguin plug-in

specific pr please see: https://github.com/apache/shenyu/pull/4624

  1. Refactor the continued field of the shenyu selector

specific pr please see: https://github.com/apache/shenyu/pull/4635

  1. Refactor shenyu selection and rule matching cache

specific pr please see: https://github.com/apache/shenyu/pull/4578

  1. Deleted unused generics from the shenyu client

specific pr please see: https://github.com/apache/shenyu/pull/4653

  1. Refactor shenyu's support for sentinel plug-ins

specific pr please see: https://github.com/apache/shenyu/pull/4669

  1. Expose cached data through actuator terminals

specific pr please see: https://github.com/apache/shenyu/pull/4637

https://github.com/apache/shenyu/pull/4658 26. Refactor the checkUserPassword method to boot without printing a known error log

specific pr please see: https://github.com/apache/shenyu/pull/4697

  1. Add parameters for printing logs

specific pr please see: https://github.com/apache/shenyu/pull/4637

  1. Reconstructs shenyu global exception handling

specific pr please see: https://github.com/apache/shenyu/pull/4709

  1. Added shenyu plugin to upload integration test

specific pr please see: https://github.com/apache/shenyu/pull/4679

  1. Optimize grammar candy

specific pr please see: https://github.com/apache/shenyu/pull/4700

  1. Optimize discovery_handler_id of discovery_upstream

specific pr please see: https://github.com/apache/shenyu/pull/4710

  1. Reconstruct the shenyu-plugin module and archive proxy plug-ins by category

specific pr please see: https://github.com/apache/shenyu/pull/4765

  1. Refactor the cache of AlibabaDubboConfigCache

specific pr please see: https://github.com/apache/shenyu/pull/4772

  1. Remove hutool dependencies

specific pr please see: https://github.com/apache/shenyu/pull/4773

  1. Refactor 'ShenyuClientShutdownHook'

specific pr please see: https://github.com/apache/shenyu/pull/4780

  1. Add BaseAnnotationApiBeansExtractor Extractor

specific pr please see: https://github.com/apache/shenyu/pull/4787

  1. Support multi-client registration

specific pr please see: https://github.com/apache/shenyu/pull/4790

  1. Refactoring Shenyu-e2e supports Shenyu's check style

specific pr please see: https://github.com/apache/shenyu/pull/4799

  1. Optimize shenyu client registration logic

specific pr please see: https://github.com/apache/shenyu/pull/4809

  1. Add a domain test for the shenyu divide plugin

specific pr please see: https://github.com/apache/shenyu/pull/4803

  1. Update the extension of the rpc_ext field

specific pr please see: https://github.com/apache/shenyu/pull/4821

  1. Optimize consul connection operations

specific pr please see: https://github.com/apache/shenyu/pull/4832

  1. Refactor the yaml addition of springcloud for shenyu e2e

specific pr please see: https://github.com/apache/shenyu/pull/4837

  1. Add integration tests for the k8s ingress controller

specific pr please see: https://github.com/apache/shenyu/pull/4820

  1. Split the document field of the apidoc detail interface and add fields such as requestHeaders and responseParameters

specific pr please see: https://github.com/apache/shenyu/pull/4865

  1. Add a swagger example project to test the functionality of the API documentation

specific pr please see: https://github.com/apache/shenyu/pull/4825

  1. Optimize the display of shenyu admin's form fields in json format

specific pr please see: https://github.com/apache/shenyu/pull/4873

  1. Reconstruct the observability of shenyu logs

specific pr please see: https://github.com/apache/shenyu/pull/4874

  1. Add the bootstrap boot log

specific pr please see: https://github.com/apache/shenyu/pull/4879

  1. Refactor swagger's api documentation

specific pr please see: https://github.com/apache/shenyu/pull/4892

  1. Upgrade grpc version to 1.53.0

specific pr please see: https://github.com/apache/shenyu/pull/4841

  1. Refactor api metadata handlers

specific pr please see: https://github.com/apache/shenyu/pull/4948

  1. Optimize code and pom dependencies

specific pr please see: https://github.com/apache/shenyu/pull/4945

Bug Fixes#

  1. Optimize the h2 path

specific pr please see: https://github.com/apache/shenyu/pull/4351

  1. Fix the invocation error of the encryption response plug-in

specific pr please see: https://github.com/apache/shenyu/pull/4331

  1. Fix the jdk8 Map computeIfAbsent performance bug

specific pr please see: https://github.com/apache/shenyu/pull/4338

  1. Fix zombieRemovalTimes code

specific pr please see: https://github.com/apache/shenyu/pull/4368

  1. Rectify the sql error after the upgrade

specific pr please see: https://github.com/apache/shenyu/pull/4374

  1. Delete the detectorOfflineLinks tag

specific pr please see: https://github.com/apache/shenyu/pull/4382

  1. Ignore flat pom

specific pr please see: https://github.com/apache/shenyu/pull/4390

  1. Repair the LOG invocation method

specific pr please see: https://github.com/apache/shenyu/pull/4387

  1. Fix the NPE of sheyu-example-springcloud using nacos

specific pr please see: https://github.com/apache/shenyu/pull/4396

  1. Fix Shenyu-admin name type dispute

specific pr please see: https://github.com/apache/shenyu/pull/4340

  1. Restore the load balancing spi resource

specific pr please see: https://github.com/apache/shenyu/pull/4411

  1. Rectify sql script errors

specific pr please see: https://github.com/apache/shenyu/pull/4412

  1. Fix jackson's 24 hour format and time zone

specific pr please see: https://github.com/apache/shenyu/pull/4413

  1. Fix JwtUtils error

specific pr please see: https://github.com/apache/shenyu/pull/4420

  1. Fix dubbo caller cache bug

specific pr please see: https://github.com/apache/shenyu/pull/4433

  1. Delete the lost HOST

specific pr please see: https://github.com/apache/shenyu/pull/4425

  1. Repair SpringMvcClientEventListener test cases

specific pr please see: https://github.com/apache/shenyu/pull/4252

  1. Fix the zombie update PENDING_SYNC error

specific pr please see: https://github.com/apache/shenyu/pull/4430

  1. Repair memory leaks in the windlfu

specific pr please see: https://github.com/apache/shenyu/pull/4486

  1. Fix the rule query failure caused by too many rules

specific pr please see: https://github.com/apache/shenyu/pull/4499

  1. Fix missing actuator dependencies and port errors in sample http

specific pr please see: https://github.com/apache/shenyu/pull/4506

  1. Fix http and https errors on UpstreamCheckUtils

specific pr please see: https://github.com/apache/shenyu/pull/4509

  1. Fix memory leak caused by FileFilter

specific pr please see: https://github.com/apache/shenyu/pull/4507

  1. Fix the zookeeper synchronization error

specific pr please see: https://github.com/apache/shenyu/pull/4906

  1. The memory leak repair MemorySafeWindowTinyLFUMap errors

specific pr please see: https://github.com/apache/shenyu/pull/4524

  1. Fix ApiDoc path missing separator

specific pr please see: https://github.com/apache/shenyu/pull/4528

  1. Fix shenyu trie's NPE

specific pr please see: https://github.com/apache/shenyu/pull/4533

  1. Fix plugin skip error

specific pr please see: https://github.com/apache/shenyu/pull/4589

  1. Rectify the oracle sql error

specific pr please see: https://github.com/apache/shenyu/pull/4595

  1. Fix shenyu admin can not load shenyu icon issue

specific pr please see: https://github.com/apache/shenyu/pull/4605

  1. Fix the hystrix fallback bug

specific pr please see: https://github.com/apache/shenyu/pull/4593

  1. Fix the warm-up time for divide and springcloud

specific pr please see: https://github.com/apache/shenyu/pull/4619

  1. Fix springcloud service selector

specific pr please see: https://github.com/apache/shenyu/pull/4639

  1. Fix shenyu-spring-boot-starter-plugin-mock add spring.factories

specific pr please see: https://github.com/apache/shenyu/pull/4644

  1. Fix shenyu-client-mvc and shenyu-client-springcloud lost ip

specific pr please see: https://github.com/apache/shenyu/pull/4681

  1. Fix empty rule data and selector data in cache

specific pr please see: https://github.com/apache/shenyu/pull/4716

  1. Fix api documentation module update api details error

specific pr please see: https://github.com/apache/shenyu/pull/4720

  1. Fix getting topic from configuration in KafkaLogCollectClient

specific pr please see: https://github.com/apache/shenyu/pull/4756

  1. Fix thread safety issue with loggingConsole plugin

specific pr please see: https://github.com/apache/shenyu/pull/4763

  1. Fix brpc integration test response size

specific pr please see: https://github.com/apache/shenyu/pull/4784

  1. Fix plugn-Dubco-common selector update gray release to remove cache

specific pr please see: https://github.com/apache/shenyu/pull/4762

  1. Fix shenyu admin menu name bug

specific pr please see: https://github.com/apache/shenyu/pull/4805

  1. Fix the problem that shenyu admin cannot configure consul ports

specific pr please see: https://github.com/apache/shenyu/pull/4843

  1. Fix shenyu client metadata and uri cannot be synchronized with apollo to admin

specific pr please see: https://github.com/apache/shenyu/pull/4851

  1. Fix PathVariable annotation url does not match

specific pr please see: https://github.com/apache/shenyu/pull/4852

  1. Fixed an issue where URIs could not be updated in PathPattern mode

specific pr please see: https://github.com/apache/shenyu/pull/4854

  1. Fix the client close method call twice

specific pr please see: https://github.com/apache/shenyu/pull/4867

  1. Fix shenyu error processing consul configuration

specific pr please see: https://github.com/apache/shenyu/pull/4872

  1. Delete the unused configuration from the Request and modifyResponse plug-ins

specific pr please see: https://github.com/apache/shenyu/pull/4882

  1. Fix the http registration metadata error

specific pr please see: https://github.com/apache/shenyu/pull/4889

  1. Fixed an issue where websocket lost user-defined close status

specific pr please see: https://github.com/apache/shenyu/pull/4844

  1. Fix consul register lost meta path property when special symbol

specific pr please see: https://github.com/apache/shenyu/pull/4885

  1. Fix etcd synchronization errors

specific pr please see: https://github.com/apache/shenyu/pull/4911

  1. Rectify multiple synchronization event errors on shenyu admin

specific pr please see: https://github.com/apache/shenyu/pull/4941

  1. Fix Shenyu motan plugin execution error

specific pr please see: https://github.com/apache/shenyu/pull/4934

Contributors#

Special thanks to the following contributors for their support and participation in the '2.6.0' release (in no particular order).

midnight2104,koonchen,847850277,balloon72,yu199195,iwangjie,damonxue,tian-pengfei,caojiajun,dragon-zhang,u3breeze,li-keguo,SuperMonkeyC,mahaitao617,tomsun28,moremind,liaolzy,Ceilzcx,misaya295,BoyuLi4,HaiqiQin,starlight2003,stulzq,ywj1352,yunlongn,aFlyBird0,dengliming,plutokaito,xuyicheng1995,lan-dian,sachin10fi,zuobiao-zhou, hudongdong129,crudboy,aoshiguchen,VampireAchao,JooKS-me,Redick01,huanccwang,lijay7674,omernaci,peng-heng,December-Pb,6freeair2016,jieyangxchen,lianjunwei,u3breeze,eurecalulu,wanyaoasiainfo,wanyaoasiainfo,Kakk22,xuziyang,menglujing,xcsnx,yu1183688986,lahmXu,fabian4,ileonli,VampireAchao,GOODBOY008,TeslaCN

Become a contributor#

We welcome every contributor to join ShenYu, and welcome contributors to participate in ShenYu in the spirit of Apache Way!

See the contributor guidelines:

https://shenyu.apache.org/zh/community/contributor-guide

【The Student's Journey of Contributing to Apache ShenYu】

· 2 min read

New Committer Introduction#

Name:Haiqi Qin

University:Northeastern University

Role: Apache ShenYu Committer

Email:haiqi@apache.org

Github:https://github.com/HaiqiQin

First encounter shenyu#

The earliest contact with Shenyu was through the introduction of classmate Zhu Kunshuai (jooks me), who had already made many contributions in the community and had some experience. After introducing me to the Shenyu community, he constantly guided me, led me to understand the project, explained the relevant regulations of the community, and under his encouragement, I submitted my first PR about open source projects in my life. In the following days, I mainly tried to study the code of Shenyu, modify some small errors, and do some unit tests or Integration testing of plugins.

Gradually reaching a better state#

As a developer, I certainly don't want my contribution to Shenyu to be limited to testing type tasks. It was during Shenyu's registration for the Google Summer of Code event, so I actively reviewed the topics and ultimately decided to participate in the Shenyu plugin logging elastic search project. Under the patient guidance of Teacher Xiao Yu (Cat Adult), I finally completed the project and successfully submitted the development related code for Shenyu. Through this project, I have gained a better understanding of Shenyu, and at the same time, I am more eager to continue contributing code to Shenyu. Afterwards, I attempted to contribute two load balancing strategies to Shenyu, and will now and in the future contribute to the Shenyu-e2e module.

Harvest full#

  • Learned more about gateways and services.

  • Learned the registration principles of different registration centers.

  • Learned the synchronization principles of different data synchronization methods.

  • Learned how to write more elegant code.

Some suggestions#

  • Learn to read official documents. The document is now quite complete and can basically cover the needs of users.
  • Attend weekly meetings. Shenyu holds a regular meeting every two weeks to introduce the current development progress of the project. Friends can choose tasks they are interested in for development, and they can also communicate with the big shots about technology.

Special Thanks#

I have always believed that Shenyu is a big family with warmth. When I encountered difficulties, many friends provided me with great help, which saved me from taking many detours when making contributions. Thank you to my friends who have helped me (in any order): yu199195, moremind, JooKS-me, erdengk, qifanyy.

[OSPP 2023 & Apache ShenYu task is coming | Invite you to explore the high performance gateway]

· 9 min read

OSPP 2023 & Apache ShenYu e2e task is coming#

OSPP 2023#

Open Source Summer is a summer open source activity initiated and long-term supported by the "Open Source Software Supply Chain Lighting Project" of the Institute of Software, Chinese Academy of Sciences. It aims to encourage students to actively participate in the development and maintenance of open source software, and to cultivate and discover more excellent developers Promote the vigorous development of excellent open source software communities and help the construction of open source software supply chains.

Participate in Open Source Summer#

Open source summer 2023 student registration officially opens on April 29! Students can select projects on the official website of Open Source Summer https://summer-ospp.ac.cn/, communicate with mentor, prepare project application materials, and submit applications.

ospp-2023.jpg

Apache ShenYu Introduction#

Apache ShenYu is a Java gateway that supports multi-language, multi-protocol (Dubbo, SpringCloud, gRPC, Motan, SofaTars, BRPC), plug-in design, highly dynamic configuration, and highly self-developed. Built-in rich plug-in support, authentication, current limit, circuit breaker, firewall, etc. The traffic configuration is dynamic and the performance is extremely high. Support cluster deployment, support A/B Test, blue-green release and other functions.

The Apache ShenYu community is an open source project community organized by the Apache Foundation. Up to now, a total of 340 contributors have gathered around the world. They participate in ShenYu in the spirit of "Apache Way", make contributions to ShenYu, and grow together with ShenYu!

Apache ShenYu E2E Project Introduction#

The task threshold will not be too high, and the whole process will be guided by community tutors.

Project Background#

Shenyu is an asynchronous, high-performance, cross-language, responsive API gateway, but currently Shenyu lacks the necessary end to end engine and test case, end to end test is an important part of the shenyu project as a whole.

Required Skills#

Understand the technical architecture of Apache ShenYu, understand the end-to-end testing framework of Apache ShenYu, be able to use existing code to write TestSpec, need to understand shenyu's data synchronization framework including websocket, http, zookeeper, nacos, apollo and other middleware and algorithms, be able to write docker-compose, understand the necessary tools for e2e development such as testcontainer and docker.

Tasks#

  1. Write shenyu end-to-end test framework, write shenyu end-to-end test engine (difficulty: high)

  2. It is necessary to realize the storage of different databases (mysql, oracle, postgres, h2) of admin in e2e to ensure the correct data storage

  3. It is necessary to ensure that the data can be correctly added to shenyu-admin through the configuration method and shenyu-client registration method (difficulty: high)

  4. Use different data synchronization methods (websocket, http, zookeeper, nacos, apollo) to ensure correct data synchronization from admin to gateway

  5. Add end-to-end test cases of alibaba dubbo, apache dubbo, sofa, tars, motan related proxy plug-ins

  6. Write a specific TestSpec to modify the admin dictionary, metadata, plug-ins, selectors, and rule data, and perform a regression test after the modification to ensure that the calling logic is correct (difficulty: high)

  7. Write the corresponding github ci file to ensure that the ci process works normally in github action

Project Output Requirements#

  1. Write the corresponding e2e test case

  2. Use e2e to realize the test that admin uses different databases to store data

  3. Realize the end-to-end test of synchronizing data in different data synchronization methods

  4. Edit the corresponding e2e document

Project technical requirements#

  1. Follow shenyu code specification

  2. In-depth understanding of spring webflux

  3. In-depth understanding of shenyu's data synchronization principle

  4. In-depth understanding of shenyu client registration data principles

  5. In-depth understanding of shenyu's end-to-end test engine and framework

Project Repository#

Project Website#

Other Information#

What can you gain from the event?#

Development experience#

Participate in open source projects, become a contributor to large-scale open source projects, understand multi-field and multi-difficulty gradient tasks, give you rich practical experience in large-scale open source projects, and it is also a good opportunity to exercise your development capabilities!

Organizing committee awards#

  1. You will get a completion bonus and a completion certificate: Students who pass the completion assessment will have the opportunity to receive an outstanding student certificate.

  2. There are two difficulty levels in this competition, and different levels correspond to different bonuses:

Advanced Difficulty: RMB 12,000 before tax for student completion bonus

Basic difficulty: RMB 8,000 before tax for student completion bonus

The prize money for this competition is provided by the Summer of Open Source Organizing Committee.

Apache ShenYu community in-depth communication#

  1. Participate in the Summer of Open Source @Apache ShenYu project, you will be able to communicate with 300+ contributors in the Apache ShenYu community around the world.

  2. Participate in the Summer of Open Source @Apache ShenYu project, you will become an Apache ShenYu contributor, and after continuing to contribute, you will have the opportunity to become an Apache ShenYu Committer.

Quickly Participate in Open Source Summer#

Open Source Summer 2023 community projects will start accepting students to participate in project applications from April 29th. Welcome to communicate with the tutors and prepare project application materials through the contact information above.

shenyu-ingress-controller ability increased#

Project background#

Kubernetes Controller is an important step in the Apache ShenYu Cloud native construction. The community is building Shenyu-Ingress-Controller to enable the docking of K8s ingress resources. However, currently the shenyu-ingress-controller feature is relatively simple and only supports the resource definition native to K8s ingress.

This project needs to extend Shenyu-Ingress-Controller based on annotation to inherit the rich native functions of Apache ShenYu as much as possible.

Project output requirements#

  • Enhanced shenyu-ingress-controller abilities

  • Complete the core code writing

  • Complete corresponding unit test and integration test

  • Complete related documentation

Technical requirements of the project#

  • Familiar with Java and Spring Framework
  • Be familiar with Kubernetes
  • Understand the API gateway

Project results warehouse#

Project address#

https://summer-ospp.ac.cn/org/prodetail/2362f0183

Other information#

OSPP 2023 & Apache ShenYu Tcp proxy plugin is coming#

OSPP 2023#

Open Source Summer is a summer open source activity initiated and long-term supported by the "Open Source Software Supply Chain Lighting Project" of the Institute of Software, Chinese Academy of Sciences. It aims to encourage students to actively participate in the development and maintenance of open source software, and to cultivate and discover more excellent developers Promote the vigorous development of excellent open source software communities and help the construction of open source software supply chains.

Participate in Open Source Summer#

Open source summer 2023 student registration officially opens on April 29! Students can select projects on the official website of Open Source Summer https://summer-ospp.ac.cn/, communicate with mentor, prepare project application materials, and submit applications.

ospp-2023.jpg

Apache ShenYu Introduction#

Apache ShenYu is a Java gateway that supports multi-language, multi-protocol (Dubbo, SpringCloud, gRPC, Motan, SofaTars, BRPC), plug-in design, highly dynamic configuration, and highly self-developed. Built-in rich plug-in support, authentication, current limit, circuit breaker, firewall, etc. The traffic configuration is dynamic and the performance is extremely high. Support cluster deployment, support A/B Test, blue-green release and other functions.

Apache ShenYu Tcp Proxy Task#

The task threshold will not be too high, and the whole process will be guided by community tutors.

Project Background#

This project is mainly to realize the proxy of different communication protocols (TCP/UDP/WebSocket, etc.) more flexibly and extensibly through the plug-in method, so as to enhance ShenYu's communication proxy function. The project provides a management background that can manually configure and forward downstream IP, PORT and other data. At the same time, it supports downstream services to automatically register with the ShenYu gateway through the ShenYu client. In addition, it also supports the business to provide the registration center address to complete the service discovery and registration functions. When a business request comes in, ShenYu gateway matches different communication protocol plug-ins according to different communication protocol types to complete the communication proxy.

Project Background#

Understand Apache ShenYu's technical architecture, familiar with Java and Spring Framework, familiar with reactor and other front-end components and frameworks, familiar with API gateway, familiar with tcp, udp and other related protocols.

Project Output Requirements#

Complete the development of proxy plug-ins such as tcp/udp/websocket

Task1: Complete the development of proxy plug-in functions for tcp/udp/websocket to proxy to downstream services;

✅ Complete the development of registry monitoring metadata

Task1: Monitor business downstream service-related metadata in various registration centers (nacos/consul/zk, etc.) supported by shenyu-admin development;

✅ Complete the data synchronization development of proxy plug-in related metadata

Task1: Complete the development of communication plug-in proxy related data synchronization to the gateway;

✅ Completion and design service automatic discovery of related tables and background data development

Task1: Complete the design of relevant database tables;

Task2: Complete the CRUD development of related tables;

✅ Complete the editing of relevant data of shenyu management background communication agent

Task1: The front end adds a new page for editing metadata related to communication agents;

Task2: Increase the back-end interface corresponding to the front-end page;

✅ Complete the integration test unit test and document output of the communication protocol agent

Task1: Complete the unit test of relevant changes;

Task2: Complete the integration test of the entire function;

Task3: Complete the output of the entire function-related access documents and function introduction-related documents.

Project technical requirements#

  1. Familiar with Java and Spring Framework

  2. Familiar with front-end components and frameworks such as reactor

  3. Familiar with API Gateway.

Project technical requirements#

Project Address#

Mentor email#

mahaitao@apache.org

Quickly Participate in Open Source Summer#

Open Source Summer 2023 community projects will start accepting students to participate in project applications from April 29th. Welcome to communicate with the tutors and prepare project application materials through the contact information above.

ospp-2023.jpg

[Google Summer of Code & Apache ShenYu task is coming | Invite you to explore the high performance gateway]

· 2 min read

Google Summer of Code & Apache ShenYu springcloud e2e task is coming | Invite you to explore the high performance gateway#

Description#

Shenyu is a native API gateway for service proxy, protocol translation and API governance. but Shenyu lack of End-To-End Tests.

Relevant skills:

  • Understand the architecture of ShenYu
  • Understand SpringCloud micro-service and ShenYu SpringCloud proxy plugin.
  • Understand ShenYu e2e framework and architecture.

How to coding

  • please refer to org.apache.shenyu.e2e.testcase.plugin.DividePluginCases

How to test

  • start shenyu admin in docker
  • start shenyu boostrap in docker
  • run test case org.apache.shenyu.e2e.testcase.plugin.PluginsTest#testDivide

Task List#

  1. develop e2e tests of the springcloud plug-in.
  2. write shenyu e2e springcloud plugin documentation in shenyu-website.
  3. refactor the existing plugin test cases.

Design and implement shenyu ingress-controller in k8s#

Background#

Apache ShenYu is a Java native API Gateway for service proxy, protocol conversion and API governance. Currently, ShenYu has good usability and performance in microservice scenarios. However, ShenYu's support for Kubernetes is still relatively weak.

Tasks#

  1. Discuss with mentors, and complete the requirements design and technical design of shenyu-ingress-controller.
  2. Complete the initial version of shenyu-ingress-controller, implement the reconcile of k8s ingress api, and make ShenYu as the ingress gateway of k8s.
  3. Complete the ci test of shenyu-ingress-controller, verify the correctness of the code.

Relevant Skills#

  1. Know the use of Apache ShenYu
  2. Familiar with Java and Golang
  3. Familiar with Kubernetes and can use java or golang to develop Kubernetes Controller

【From company gateway framework selection to Apache ShenYu Committer】

· 3 min read

Introduction of new Committer#

Hello everyone, my name is Shuo Li , java architect, currently engaged in a big-sized Internet company, It is my honor to be invited by the Apache ShenYu community as the Committer. Let me share with you my first meet, acquaintance, understanding, growth and suggestions with the Apache ShenYu community.

Meet the Apache Shenyu community for the first time#

The story starts from 2020. In the early stage, I used SpringCloud Gateway + Nacos Config Event to realize the dynamic routing of gateway by myself. Because there was no dashboard of Gateway at that time, it was very painful. My team made a dashboard based on Micro Enterprise, which has a lot of functionality and limitations. From then on, I started to pursue a good gateway. One day, I found ShenYu, and saw that ShenYu's overall architecture was in sharper contrast to SpringCloud Gateway. ShenYu outperforms Gateway in terms of overall architecture design, function design, plug-in design, etc. ShenYu can be said to be the next generation gateway product. After that, I started to have a certain understanding of Apache ShenYu from building environment to running example project, and then to read plug-in chain and data synchronization, SPI mechanism and other source code.

Start submitting PR#

It was not until January 2022 that I started to submit my first PR, which was to fix a problem that caused null Pointers when the Admin module started the default load instance. The function was small, but its significance was remarkable. It meant that I had a good start on the open source road from learning to contributing.

Ongoing open source contributions and gains#

So far, I have participated in the open source of Apache ShenYu community for more than half a year, contributing a lot and growing and harvesting a lot. The details are as follows:

  • Witnessed Shenyu graduate from Apache Incubator and become a top Apache project.
  • Fixed ShenYu admin starting null pointer problem.
  • Added ShenYu Rewrite plugin support for PathVariable functionality.
  • Responsible for the functional support of the entire Shenyu-Client-Golang project.
  • Participated in the repair of some discovered problems, integration test writing, code of other CR contributors, corresponding functional documentation writing, etc.

Thanks to the community#

Thanks to my friends who helped me or inspired me for free (in no particular order): yu199195,yonglun,luoxiaolong,lianjunwei,gaohan.

A little advice for newcomers#

1.Be sure to check out the website or Github first 2.Follow the official website or project documents to try to run the relevant functional modules of Example 3.Feel free to submit an issue to the community if you have any ideas

Attend ShenYu biweekly meetings to keep up with the community and meet with developers one-on-one to ask questions

How to join Apache ShenYu#

  1. How to become a Contributor

    The Apache ShenYu community has purposely written a very comprehensive Contributor Guide

  2. Github Issues

  3. Subscribe emails

    Email dev-subscribe@ShenYu.apache.org;

    After the sending is successful, you will receive a reply from dev-subscribe@ShenYu.apache.org, please reply to this email according to the prompt of the email to confirm the subscription;

    After replying to confirm, you will receive a welcome email indicating that you have successfully subscribed to emails.

[From Apache ShenYu User to Apache ShenYu Committer]

· 3 min read

Introduction of new Committer#

Hi, everyone, I'm Fengen he, Working as a Java Developer,I am very honored to be invited to be the Committer of the Apache ShenYu community. Let me share with you my growth and suggestions during my participation in the Apache ShenYu community.

First acquaintance with ShenYu gateway#

The earliest contact with shenyu was around March 2021. It named soul at that time. Since the business scenarios of the department required the use of a unified gateway, the main reason for choosing the shenyu gateway was that the plug-in design of shenyu was very suitable for the scenarios we needed. Functional plug-ins include divide, sentinel fuse, ratelimiter, protocol conversion of the company's internal rpc, and log2Mongo, etc. With the continuous upgrade of shenyu version, we are also constantly upgrading our code.

When I read Shenyu's code, I like most developers, had the following questions: What exactly is reactive programming? How to write reactive programming? How can shenyu's code be written like this? With these questions, I read the source code of shenyu many times, and then debugged shenyu myself to see how shenyu handles requests and the specific logic of each plugin. During this period, I have also raised many issues in the shenyu community, thank the shenyu community for their help.

My OpenSource experience#

The first time I submitted the code to shenyu was in March 2022. At that time, it was mainly found that the request body lost data when using rpc for protocol conversion, and then I found that the data was lost due to the rpc parameter conversion plugin, so I submitted my code to solve the bug of shenyu.

I contributed the following functions:

  • springboot upgrade
  • refactor springcloud plugin
  • refactor cache plugin
  • refactor logging module and logging plugins.
  • refactor shenyu documents

Thanks to the community#

Special thanks to everyone who helped me (in no particular order):yu199195,qicz,li-keguo,dragon-zhang,renzhuyan,hutaishi,impactCn,yunlongn。

A few words for open source developers#

Open source development is actually a very meaningful and painful thing. It tests a person's endurance. After countless PRs, they may give up due to certain difficulties and problems, but those who persist, whether in terms of technology or communication skills , or open source contributions, there will be certain gains.

Open source is not about doing tasks blindly, nor is it fixed in a certain project or a certain task, but you can participate in any project when you are free. One person will get it quickly, but a group of people will go further!

How to join Apache ShenYu#

  1. How to become a Contributor

    The Apache ShenYu community has purposely written a very comprehensive Contributor Guide

  2. Github Issues

【From CRUD Boy to Apache ShenYu Committer】

· 4 min read

Introduction of new Committer#

Hello everyone, my name is Renzhu Yan , currently engaged in Java/big data business development in Shenzhen Qianhai WeBank Co., Ltd. I am honored to be invited to be a Committer of Apache ShenYu community. As a business developer, I usually focus on business and then write CRUD, while participating in the open source of Apache ShenYu community gives me a different experience. More attention is paid to the code itself, consider how to support various protocols, plug-in extensions, data synchronization, and more. I would like to share with you my growth and suggestions during my participation in the Apache ShenYu community.

Meet the Apache Shenyu community for the first time#

The story timeline has to go back to the end of 2020. At that time, in order to allow us to grow better, the department signed us up for the JAVA advanced training camp of Geek Time, that is, in this training camp, we were fortunate enough to get to know Mr. Cat. Under the leadership of Mr. Mao's source code reading activity, I first came into contact with Apache Shenyu, which was not yet in the Apache incubator, and was also called Soul (hereinafter referred to as Apache Shenyu). The activity of reading the source code of Apache Shenyu lasted for three weeks in total. During the three weeks, we read the source code and blogged every day, from setting up the environment to running the example project, to reading the source code of the plug-in chain and data synchronization. Also have a certain understanding.

Start submitting PR#

In May 2021, I started to submit my first PR. At that time, I added a unit test to the Admin module. The function was small, but its significance was extraordinary, it meant that I started from learning to contributing, from playing to open source, which made a good start on the road of open source.

Ongoing open source contributions and gains#

So far, I have participated in the open source of Apache Shenyu community for more than a year, and I have made a lot of contributions and gained a lot of growth. Details are as follows:

  • Participated in soul's migration to Apache Incubator and renamed Apache Shenyu.
  • Participate in the writing of unit tests for each module.
  • Responsible for integrating TarsResponsePlugin, GrpcResponsePlugin, SofaResponsePlugin, DubboResponsePlugin, etc. and refactoring them into ResponsePlugin for unified processing.
  • Responsible for Admin Oracle database support.
  • Responsible for the support of Shenyu gateway instance registration to Consul.
  • Participated in the repair of some found problems, sample project writing, JAR package replacement and upgrade, integration test writing, etc.

Thanks to the community#

Thanks to my friends who helped me or inspired me for free (in no particular order): yu199195,dragon-zhang,li-keguo,qicz,moremind,zouchangfu,lianjunwei

A little advice for newcomers#

Apache Way has a philosophy: community is greater than code, and we firmly believe that a healthy community is more important than good code. After more than a year of participation, I also felt that Apache Shenyu community has put this into practice very well, such as bi-weekly meetings, consensual voluntary tasks, open and transparent community, and enthusiastic help from partners. So today I will also give this sentence to newcomers. The community is bigger than the code. Here, you can try it.

How to join Apache ShenYu#

  1. How to become a Contributor

    The Apache ShenYu community has purposely written a very comprehensive Contributor Guide

  2. Github Issues

  3. Subscribe emails

    Email dev-subscribe@ShenYu.apache.org;

    After the sending is successful, you will receive a reply from dev-subscribe@ShenYu.apache.org, please reply to this email according to the prompt of the email to confirm the subscription;

    After replying to confirm, you will receive a welcome email indicating that you have successfully subscribed to emails.

【You can also be an Apache ShenYu Committer】

· 5 min read

Introduction of new Committer#

Hello everyone, my name is Zicheng Zhang , java/rust developer, currently engaged in middleware development in a medium-sized Internet company, work direction includes gateway/RPC/MQ. It is my honor to be invited by the Apache ShenYu community as the Committer. Let me share with you my first meet, acquaintance, understanding, growth and suggestions with the Apache ShenYu community.

First Meet#

In mid-August 2021, I joined the current company and transformed into middleware developer (doing business development in my previous company). The first task I received was to familiarize myself with the company's gateway middleware as soon as possible. So a gateway called Soul entered my field of vision (Soul is the predecessor of ShenYu, ShenYu entered the Apache incubator in 2021, the following Soul/ShenYu refers to Apache ShenYu(incubating) ).

Acquaintance#

After about a week of study, I have a certain degree of understanding of the code of Soul. In the following 2-3 months, as I continued to help the company's business developer to answer and solve problems, I gradually discovered some parts of the Soul that were not ergonomic.

Until December 2021, out of company needs and personal interests, I started to investigate ShenYu and consider an upgrade plan, and then I really started to contact ShenYu and the community.

Understanding#

ShenYu is an asynchronous, high-performance, cross-language, and responsive API gateway. It adheres to the design concept of plugin and full-link asynchronous. At present, many plugins have been integrated for users to choose. If the existing plugins does not meet your needs, you can start customized development by studying the official website documents .

The ShenYu community is active and friendly. In order to allow more people to become Contributor/Committer, new tasks are released from time to time on the issues page of Github. There are many tasks for novices. Even if the released task is a little difficult for you, you can still try to submit a PR. The community members will review your PR and provide some guidance and suggestions to help you improve yourself in the collision of ideas.

My Community Grows#

First, I would like to thank the friends in community who helped me for free (in no particular order): yu199195, JooKS-me, KevinClair, lianjunwei, qicz, AhahaGe, hutaishi

Contribution and Gain#

  • Learn how to be compatible with both spring-boot 1.x and 2.x, and contribute a lot of solutions.
  • Get familiar with the use of project-reactor and spring-webflux, and then contribute a lot of optimizations.
  • After getting familiar with netty, contributed netty thread pool settings.
  • After getting familiar with dubbo, expanded the dubbo thread pool in ShenYu.
  • Learn about RPCs such as grpc and motan, and contribute to shared thread pool technology.
  • Provide MemoryLimitedLinkedBlockingQueue and MemorySafeLRUMap, which solved the technical paradox.

Suggestion for Contributing to Apache ShenYu#

  1. First meet

    Starting from the official website documentation, the first is admin/bootstrap deployment , and then choose a way that you are most familiar with to access ShenYu, and finally send a request to verify whether the access is successful.

  2. Familiar

    After a period of time, you will be familiar with the use of ShenYu. At this point, you can start with an access way and see how the data is finally sent to ShenYu-admin and stored.

  3. Slightly successful

    You are already familiar with a certain code in the registration phase, and you can start to sort out the main link of ShenYu-bootstrap in the running phase according to your access way. At this time, it is not recommended digging into the details of each plugin.

  4. Understanding

    At this time, you already have a certain understanding of the overall situation of ShenYu. Maybe you have discovered some small bugs of ShenYu at this stage, or you think some of ShenYu's postures are not ergonomic, so what are you waiting for?

    Go to the community to see if anyone has the same problem as you, you can submit some BUG/ISSUE/PR, the community will reply you as soon as possible.

  5. Outstanding

    As you continue to participate in the community, you contribute more and more to the community, and eventually you can help others solve problems and be able to mentor others.

    You are always curious, you learn deeply, and you can stand on the bottom.

    You have a certain big-picture view and can look at optimization from a global perspective.

    You can see the essence of the problem and solve the root problem.

How to join Apache ShenYu#

  1. How to become a Contributor

    The Apache ShenYu community has purposely written a very comprehensive Contributor Guide

  2. Github Issues

  3. Subscribe emails

    Email dev-subscribe@ShenYu.apache.org;

    After the sending is successful, you will receive a reply from dev-subscribe@ShenYu.apache.org, please reply to this email according to the prompt of the email to confirm the subscription;

    After replying to confirm, you will receive a welcome email indicating that you have successfully subscribed to emails.

[Apache ShenYu 2.4.3 Version Release]

· 4 min read

After 3 months, Apache ShenYu released version 2.4.3 again. The content of this version has 200+ pull requests, 30+ contributors participated, many new functions have been added, many bugs have been fixed, and many optimizations have been made.

new features#

  • Added retry mechanism for Http registration client.
  • Support Content-Type of type octet-stream.
  • Support redirection of Bootstrap URIs.
  • Added local API authorization.
  • Support configuring Dubbo consumer thread pool size.
  • Support failure retry mechanism for Divide plugin.
  • Supports client configuration for Webscoket.
  • Support MemoryLimitedLinkedBlockingQueue.
  • Support Alibaba Dubbo plugin to share thread pool.
  • Support gRPC plugin shared thread pool.
  • Added Metrics plugin.
  • Added Cache plugin.
  • Added Logging RocketMQ plugin.

Optimizations#

  • Updated JUnit4 to JUnit5.
  • Optimize password encryption.
  • Optimize and verify the interface parameters of the shenyu-admin module.
  • Optimize the code for initializing data when synchronizing data.
  • Added integration tests for LoggingRocketMQ plugin.
  • Use the timing wheel algorithm in the ScheduledExecutorService class.
  • Refactored the buildHandle method of the registered URI in admin.
  • Optimized the Spring Cloud client to automatically set the port.
  • Refactored JWT plugin to support multi-level Tokens.
  • Optimized gateway netty parameter customization and configurable

Fix Bug#

  • Fix the null pointer exception when the CommonUpstreamUtils class is initialized.
  • Fix the judgment when Nacos registration fails.
  • Fixed null pointer exception when logging in unregistered users.
  • Fixed the problem of repeatedly printing the startup log.
  • Fixed the problem that the number of retries and the timeout period did not take effect.
  • Fixed Token parsing error.
  • Fixed the problem that Websocket transmits large data abnormally.
  • Fixed NettyHttpClient plugin not retrying on failure.
  • Fixed CVE-2021-41303 vulnerability. -Fixed the problem that judging all plugin inclusion conditions did not take effect.
  • Fixed Http Headers losing data.
  • Fixed Rewrite plugin not supporting URL placeholders.
  • Fixed the problem of abnormal synchronization data in Nacos.
  • Fix Websocket proxy failure or null pointer exception when ContextPath plugin is open.
  • Fixed port occupancy check for Http registered clients.

remove item#

  • Remove Monitor plugin.
  • Remove shenyu-agent module.

Metrics Plugin Instructions#

Metrics plugin The plugin is used by the gateway to monitor its own running status (JVM related), request response delay, QPS, TPS and other related metrics.

Use of plugins#

Add the metrics dependency in the gateway's pom.xml file.

<dependency>    <groupId>org.apache.shenyu</groupId>    <artifactId>shenyu-spring-boot-starter-plugin-metrics</artifactId>    <version>${project.version}</version></dependency>

Edit the following in the gateway's configuration yaml file

shenyu:  metrics:    enabled: false #Set to true to enable    name : prometheus    host: 127.0.0.1 #exposed ip    port: 8090 #Exposed port    jmxConfig: #jmxConfiguration    props:      jvm_enabled: true #Enable jvm monitoring indicators

For specific metrics information, please check the official website description: https://shenyu.apache.org/zh/docs/plugin-center/observability/metrics-plugin

Cache plugin instructions#

The Cache plugin can cache the results of the target service, and also allows the user to configure the expiration time of the cached results.

Use of plugins#

Add the Cache dependency in the gateway's pom.xml file.

<dependency>    <groupId>org.apache.shenyu</groupId>    <artifactId>shenyu-spring-boot-starter-plugin-cache</artifactId>    <version>${project.version}</version></dependency>

It is suitable for scenarios where data is not frequently updated, requires a large number of calls, and does not require high data consistency.

Logging RocketMQ plugin instructions#

The Apache ShenYu gateway receives the client request, forwards the request to the server, and returns the server result to the client. The gateway can record the detailed information corresponding to each request, such as: request time, request parameters, request path, response result, response status code, time-consuming, upstream IP, exception information, etc.

Logging-RocketMQ plugin is a plugin that records and sends access logs to the RocketMQ cluster.

Use of plugins#

Add dependencies in the gateway's pom.xml file.

<dependency>    <groupId>org.apache.shenyu</groupId>    <artifactId>shenyu-spring-boot-starter-plugin-logging-rocketmq</artifactId>    <version>${project.version}</version></dependency>

The specific configuration and the function of each parameter can be found on the official website: https://shenyu.apache.org/zh/docs/plugin-center/observability/logging-rocketmq

Next version planning#

Add cluster plan#

  • Added shenyu-proxy module to support ShenYu's cluster mode and dynamic expansion and contraction of gateways
  • Added shenyu-nginx sub-project to connect to Nginx-upstream module

Added multi-language SDK#

The multi-language SDK is mainly to allow other types of languages to quickly access the shenyu gateway

https://github.com/apache/incubator-shenyu-client-donet

https://github.com/apache/incubator-shenyu-client-golang

https://github.com/apache/incubator-shenyu-client-python

Added Helm Chart#

https://github.com/apache/incubator-shenyu-helm-chart

helm-ci-pipeline

[Apache ShenYu 2.5.1 Version Release]

· 3 min read

Just after Chinese New Year, Apache ShenYu ushered in version 2.5.1. This release has 259 pull requests and 64 contributors. Several new features were added, bugs were fixed, and several optimizations were made.

New Features#

  1. Add brpc example
  2. Add spring boot starter plugin brpc&admin
  3. Add brpc-plugin
  4. Add shenyu-client-api-doc
  5. Add sdk duplicate class check
  6. Support diff nacos namespace
  7. Add array method of expression in mock plugin
  8. Support generation of mock data on request
  9. Support user specify http request domain
  10. Add MockRequestRecord
  11. Development shenyu-register-instance-eureka
  12. Support API document Api doc detail mapper
  13. Add api doc ddl
  14. Add TagMapper and TagRelationMapper
  15. Add api and api_rule_relation mapper
  16. Not config rule
  17. Refactor message readers
  18. Add sentinel rule handle parameter
  19. Add shenyu-e2e test engine
  20. Make an Apache Shenyu SSO authentication plugin based on casdoor
  21. Add logging-tencent-cls plugin
  22. Support clickhouse-logging-pugin
  23. Add logging-pulsar plugin
  24. Add new plugin: key-auth
  25. Fix sign plugin DataBufferLimitException error
  26. Fix context-path error

API Changes#

Enhancement#

  1. Add simpler client annotations for motan
  2. Add simpler client annotations for websocket
  3. Add configuration in starter for motan plugin
  4. Add convenience annotation for shenyu-client-springcloud and shenyu-client-springmvc

Refactor#

  1. Refactor some code for mock request of api doc
  2. Refactor logging-clickhouse
  3. Polish maven dependencies of dubbo
  4. Refactor sign plugin
  5. Update ShenyuExtConfiguration
  6. Remove unnecessary singleton
  7. Fix generating mock data in multithreading
  8. Refactor sdk test and processArgument
  9. Refactor DefaultSignService
  10. Fix shenyu-admin rule
  11. Optimized ShaUtil
  12. Fix cache too large
  13. Fix ConcurrentModificationException
  14. Fix sync data in etcd
  15. Refactor shenyu sdk client
  16. Optimize request timeout response
  17. Refactor log module
  18. Refactor shenyu-client-springcloud
  19. Refactor MotanServiceEventListener
  20. Refactor shenyu-admin sync data listener
  21. Refactor shenyu-client-tars
  22. Refactor client sdks alibaba dubbo
  23. Refactor springmvc client
  24. Refactor admin mapper config
  25. Refactor shenyu-plugin-logging
  26. Optimize random algorithm
  27. Refactor random loadbalancer
  28. Refactor logging-kafka

Bug Fix#

  1. Remove redundant cookie setting
  2. Fix appAuth delete
  3. fix Cryptor-Request Plugin
  4. To avoid load the same ext plugins repeatedly
  5. Fix the TagRelationQuery
  6. Fix upgrade sql
  7. Fix Nacos register NPE
  8. Fix sandbox json parsing
  9. Prevent the first time from failing to load
  10. Fix plugin update bug by modifying config field setter
  11. Fix postgresql sql
  12. Fix the postgresql error during ShenYu-Admin startup
  13. Fix sentinel can't fuse
  14. Fix TencentClsLogCollectClient
  15. Fix change password error
  16. Fix selector page
  17. Fix request plugin can't replaceCookie
  18. Fix RateLimiterPlugin concurrent handler error

Special thanks to the following contributors for their support and participation in version 2.5.1 (in no particular order).

dragon-zhang, zhengpeng, mahaitao, 愿凌飞, hdgaadd, dayu, SongTao Zhuang, Misaya295 , Shawn Jim , yunlongn , Will , moremind , RayayChung , Kevin Clair , huanccwang , 柯杨 , Kunshuai Zhu , fantiq , youzipi , class , kyeongsun , 杨阳洋 , Liming Deng , 杨文杰 , xcsnx , hnxiaoyuan , dependabot , xiaoyu , wzhangNJ , Zihao Huang , ywj1352 , pandaapo , WuLang , Nineteen , kyeongsun , ableYang , Runqi Zhao , WeiS , Luke.Z , lahmxu , Sinsy , Daming , BoyuLi4 , jakiuncle , Bowen Li , huanccwang , gitchenjh , DamonXue , Wu Daifu , Jiageng , nuo-promise , Guocheng Tang , likeguo , Sixh-PrFor , throwable , renzhuyan , wangteng , qinghai777 , zly123987123 , 奕仁 , 尔等同学 , qifanyyy , Jairo , ousinka

[The way from University Student to Apache Committer]

· 5 min read

New Committer Introduction#

Name: Kunshuai Zhu

University: Northeastern University

Role: Apache ShenYu Committer

Email: jooks@apache.org

Contact Open Source#

In the second semester of my sophomore year, by chance, I saw the promotion of the Open Source Software Supply Chain Lighting Program (hereinafter referred to as the Summer of Open Source) organized by the Institute of Software of the Chinese Academy of Sciences and the openEuler community. Later, I slowly learned that there were so many people active in the open source community in China, which greatly promoted the development of the open source ecosystem. It was also a very coincidence that I met the VP (Xiao Yu) of Apache ShenYu, who was my mentor in the Apache ShardingSphere community during the summer of open source. After I completed the task of open source summer ahead of schedule, I saw that ShenYu had just entered the Apache incubator, and it was in full swing, so I started to contact Apache ShenYu.

Grow In The Community#

My earliest contribution to ShenYu was not code, but documentation. At that time, I found a few typo on the official website, so I decisively submitted a pr and become ShenYu's Contributor.

Later, after participating in the regular meeting of the community, I found that ShenYu, as an Apache incubator project, actually still has many places to be optimized and enriched. So, I started with integration testing and started the journey of fighting monsters and upgrading.

In fact, there are a lot of things that can be learned by doing integration testing, from Docker, CI to ShenYu's functional implementation details, microservice ecology and so on. Sometimes inappropriateness of the official website documentation is found during testing, so you need to read the source code yourself, understand the code logic, and then improve or correct the documentation; sometimes some bugs are found, so you can be familiar with ShenYu gateway in locating bugs and fixing bugs details. Later, you can gradually implement some new features yourself.

While getting familiar with the ShenYu project, the sense of awe for ShenYu is also getting higher and higher. Design patterns, asynchronous programming, functional programming, etc. in ShenYu are all very ingenious and worth learning.

Harvest In Open Source#

Looking back on the past six months since I participated in open source, I feel that I have gained a lot, which is mainly reflected in the following aspects.

  1. Improvement of technical level. Participating in open source can not only get in touch with a lot of knowledge that cannot be learned in school, but also can see the practical scene of "slaying dragon martial arts" that I have learned. As an API gateway, Apache ShenYu is the entrance to the entire microservice system. While participating in the project construction, you will naturally be exposed to various knowledge in the field of microservices.

  2. Broaden the horizons. Personally experiencing the discussion of the new feature of the project and participating in activities such as ApacheCon and the Open Source Annual Conference have enabled me to have a more systematic understanding and thinking about the microservice ecology and development trends.

  3. Help with job interviews. The addition of open source experience on my resume has really helped me in my interview for an internship, and it has also been affirmed by the interviewer.

Some Advice For Newcomers#

  1. Adapt to asynchronous communication. Different from our usual communication methods, the open source community often uses asynchronous communication methods, such as mailing lists, GitHub issues, Jira, etc. The priority of the communication methods recommended by the Apache ShenYu community is: mailing list > Github issue > WeChat group . This is because through the mailing list and github, the discussion process and results of the issue can be retained, which is open and transparent. On the other hand, throwing questions on the mailing list is often the quickest and most effective solution.

  2. Actively participate in discussions. Community trumps code, this is what the Apache Way advocates. The code obtained through full communication and discussion is more vibrant. In addition, the Apache ShenYu community will hold an online regular meeting every two weeks, which will periodically summarize the work of the community, as well as the goals and tasks after the discussion (and will also be posted to the mailing list).

  3. How to contribute? The first is after the above-mentioned discussion, and then the hands-on. For those who have not applied ShenYu in their work, writing integration tests and source code analysis articles is a very good entry point. At the same time, the Apache ShenYu community often publishes a lot of easy or difficult tasks, and we all look forward to your participation.

  4. Advice for current students who want to get involved in open source but haven't done it yet. Participate in open source boldly. Among the several open source communities I have come into contact with, students are more friendly, expectant and tolerant. In addition, some organizations will hold activities to guide student groups to participate in open source, such as Open Source Summer (mentioned above), GSoC (Google Summer of Programming), etc., which are also very good ways to participate, not only will there be generous bonuses, but also Get to know a lot of friends and tech giants.

[From users to Committer, different experiences and gains]

· 5 min read

New Committer Introduction#

Hello everyone, my name is qicz, and I am very honored to be invited by the Apache ShenYu community to become Apache ShenYu Committer. I am a "unknown" programmer. Miscellaneous, because I was also a part of entrepreneurship that year and that month. At that time, I often had to choose a different programming language to practice miscellaneous. In the process, there were more opportunities to learn about and contact many varieties of projects. . I am also an open source enthusiast, and I like "playing with code", so I often find myself in the open source community. I have always been adhering to the concept of open source and have worked on several open source projects. There are often many fun and interesting open source projects in the community, and Apache ShenYu is one of them. Next, I will briefly share with you my feelings during the time I participated in the Apache ShenYu community。

Mental journey#

​ I learned that Soul is a very early time. The official contact with Apache ShenYu was in September of this year. At that time, I just received the company's gateway demand, and it took a short time to master and produce something.

​ For gateway projects, there have been studies before, such as Spring Gateway, Kong, etc. After this period of research and continuous participation in the Apache ShenYu project, I am very satisfied with its design concept-plug-in, everything is done based on plug-ins. Although gateways like Kong also support plug-ins, lua is really not fun. The other is that Apache ShenYu's documentation is also very rich, explaining the core design and the principles of some plug-ins in a very detailed manner. Apache ShenYu is implemented in Java. As a no-brand designer, I am still very porridge. But despite this, it is really painful to study it. The first time I saw the source code of Apache ShenYu, it was very big, and the modules were divided into many details.

Everything is difficult at the beginning, and it may be smooth if you have a good beginning. My beginning was about the processing of crossfilter, and put the configuration written in the code into the external configuration file. Looking back on the process of submitting pr for the first time, it was really boring, and I still feel too painful until now.

Provide Pull Request#

​ First of all, all issues, prs, and emails must be in English. I haven't written things in English for some time. Many times I have written by myself. I can't believe and determine if there is a problem with what I wrote. It is estimated that many times I have done Chinese English. However, based on my many years of entrepreneurial experience, everything is a paper tiger. In many cases, as long as I keep on doing it, it will get better and better. Up to now, the constant use of English to organize all kinds of things has become more and more comfortable. Happy! Beautiful! Wonderful!

​ Another, every time you submit the checkstyle and test of pr, it is also very boring. Because the source code has very strict specifications, from comments to line breaks to punctuation. I have been in contact with programming since I was in college. Because the instructor asked us to pay attention to the coding style, we have strictly required our own coding until today, and constantly practiced my code cleanliness skills. I think my coding is very standardized, but I was really defeated in the first pr. On the one hand, the process is not very clear. On the other hand, because of the large number of modules, the local package checkstyle is very slow, and many problems require a complete package process to be exposed. I remember the longest time since it took almost 2 hours.

This process is really too painful. But after many attempts, the first pr succeeded. The difficult beginning is over. But from a personal point of view, it is very supportive and agreeable. If there is no such meticulous requirement, how can we better build this project and community, and use this as a basis to help and serve more small partners.

Community and company integration#

​ In the process of continuously matching the company's needs, the research on Apache ShenYu is also constantly deepening. I started to do some customized development. In the process, other bugs were constantly discovered, so there were second, third and more prs. In this process, many times are completed on weekends or staying up late. It is really tiring, but it is still very fulfilling. Especially when my own PR solves the actual needs and is recognized by the community at the same time, it is really an achievement. Feeling full.

​ With the passage of time, I now have a deep understanding of Apache ShenYu. In the future, I will do my best to devote my spare time to the construction of the community and gather actual needs, regardless of the design and development of various features. Adhere to the original intention of open source-from the community to give back to the community, make more contributions to the community, and grow together with the community.

[Apache ShenYu(incubating) newly promoted PPMC]

· 2 min read

Introduction of new PPMC#

Community Contribution#

  • Deeply involved in the development of Apache ShenYu plug-in system (GRPC plugin, etc.).

  • Practice the Apache Way, be active in the community, help others, and actively participate in source code activities and official website documentation construction.

Community Experience#

  • Community over code: Creating a good community atmosphere is important, more important than writing code. Apache ShenYu (incubating) community is also constantly improving, constantly improving, as much as possible to allow newcomers to participate, lower the threshold.

  • Transparent and open decision-making: Whether it's community development, feature development, or user issues are made public and archived on a mailing list.

  • Equality and respect: Focus on technical community communication, your contribution determines your authority.

  • Broaden your horizons: Not satisfied with CRUD in your daily work, participate in open source, your code will be reviewed, see what is good code, learn more about open source projects, and improve your personal technical skills.

  • No contribution is too big or too small: whether you have completed the core function development, or write test cases, or build the official website, modify the documentation, these contributions are the same, will be recognized by the community.

[From users to Committer, participation in the Apache ShenYu community is not far away]

· 4 min read

Introduction of new Committer#

Hello everyone, my name is Tang Zhen. I am currently working in Dmall(Chengdu)E-commerce Co.,Ltd, and I focus on distributed task scheduling and messaging engine. I am very honored to receive an invitation from the Apache ShenYu community to become the Committer of Apache ShenYu. Let me share with you my growth and suggestions during the time I participated in the Apache ShenYu community.

Getting to know the Apache Shenyu community for the first time#

At the beginning of this year, I learned about the Apache ShenYu gateway during the research of the API gateway (hereafter referred to as Apache ShenYu (incubating) by ShenYu). ShenYu has high-performance, multi-protocol, easy to expand, and reactive features, and has provided a variety of plug-ins, out-of-the-box, very potential, I try to learn it.

In addition to the official documents, ShenYu also has source code analysis provided by many community partners, so you can quickly understand the implementation principle on the basis of rapid use. The community is very active, everyone actively reports and fixes bugs encountered, discusses new ideas together, and helps new friends integrate into the community. For the problems encountered in the first use, if you raise an issue or consult in the community exchange area, friends in the community will actively answer your doubts. These documents and community friends helped me quickly get started with the ShenYu gateway, and also made me feel the friendly and positive atmosphere of the ShenYu community.

Open source is not far away#

When I first read the source code of ShenYu, I saw that the code was a bit redundant and could be streamlined. Based on this, I wanted to create an issue, and worried that the optimization was too small to be accepted by the community. After tangled up, I still created an issue based on the previous issue format to express my thoughts. After a short while, I received feedback from the community, encouraging me to submit a PR to optimize this code. I followed the community's contribution guide and completed this small optimization step by step. The new PR was quickly merged and I saw myself in the Contributor list. This is the transition from ordinary users to contributor. Although it is simple, it motivates me a lot and makes me feel that open source is not far away.

After that, I became more and more familiar with ShenYu's code, and the relationship between the various modules was gradually sorted out. And I learned a lot of elegant design ideas from the project. During the period, I occasionally found some bugs, code and functions that can be optimized. I took the initiative to put forward issues to fix and improve these problems. The Committer of the community will review the code very carefully every time and give some suggestions for improvement. Later, I also participated in the construction of the official website of the community, writing and improving documents.

The ShenYu community is open and inclusive. Some tasks are often released, and many of them are suitable for novices. In fact, they are to help more people integrate into the community. You can follow the community mail, issue, WeChat group, etc. to receive tasks, have a goal to complete, and get familiar with the project faster. At the same time, the community has an open weekly meeting, everyone can participate in, and you can understand the current function development progress of ShenYu, and the community's planning.

After becoming Committer, in addition to continuing to follow up on issues in the community, I will also actively think about and participate in the development of some new features, and strive to make more contributions to the community and grow together with the community.

Some suggestions for newcomers#

For those who want to participate in open source, here are some small suggestions:

  • Starting from the official documentation, first use the main functions of the project to have an overall understanding. Then refer to some source code analysis articles in the community to understand the details of the internal implementation. There may be some small difficulties at the beginning. You can start with a simple small issue and gradually participate in the contribution of the community.

  • Boldly put forward your ideas, whether it is code structure, new functions, or questions about use, you can raise them. The form of contribution is not limited to code, but also includes documentation, active participation in feature discussions, helping other friends to answer questions, and so on.

  • Actively pay attention to the community, receive the tasks released by the community, and communicate with other people in the community if you have any questions about the implementation.

【Release the first version of Apache ShenYu(Incubating)2.4.0】 Make API gateway easy

· 14 min read

[Release the first version of Apache - 2.4.0] Make API Gateway Simple#

Disclaimer: In this article, Apache ShenYu refers to Apache ShenYu (incubating) Author: Xiao Yu Apache ShenYu(incubating) Founder && PPMC 2.4.0 Release Manager: Zhang Yonglun Apache ShenYu(incubating) PPMC && Apache ShardingSphere PMC

The Apache ShenYu gateway is renamed from the original Dromara/soul gateway after donated to the Apache foundation. The 2.4.0 version released this time is the first version after the Apache ShenYu gateway enters the Apache Incubator. This version involves many new features,The project name, package name, and maven coordinates are changed.

What Is Apache ShenYu?#

Apache ShenYu is developed using the Java reactor programming method, and is an API gateway with features such as asynchronous, high performance, and cross-language. In terms of flow control, there is an exquisite Admin console, which can precise and dynamic control flow to meet complex business scenarios. In terms of functions, it uses plug-in design ideas and supports many common protocols: such as http/https, Dubbo, Spring Cloud, gRPC, Motan, Sofa, Tars, etc. And built-in very rich function plug-ins, such as circuit breaking, current limit, authentication, access control, firewall, monitoring, parameter change and so on. Its architecture diagram is as follows:

Flow Control#

The control of flow is the soul of the gateway. For flow control, Apache ShenYu has designed two concepts of selector and rule to control the flow.

Selector and Rule are the most soulful things in the Apache ShenYu gateway. Master it, you can manage any traffic.

A plug-in has multiple selectors, and a selector has multiple rules. The selector is equivalent to the first-level screening of traffic, and the rule is the final screening.

For a plug-in, we hope that according to our configuration, the plug-in will be executed only if the traffic meets the conditions.

The purpose of selectors and rules is to allow traffic to perform what we want when certain conditions are met. This kind of rules must first be understood.

The plug-in, selector, and rule execution logic are as follows. When traffic enters the Apache ShenYu gateway, it will first determine whether there is a corresponding plug-in and whether the plug-in is enabled; then it will determine whether the traffic matches the plug-in's selector.

Then determine whether the traffic matches the rule of the selector. If the requested traffic meets the matching conditions, the plug-in will be executed, otherwise the plug-in will not be executed and the next one will be processed.

This is how the Apache ShenYu gateway completes flow control through layers of filtering. The flow chart is as follows:

Traffic filtering#

Traffic filtering is the soul of selectors and rules, corresponding to the matching conditions in the selectors and rules. According to different traffic filtering rules, we can handle various complex scenarios.

Traffic filtering can obtain data from Http requests such as Header, URI, Query, Cookie,

Then you can use Match, =, SpEL, Regex, Groovy and other matching methods to match the data you expected.

You can use the matching strategy of And/Or to add multiple sets of matching. The above are all using SPI design ideas, users can self-expand: For more, please see: https://shenyu.apache.org/projects/shenyu/selector-and-rule/

The process diagram is as follows:

Data synchronization and caching#

In order to improve the performance of the gateway, the Apache ShenYu gateway will cache all flow control rules in the JVM memory.

In the cluster deployment/distributed scenario, Apache ShenYu independently developed a set of Remote synchronization of Admin console data to the JVM memory of each Apache ShenYu gateway node.

Each scheme adopts the design idea of SPI, so that users can choose flexibly. Currently supported schemes are HttpLongPull, Websocket, Zookeeper, Nacos, Consul, ETCD.

The overall process is as follows:

Admin console#

In order to facilitate the user to quickly and conveniently control the flow and all the functional characteristics of the gateway, Apache ShenYu provides a very beautiful Admin console, the user can Chinese and English switch, on this, you can freely control the flow , Start-stop plug-in, Configure different parameters and strategies, these operation changes are synchronized to the gateway's JVM memory through the aforementioned data synchronization principle. The background diagram is as follows:

Menu/data permissions#

The background management of the gateway is agent. For enterprise-level users and cross-departmental applications, Apache Shenyu designs a common authorization control system, including button level menu permissions, and row data level data Permissions. And these permissions are automatically configurable by the administrator.

Protocol Proxy#

Protocol proxy is the core function of the gateway. Currently Apache ShenYu supports http to http/https, Websocket, Dubbo, Spring Cloud, gRPC, Motan, Sofa The conversion of protocols such as Tars, etc. will support TCP, MQTT, MQTT and other protocols in the future.

Divide Plugin#

The Divide plug-in is a plug-in used to specifically proxy http/https/websocket and other methods to request the Apache ShenYu gateway. It has functions such as load balancing, traffic preheating, node discovery, timeout retry, timeout control and so on. If users want to use it, please add the following dependencies in the gateway, and then set it to on in Admin console --> Plugin management --> Divide plugin. For a more detailed introduction, please see: https://shenyu.apache.org/projects/shenyu/http-proxy/

<dependency>    <groupId>org.apache.shenyu</groupId>    <artifactId>shenyu-spring-boot-starter-plugin-divide</artifactId>    <version>${project.version}</version></dependency><dependency>    <groupId>org.apache.shenyu</groupId>    <artifactId>shenyu-spring-boot-starter-plugin-httpclient</artifactId>    <version>${project.version}</version></dependency>

Dubbo Plugin#

Dubbo plug-in is a plug-in used by Apache ShenYu gateway to convert http/https requests into dubbo protocol. It adopts the mechanism of Dubbo generalization call, integrates Dubbo client, and has functions such as service discovery, load balancing and so on. To use it, please add the following dependencies in the gateway, and then set it to on in Admin console --> Plugin management --> dubbo plugin, and configure the Registry Center, For a more detailed introduction, please see: https://shenyu.apache.org/projects/shenyu/dubbo-proxy/

 <!-- apache shenyu alibaba dubbo plugin start--> <dependency>   <groupId>org.apache.shenyu</groupId>   <artifactId>shenyu-spring-boot-starter-client-alibaba-dubbo</artifactId>    <version>${project.version}</version> </dependency> <!-- apache shenyu apache dubbo plugin start--> <dependency>   <groupId>org.apache.shenyu</groupId>   <artifactId>shenyu-spring-boot-starter-client-apache-dubbo</artifactId>    <version>${project.version}</version> </dependency>

SpringCloud Plugin#

The SpringCloud plugin is a plugin for Apache ShenYu gateway proxy SpringCloud microservice business. It integrates the registration center of SpringCloud, and load balancing service, and realizes the proxy of the service. To use it, please add the following dependency in the gateway, and then set it to on in Admin console --> Plugin management --> SpringCloud plugin. For a more detailed introduction, please see: https://shenyu.apache.org/projects/shenyu/spring-cloud-proxy/

 <dependency>   <groupId>org.apache.shenyu</groupId>   <artifactId>shenyu-spring-boot-starter-plugin-springcloud</artifactId>    <version>${project.version}</version> </dependency>

gRPC Plugin#

The gRPC plug-in is a plug-in used by the Apache ShenYu gateway to convert the http/https request into the GRPC protocol. It integrates the GRPC client and implements the proxy of the GRPC service. To use it, please add the following dependency in the gateway, and then set it to on in Admin console --> Plugin management --> GRPC plugin. For a more detailed introduction, please see: https://shenyu.apache.org/projects/shenyu/grpc-proxy/

 <dependency>   <groupId>org.apache.shenyu</groupId>   <artifactId>shenyu-spring-boot-starter-plugin-grpc</artifactId>    <version>${project.version}</version> </dependency>

Tars Plugin#

Tars plug-in is a plug-in used by Apache ShenYu gateway to convert http/https requests into Tars protocol. Tars is Tencent's open source RPC framework. The plug-in integrates the Tars-JAVA client and implements the proxy of the Tars service. If users want to use it, please add the following dependency in the gateway, and then set it to on in Admin console --> Plugin management --> Tars plugin. For a more detailed introduction, please see: https://shenyu.apache.org/projects/shenyu/tars-proxy/

  <dependency>    <groupId>org.apache.shenyu</groupId>    <artifactId>shenyu-spring-boot-starter-plugin-tars</artifactId>     <version>${project.version}</version>  </dependency>

Sofa Plugin#

The Sofa plug-in is a plug-in used by the Apache ShenYu gateway to convert the http/https request into the Sofa-RPC protocol. It uses the Sofa generalization call mechanism, integrates the Sofa-RPC client, and has functions such as service discovery, load balancing and so on. To use it, please add the following dependencies in the gateway, and then set it to on in Admin Console --> Plugin Management --> Sofa Plugin, and configure the Registry Center. For a more detailed introduction, please see: https://shenyu.apache.org/projects/shenyu/sofa-rpc-proxy/

  <dependency>    <groupId>org.apache.shenyu</groupId>    <artifactId>shenyu-spring-boot-starter-plugin-sofa</artifactId>     <version>${project.version}</version>  </dependency>

Circuit Breaking and Rate Limiting#

Hystrix Plugin#

The Hystrix plug-in is the Hystrix framework integrated with the Apache ShenYu gateway, which provides the function of requesting fuse. The Hystrix fuse parameters can be dynamically configured. To use it, please add the following dependency in the gateway, and then set it to on in Admin console --> Plugin management --> Hystrix plugin. For a more detailed introduction, please see: https://shenyu.apache.org/projects/shenyu/hystrix-plugin/

<dependency>  <groupId>org.apache.shenyu</groupId>  <artifactId>shenyu-spring-boot-starter-plugin-hystrix</artifactId>   <version>${project.version}</version></dependency>

Sentinel Plugin#

The Sentinel plug-in is the Apache ShenYu gateway integrated with the Sentinel framework, providing the function of requesting fuse current limiting. The Sentinel fuse current limiting parameters can be dynamically configured. If users want to use it, please add the following dependencies in the gateway, and then set it to on in Admin Console --> Plugin Management --> Sentinel Plugin. For a more detailed introduction, please see: https://shenyu.apache.org/projects/shenyu/sentinel-plugin/

<dependency>  <groupId>org.apache.shenyu</groupId>  <artifactId>shenyu-spring-boot-starter-plugin-sentinel</artifactId>   <version>${project.version}</version></dependency>

Resilience4j Plugin#

The Resilience4j plug-in is the Apache ShenYu gateway integrated with the Resilience4j framework, providing the function of requesting fuse current limiting. The Resilience4j fuse current limiting parameters can be dynamically configured. To use it, please add the following dependency in the gateway, and then set it to on in Admin console --> Plugin management --> Resilience4j plugin. For a more detailed introduction, please see: https://shenyu.apache.org/projects/shenyu/resilience4j-plugin/

<dependency>  <groupId>org.apache.shenyu</groupId>  <artifactId>shenyu-spring-boot-starter-plugin-resilience4j</artifactId>   <version>${project.version}</version></dependency>

RateLimiter Plugin#

The RateLimiter plug-in is the Apache ShenYu gateway using redis to provide the function of requesting cluster current limiting. The current limiting algorithm strategies include: Token Bucket Algorithm, Concurrent Current Limiting, Leaky Bucket Algorithm, Sliding window algorithm. To use it, please add the following dependencies in the gateway, and then set it to on in Admin console --> Plugin management --> RateLimiter plugin, and configure redis. For a more detailed introduction, please see: https://shenyu.apache.org/projects/shenyu/rate-limiter-plugin/

<dependency>  <groupId>org.apache.shenyu</groupId>  <artifactId>shenyu-spring-boot-starter-plugin-ratelimiter</artifactId>   <version>${project.version}</version></dependency>

Security/Authorization#

Waf Plugin#

The Waf plug-in is an Apache ShenYu gateway, which is used to implement a firewall for traffic. It is mainly used to intercept illegal requests or abnormal requests, and to provide related denial policies. It provides the function of black and white list configuration. If users want to use it, please add the following dependency in the gateway, and then set it to on in Admin console --> Plugin management --> Waf plugin. For a more detailed introduction, please see: https://shenyu.apache.org/projects/shenyu/waf-plugin/

<dependency>  <groupId>org.apache.shenyu</groupId>  <artifactId>shenyu-spring-boot-starter-plugin-waf</artifactId>   <version>${project.version}</version></dependency>

Sign Plugin#

The Sign plug-in is the Apache ShenYu gateway, which is used to sign the request. If users want to use it, please add the following dependencies in the gateway, and then set it to Enable in Admin Console --> Plugin Management --> Sign Plugin. For a more detailed introduction, please see: https://shenyu.apache.org/projects/shenyu/sign-plugin/

<dependency>  <groupId>org.apache.shenyu</groupId>  <artifactId>shenyu-spring-boot-starter-plugin-sign</artifactId>   <version>${project.version}</version></dependency>

JWT Plugin#

The JWT plug-in is an Apache ShenYu gateway, which performs authentication judgments based on the token attribute of the http request header or the value carried by the authorization attribute, and is compatible with OAuth2.0. If users want to use it, please add the following dependency in the gateway, and then set it to on in Admin console --> Plugin management --> jwt plugin. For a more detailed introduction, please see: https://shenyu.apache.org/projects/shenyu/jwt-plugin/

<dependency>  <groupId>org.apache.shenyu</groupId>  <artifactId>shenyu-spring-boot-starter-plugin-jwt</artifactId>   <version>${project.version}</version></dependency>

OAuth2 Plugin#

The OAuth2 plug-in is the Apache ShenYu gateway, which is implemented using the Webflux OAuth2 client to support the OAuth2 protocol. To use it, please add the following dependency in the gateway, and then set it to on in Admin console --> Plugin management --> oauth2 plugin. For a more detailed introduction, please see: https://shenyu.apache.org/projects/shenyu/oauth2-plugin/

<dependency>  <groupId>org.apache.shenyu</groupId>  <artifactId>shenyu-spring-boot-starter-plugin-oauth2</artifactId>   <version>${project.version}</version></dependency>

Personalized Processing#

Rewrite Plugin#

The Rewrite plug-in is the Apache ShenYu gateway, which supports the use of regular expressions to rewrite the URI. To use it, please add the following dependency in the gateway, and then set it to on in Admin console --> Plugin management --> rewrite plugin. For a more detailed introduction, please see: https://shenyu.apache.org/projects/shenyu/rewrite-plugin/

<dependency>  <groupId>org.apache.shenyu</groupId>  <artifactId>shenyu-spring-boot-starter-plugin-rewrite</artifactId>   <version>${project.version}</version></dependency>

Redirect Plugin#

The Redirect plug-in is a plug-in for the Apache ShenYu gateway to redirect requests. It supports the internal interface and external address of the gateway. To use it, please add the following dependencies to the gateway, and then set it to on in Admin console --> Plugin management --> redirect plugin. For a more detailed introduction, please see: https://shenyu.apache.org/projects/shenyu/redirect-plugin/

<dependency>  <groupId>org.apache.shenyu</groupId>  <artifactId>shenyu-spring-boot-starter-plugin-redirect</artifactId>   <version>${project.version}</version></dependency>

Request Plugin#

The Request plug-in is the Apache ShenYu gateway that allows users to perform functions such as add, modify, and delete to request parameters, request headers and Cookies. If users want to use it, please add the following dependency in the gateway, and then set it to on in Admin console --> Plugin management --> request plugin. For a more detailed introduction, please see: https://shenyu.apache.org/projects/shenyu/request-plugin/

<dependency>  <groupId>org.apache.shenyu</groupId>  <artifactId>shenyu-spring-boot-starter-plugin-request</artifactId>   <version>${project.version}</version></dependency>

Context-Path Plugin#

The Context-Path plug-in is an Apache ShenYu gateway, which allows users to perform add, modify, and delete functions on the Context-Path on the request path. To use it, please add the following dependency in the gateway, and then set it to on in Admin console --> plugin management --> context_path plugin. For a more detailed introduction, please see: https://shenyu.apache.org/projects/shenyu/context-path-plugin/

<dependency>  <groupId>org.apache.shenyu</groupId>  <artifactId>shenyu-spring-boot-starter-plugin-context-path</artifactId>   <version>${project.version}</version></dependency>

Param-Mapping Plugin#

The Param-Mapping plug-in is an Apache ShenYu gateway, allowing users to perform functions such as add, modify, and delete fields in the Body in the request body. To use it, please add the following dependency in the gateway, and then set it to on in Admin console --> Plugin management --> param_mapping plugin. For a more detailed introduction, please see: https://shenyu.apache.org/projects/shenyu/param-mapping-plugin/

<dependency>  <groupId>org.apache.shenyu</groupId>  <artifactId>shenyu-spring-boot-starter-plugin-param-mapping</artifactId>   <version>${project.version}</version></dependency>

ModifyResponse Plugin#

The ModifyResponse plug-in is an Apache ShenYu gateway, which is used to perform functions such as add, modify, and delete on the response header, status code, and response content in the request response body. If users want to use it, please add the following dependency in the gateway, and then set it to on in Admin Console --> Plugin Management --> modifyResponse Plugin. For a more detailed introduction, please see: https://shenyu.apache.org/projects/shenyu/modify-response-plugin/

<dependency>  <groupId>org.apache.shenyu</groupId>  <artifactId>shenyu-spring-boot-starter-plugin-modify-response</artifactId>   <version>${project.version}</version></dependency>

Observability#

Monitor Plugin#

The Monitor plug-in is a Apache ShenYu gateway. It uses prometheus to complete the plug-in for monitoring requests, QPS, JVM and other related metrics. To use it, please add the following dependencies in the gateway, and then set it to on in Admin console --> Plugin management --> monitor plugin, and configure the relevant parameters of prometheus. For a more detailed introduction, please see: https://shenyu.apache.org/projects/shenyu/monitor-plugin/

<dependency>  <groupId>org.apache.shenyu</groupId>  <artifactId>shenyu-spring-boot-starter-plugin-monitor</artifactId>   <version>${project.version}</version></dependency>

Logging Plugin#

The Logging plug-in is the Apache ShenYu gateway, which allows the user log to print this request information, including request path, request method, request parameters, response header, response body, etc. Information. To use it, please add the following dependencies to the gateway, and then set it to on in Admin console --> Plugin management --> Logging plugin. For a more detailed introduction, please see: https://shenyu.apache.org/projects/shenyu/logging-plugin/

<dependency>  <groupId>org.apache.shenyu</groupId>  <artifactId>shenyu-spring-boot-starter-plugin-logging</artifactId>   <version>${project.version}</version></dependency>

Planning For The Next Version#

  • RPC framework grayscale release enhancement, including SpringCloud, gRPC, Dubbo, Sofa-RPC, Tars, etc.
  • Added the ShenYu-Agent module to create observability systems such as the gateway metrics, tracing, and logging.
  • Custom plug-ins are dynamically loaded, which is convenient for users to expand and update quickly and without stopping.
  • Comprehensive coverage of integration testing and unit testing.

Community#

Apache ShenYu is an autonomous community open source project completely dominated by Chinese people. It is currently in a period of rapid development. Function development Complete documentation, fix BUG and many other things need to be completed. The Apache ShenYu community follows the community philosophy of Apache Way and creates a completely open and government community. Every half month, a full community meeting will be held, and the community’s committers, contributors, and users will participate in it, At the meeting, everyone can speak freely and put forward their own views and opinions, such as discussing different functions and different codes, and it is best to reach a consistent point of view. In the Apache ShenYu community, we respect the principle of communication priority of mailing list > GitHub Issue > WeChat group. The main purpose is to keep a record of every problem, no point of view, to better help others, to promote the sustainable development of the community.

[How I became an Apache ShenYu Committer one year after graduation]

· 6 min read

Introduction of new Committer#

Hello, everyone. My name is Liu Liang. I am working as a software development engineer in China Merchants Network Technology Co., LTD. It is my great honor to receive the invitation of Apache ShenYu community to become a Committer of Apache ShenYu. Now I would like to share with you my growth and suggestions during my participation in Apache ShenYu community.

Know Open Source#

After graduation last year, I feel that my skills are far from enough, so I am constantly learning. Along the way, one of the teachers offered the opportunity to participate in an open source project. I started with the idea that working on open source projects would improve my skills and help me get a job.

The open source project involved is Apache ShenYu(Incubating), which is an asynchronous, high-performance, cross-language, responsive API gateway. In the community communication group, there are many active students who actively discuss issues and consciously find bugs.

Participate in the open source#

My first task was to add test cases. Tasks are usually posted as an issue, and if you're interested, reply under the issue. Fortunately, the official community provides an action document that simply follows the steps above, mainly forking the project into its repository, pulling it locally, creating the corresponding issue branch locally, and then actually writing code.

The first task is to write unit tests for the entity class. The solution is to call the get/set method via reflection, and when you're done, submit your code and merge it. This was my first PR contribution to an open source project, and I've been a contributor to open source projects ever since, hahaha.

Then I did other tasks. The second time, I looked back at the code I submitted the first time and found it was different from the one I submitted. I checked the git submission record and found that my code was committer refactored. I took a close look at my code and the refactored code and said, "Well, this is a more elegant way to write it.

In continuing to be involved, I've gained a deeper understanding of Apache ShenYu(Incubator) projects and a greater understanding of the open source culture.

Apache ShenYu(Incubating) committers can often publish tasks through mail, issues, and community groups. I noticed that there was a feature on gRPC optimization that no one had done yet, and was ready to take it on. However, I still remember hesitating for a long time at that time. I don't know what to do with this feature. Can I handle it? GRPC is not used, I can also go to optimize? In constant doubt and denial...... This function is a core part of the project, so it's a rare opportunity. Why not try it first? Finally, I took a step to complete the task.

The next step is how to solve this problem. This is a very specific technical problem, I will not expand, mainly about their feelings. When you encounter a problem, you should first analyze what the specific problem is, where to start to solve it, why the existing solution does not work, and what results to achieve in the end, and communicate with others more. I've also been in constant communication with Apache ShenYu(Incubating) PPMC while I've been working on this issue, to discuss whether my solution is feasible. In the process of research and analysis, I have always backed down, because this problem is not easy for me to do. But PPMC in Apache ShenYu(Incubator) has been encouraging me: There's no time limit on this, you can take your time and talk to others about it. In this way, step by step, constantly consult, finally solved the problem, the submitted code was successfully merged by the project.

And then later, you started in Apache ShenYu(Incubator weekly meetings) to learn what other people are doing, learn about incubating, and learn more about open source culture. I also contributed more to Apache ShenYu(Incubating) in its own website.

Experience in the Apache ShenYu(Incubating) community#

I have been talking about my open source experience in the past. In fact, this is my true inner activity and a process of growth. Since you've been in open source, you've slowly felt more open source charm, and the Apache ShenYu(Incubating) community is in a good mood.

  • Community over Code: Building a good community is more important than writing code. The Apache ShenYu(Incubator) community is also working to improve, to get new users in and lower the threshold where possible;

  • Transparent and open decision making: community development, feature development, and user issues are made public and archived in mailing lists;

  • Equality and respect: focus on the communication of technical community, your contribution determines your authority;

  • Broaden vision: not satisfied with CRUD in daily work, participate in open source, your code will be reviewed, see what is good code, learn more about open source projects, improve personal technical ability;

  • No size of contribution: Whether you complete a core feature, write a test case, build a website, modify documentation, these contributions are the same and will be recognized by the community.

A little advice for the new guy#

If you have friends who are interested in open source, but have not participated in it yet, do you have these problems?

  • If you ask too simple questions, do you seem incompetent? No, people are well prepared for technical discussions, their own questions, have more background information, and the community is happy to respond to you and answer your questions.

  • Newcomers don't know how to participate? The community provides documentation, follows through, and can participate. There are also novice missions that can be directly participated in.

  • No time? The development of the community is personal investment, no commercial interests, members are free time to participate in it, I believe you can also.

  • Too difficult to solve? Talk to people in your community. That's how you develop your skills.

[The Open Source Path for Tech Veterans]

· 6 min read

Self Introduction:#

Hello everyone, my name is Duan Haibo, my github account is haibo-duan. It is my honor to be invited by the Apache ShenYu community as the Committer. Here, I would like to share with you my growth and advice from participating in the Apache ShenYu community.

Getting to know Apache ShenYu#

In the last year's source code reading activity, Tt was my first time to hear about the Soul Gateway of the Dromara open source community officially joined the Apache Foundation incubator and renamed to ShenYu. Since ShenYu is the first open source project which named by Chinese traditional culture, which attracted me a lot since naming a procject can be frustrating for a programmer. Then, I followed to ShenYu's public account driven by curiosity. After that, I learned that ShenYu not only has the characteristics of high-performance, multi-protocol, and scalability, but also provides various plug-ins that can be used out of the box. With the mentality of learning, I forked the source code of ShenYu on github. I was amazed by the richness of the documentations and the great detailed description of the technical details. so I subscribed to ShenYu's email according to the description of the document, and tried to participate in the construction of the community.

My way to Open source#

There was a time that the community organized a code cleaning event, aiming to clean and optimize the current shenyu code. I took a look at the requirements of this task which was not difficult, so I optimized some codes according to the specification with the mentality of giving it a try, and then submitted the first PR. Everything is difficult at the beginning. There were a lot of things to learn in the first PR, including the format of PR, the branch of code, and the submission process. Fortunately, all of these were described in the Contributor Guide in great detail. What impressed me the most was ShenYu's checkstyle, which was very strict to the specification, including comments and spaces. Although I had paid a lot of attention to code specifications, there was still a little difficult for me to use this checkstyle at the beginning. However, I got used to this process soon, since the code after unified checkstyle let me feel extremely comfortable.

After the first PR from 0 to 1, the subsequent process was much easier. I found that the most time-consuming process of submitting a PR for local packaging was executing unit test cases. And I also found that there were still parts of the code that unit test code was not provided . Therefore, I decided to start participating in unit testing. First of all, I don't need to know too much source code since the tens of thousands of stock code in ShenYu is unable to be mastered in a day or two. In addition, results can be seen very quickly. In the process of writing unit test cases, I can not only find bugs in the source code to improve the code quality, but also understand the source code better.

At this time, some problems at work also required me to investigate the unit testing technology. When I learned about the new features of junit5, I found unit4 was used in Shenyu , so I sent an email to ask the ShenYu community if an upgrade was possible. After several rounds of discussions in the email, my proposal was accepted and I became the leader of this task. In the process of doing this task, I divided it into many small tasks due to the large amount of test code involved, and several new friends were attracted to join together. In addition, in the task of this junit5 upgrade, it was also found that PowerMock was used in many previous use cases, which had a problem in the compatibility of the new version of jdk. So PowerMock had also been removed.

The ShenYu community is open and inclusive. After completing these tasks, I am very familiar with ShenYu's functional modules. In addition to continuing to follow up some issues in the community, I can also think more based on my own work experience, and propose some questions and ideas in the weekly meeting. At the same time, I received an invitation from the ShenYu community to officially become a committer. In my opinion, becoming an Apache committer is not only an honor, but also a responsibility. Being trusted by the community, I need to contribute more to the community then. Becoming an Apache committer is not the end, but just a higher beginning.

My experience in Apahce ShenYu Community

In the process of participating in open source during this time, I have gained a lot, following are some of my experiences for your reference:

  • Start small: Contributions to the open source community are regardless of size. It's a contribution to the community no matter it's a major feature improvement or an one-line documentation error. Therefore,do not miss doing any good thing no matter how insignificant it looks. As long as it is a valuable contribution, it's welcomed by the community.

  • Active participation and continuous contribution: Open source is a process of accumulating sand and building a tower. One time contribution may be limited, but as long as you participate in community activities actively, you can get promotion, no matter a proposal discussion in the email or the review code. You may not be as committed as you are in work, but as long as you make good use of your spare time and persist for a long time, you can still be successful.

  • Participate in email discussions and put forward ideas boldly: The biggest characteristics of open source communities are democracy, openness and transparency. Here, any ideas and suggestions will be fully valued. If you have a great idea, you just need to send an email and you can discuss it with everyone in the community. Your emails will always be answered. And all discussions are public, you can see people's discussions about your question. In many cases, the process of discussing about the problem is often more valuable than solving the problem itself.

【Soul gateway release milestone version 2.3.0】New support for grpc, tars and sofa protocols!

· 4 min read

It's half a year since the last release. In this half a year, our community friends and I have done too much. Completed nearly 200 PR, published nearly 300 articles of source code analysis, added more than 120 contributors, promoted 7 members of the commiter who won the legitimate JetBrains. We have completed many, many functions With their help. Thank you very much.

soul-admin(dashboard)#

Admin is the control panel of the whole gateway, which is in charge of all traffic and rules matching.

  • The Shiro framework is integrated into admin to complete the permission control in user button level.
  • Templated plug-ins allow users to focus on data configuration without perceiving front-end pages.
  • The internationalization of the whole backend of admin , supports switching between Chinese and English.
  • New support for H2 to store data.
  • Beautiful optimization of admin interface (table, button).
  • New unit tests have been added, with a coverage rate of 70%.

Soul gateway plugin#

New plugins#

  • Add Grpc plugin to fully support grpc protocol.
  • Add Tars plugin to support Tencent tars RPC Protocol.
  • Add sofa plugin supports the sofa RPC Protocol.
  • Add sentinel plugin to integrate the fusing and current limiting function of sentinel framework.
  • Add The resilience4j plugin to integrate the fusing and current limiting function of resilience4j framework.
  • Add the redisect plugin to support user redirection.
  • Add context path plugin to support user-defined context path

plugins optimization#

  • Divide plugin: optimization of node detection mode and flow preheating mode.
  • Ratelimit plugin: add some different current limiting algorithms such as concurrent, leaky bucket and other for users to choose .
  • Sign plugin: fix the bug that URL must be set; add whether to verify flag, which can be used for URI authentication of open platform.
  • Dubbo plugin: add form, URI parameter request, direct connection to registration center , parameter verification and other functions.

Soul Client#

Soul client only provides a client to access the soul gateway with a quick way, which is not necessary. you can configure the rules in Soul admin If you don't use Soul Client.

  • Spring MVC client optimization, support spring, spring boot all versions.
  • Spring cloud client optimization, support spring, spring boot all versions.
  • Dubbo client optimization, support spring, spring boot all versions.
  • Soul grpc client is added to support grpc Java user access.
  • Soul tars client is added to support tars Java user access.
  • Soul sofa client is added to support sofa Java user access.

In the previous version, only HTTP access is supported, but the registry access is added this time.

  • Zookeeper is added as the registration center to access Soul gateway.
  • Nacos is added as the registration center to access Soul gateway.
  • Consul is added as the registration center to access Soul gateway.
  • Etcd is added as the registration center to access Soul gateway.
  • Please refer to https://shenyu.apache.org/en/projects/shenyu/register-center-design/

Soul data synchronization#

  • Fix bugs in Nacos configuration center that do not have namespace set.
  • Optimize websocket synchronization mode.
  • Solve the HTTP long polling synchronous data bug when the soul admin in deployed in cluster

Thanks#

This is a milestone release and a formal change of Soul gateway. Our dashboard, code, documents, issue and PR are all internationalized in English, and the unit test coverage of the whole project has reached 70%.Thank you again for your hard work. Although we have completed a lot of functions (I did not fully list them above), we will have more challenges in the future. I believe that with you, this is not our end, but our starting point.

Join us#

At present, Soul is in the stage of rapid development. If you want to write high-quality code, or want to deeply understand the API gateway, or enjoy the fun of open source, you are welcome to join our community