Spring 云 Netflix Zuul。 SQLSyntaxErrorException: Table 'rate' 不存在
Spring Cloud Netflix Zuul. SQLSyntaxErrorException: Table 'rate' doesn't exist
我正在尝试使用 JPA 存储库在我的 Spring Cloud Netflix Zuul 中配置 速率限制。
但是一开始我收到这个异常:
java.sql.SQLSyntaxErrorException: Table 'kirillbq_bl_acc.rate' doesn't
exist
我的application.yaml:
zuul:
routes:
my-service:
path: /
ratelimit:
enabled: true
repository: JPA
policy-list:
my-service:
- limit: 2
refresh-interval: 60
type:
- origin
strip-prefix: true
我在项目中也有 spring-boot-starter-data-jpa 依赖。
我假设 Zuul 需要一个 'Rate' table 来存储关于请求的信息,但是我找不到任何关于这种结构的信息 table。应该是什么?
在 config 文件夹中有 Rate.java class 'Rate' table:
@Entity
public class Rate {
@Id
private String key;
private Long remaining;
private Long remainingQuota;
private Long reset;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy HH:mm:ss")
private Date expiration;
// constructor, getters and setters
}
创建 table 之后一切正常。 Zuul 在这个 table.
中保存了关于请求的信息
我正在尝试使用 JPA 存储库在我的 Spring Cloud Netflix Zuul 中配置 速率限制。 但是一开始我收到这个异常:
java.sql.SQLSyntaxErrorException: Table 'kirillbq_bl_acc.rate' doesn't exist
我的application.yaml:
zuul:
routes:
my-service:
path: /
ratelimit:
enabled: true
repository: JPA
policy-list:
my-service:
- limit: 2
refresh-interval: 60
type:
- origin
strip-prefix: true
我在项目中也有 spring-boot-starter-data-jpa 依赖。
我假设 Zuul 需要一个 'Rate' table 来存储关于请求的信息,但是我找不到任何关于这种结构的信息 table。应该是什么?
在 config 文件夹中有 Rate.java class 'Rate' table:
@Entity
public class Rate {
@Id
private String key;
private Long remaining;
private Long remainingQuota;
private Long reset;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy HH:mm:ss")
private Date expiration;
// constructor, getters and setters
}
创建 table 之后一切正常。 Zuul 在这个 table.
中保存了关于请求的信息