亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Spring Cloud Netflix Zuul。SQLSyntaxErrorException:

Spring Cloud Netflix Zuul。SQLSyntaxErrorException:

MM們 2023-06-28 15:35:55
我正在嘗試使用 JPA 存儲庫在 Spring Cloud Netflix Zuul 中配置速率限制。但是一開始我收到這個異常:java.sql.SQLSyntaxErrorException:表“kirillbq_bl_acc.rate”不存在我的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”表來存儲有關請求的信息,但是我找不到有關該表結構的任何信息。應該是什么?
查看完整描述

1 回答

?
萬千封印

TA貢獻1891條經驗 獲得超3個贊

我找到了此信息:https://www.programcreek.com/java-api-examples/ ?code=marcosbarbero/spring-cloud-zuul-ratelimit/spring-cloud-zuul-ratelimit-master/spring-cloud-zuul -ratelimit-core/src/main/java/com/marcosbarbero/cloud/autoconfigure/zuul/ratelimit/RateLimitAutoConfiguration.java#


config文件夾中有Rate.java類,其結構為“Rate”表:


@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 

}

創建此表后,一切正常。Zuul在此表中保存有關請求的信息。


查看完整回答
反對 回復 2023-06-28
  • 1 回答
  • 0 關注
  • 185 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號