All Projects → yangtao309 → zuul-route-jdbc-spring-cloud-starter

yangtao309 / zuul-route-jdbc-spring-cloud-starter

Licence: other
No description or website provided.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to zuul-route-jdbc-spring-cloud-starter

ksql-jdbc-driver
JDBC driver for Apache Kafka
Stars: ✭ 85 (+269.57%)
Mutual labels:  jdbc
radlkarte
Hand-crafted routing information for cyclists
Stars: ✭ 14 (-39.13%)
Mutual labels:  routes
type-arango
🥑 TypeArango manages ArangoDB collections, documents, relations and routes by taking advantage of TypeScript typings.
Stars: ✭ 55 (+139.13%)
Mutual labels:  routes
blade-jdbc
🐜 move to https://github.com/biezhi/anima
Stars: ✭ 36 (+56.52%)
Mutual labels:  jdbc
apache-flink-jdbc-streaming
Sample project for Apache Flink with Streaming Engine and JDBC Sink
Stars: ✭ 22 (-4.35%)
Mutual labels:  jdbc
person-directory
A framework for resolving persons and attributes from a variety of underlying sources.
Stars: ✭ 26 (+13.04%)
Mutual labels:  jdbc
hasor
Hasor是一套基于 Java 语言的开发框架,区别于其它框架的是 Hasor 有着自己一套完整的体系,同时还可以和先有技术体系做到完美融合。它包含:IoC/Aop容器框架、Web框架、Jdbc框架、RSF分布式RPC框架、DataQL引擎,等几块。
Stars: ✭ 938 (+3978.26%)
Mutual labels:  jdbc
tamer
Standalone alternatives to Kafka Connect Connectors
Stars: ✭ 42 (+82.61%)
Mutual labels:  jdbc
babashka-sql-pods
Babashka pods for SQL databases
Stars: ✭ 64 (+178.26%)
Mutual labels:  jdbc
eth-jdbc-connector
Ethereum JDBC driver implements a pure java, type 4 JDBC driver that executes SQL queries on Ethereum Blockchain.
Stars: ✭ 19 (-17.39%)
Mutual labels:  jdbc
ThinkJD
ThinkJD,又名ThinkJDBC,一个简洁而强大的开源JDBC操作库。你可以使用Java像ThinkPHP框架的M方法一样,一行代码搞定数据库操作。ThinkJD, also known as ThinkJDBC, an easy and powerful open source JDBC library. You can operate the database with one line of Java code,just like the M method of ThinkPHP framework.
Stars: ✭ 24 (+4.35%)
Mutual labels:  jdbc
fastify-loader
The route loader for the cool kids!
Stars: ✭ 17 (-26.09%)
Mutual labels:  routes
dice-fairlink
JDBC Driver for read-only connections on AWS RDS Clusters
Stars: ✭ 33 (+43.48%)
Mutual labels:  jdbc
neo4j-jdbc
JDBC driver for Neo4j
Stars: ✭ 110 (+378.26%)
Mutual labels:  jdbc
NiuBi
👊 一个Java文件也能干大事系列
Stars: ✭ 34 (+47.83%)
Mutual labels:  jdbc
intelliroutes
Support for Play Routes in IntelliJ IDEA
Stars: ✭ 21 (-8.7%)
Mutual labels:  routes
mongodb-jdbc-driver
MongoDB JDBC Driver | DbSchema MongoDB Designer
Stars: ✭ 47 (+104.35%)
Mutual labels:  jdbc
table2pojo
Generate POJOs for database table/columns
Stars: ✭ 16 (-30.43%)
Mutual labels:  jdbc
ertuo
Ertuo: quick routing for PHP
Stars: ✭ 29 (+26.09%)
Mutual labels:  routes
soda-for-java
SODA (Simple Oracle Document Access) for Java is an Oracle library for writing Java apps that work with JSON (and not only JSON!) in the Oracle Database. SODA allows your Java app to use the Oracle Database as a NoSQL document store.
Stars: ✭ 61 (+165.22%)
Mutual labels:  jdbc

zuul-route-jdbc-spring-cloud-starter

A Spring Cloud jdbc store for Zuul routes. 将zuul的routes信息存储在关系型数据库中,以方便定义zuul dashboard进行运维管理工作。

Features

Extends the Spring Cloud's DiscoveryClientRouteLocator with capabilities of loading routes out of the configured Cassandra database.

Instead of configuring your routes through zuul.routes like follows:

zuul:
  ignoredServices: '*'
  routes:
    resource:
      path: /api/**
      serviceId: rest-service
    oauth2:
      path: /uaa/**
      serviceId: oauth2-service
      stripPrefix: false

You can store the routes in mysql.

Keep in mind that the other properties except for routes are still relevant.

zuul:
  ignoredServices: '*'
  store:
    jdbc:
      enabled: true

Setup

Make sure the version of String Cloud Starter Zuul your project is using is at compatible with 1.2.4.RELEASE which this project is extending.

Add the Spring Cloud starter to your project:

<dependency>
  <groupId>io.github.yangtao309</groupId>
  <artifactId>zuul-route-jdbc-spring-cloud-starter</artifactId>
  <version>1.0.0-SNAPSHOT</version>
</dependency>

Connect to mysql and create a keyspace:


CREATE TABLE zuul_routes(
    id VARCHAR(50),
    path VARCHAR(500),
    service_id VARCHAR(50),
    url VARCHAR(500),
    strip_prefix tinyint(1),
    retryable tinyint(1),
    sensitive_headers VARCHAR(500),
    PRIMARY KEY(id)
);

Register JdbcOperations bean within your application:

@SpringBootApplication
public static class Application {

  @Bean
  public DataSource dataSource(
      @Value("${spring.datasource.url}") String url,
      @Value("${spring.datasource.username}") String username,
      @Value("${spring.datasource.password}") String password,
      @Value("${spring.datasource.maxActive}") int maxActive) {

    DruidDataSource dataSource = new DruidDataSource();
    dataSource.setUrl(url);
    dataSource.setUsername(username);
    dataSource.setPassword(password);
    dataSource.setMaxActive(maxActive);
    return dataSource;
  }

  @Bean
  public JdbcOperations mysqlJdbcTemplate(@Autowired DataSource dataSource) {
    return new JdbcTemplate(dataSource);
  }
}

Configure the jdbc to be used for loading the Zuul routes:

zuul:
  store:
    jdbc:
      enabled: true

Finally enable the Zuul proxy with @EnableZuulProxyStore - use this annotation as a replacement for standard @EnableZuulProxy:

@EnableZuulProxyStore
@SpringBootApplication
public static class Application {

    ...
}

Properties

zuul.store.jdbc.enabled=true# false by default

License

Apache 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].