我有这个枚举
public enum Reos {
VALUE1("A"),VALUE2("B");
private String text;
Reos(String text){this.text = text;}
public String getText(){return this.text;}
public static Reos fromText(String text){
for(Reos r : Reos.values()){
if(r.getText().equals(text)){
return r;
}
}
throw new IllegalArgumentException();
}
}
Run Code Online (Sandbox Code Playgroud)
还有一个名为Review的类,这个类包含enum Reos类型的属性.
public class Review implements Serializable{
private Integer id;
private Reos reos;
public Integer getId() {return id;}
public void setId(Integer id) {this.id = id;}
public Reos getReos() {return reos;}
public void setReos(Reos reos) {
this.reos = reos;
}
}
Run Code Online (Sandbox Code Playgroud)
最后,我有一个控制器,用 …
我正在尝试Spring Cloud和Spring Boot.它使用Netflix OSS应用程序,其中有Ribbon和Hystrix.
色带是负载平衡器,具有一些功能,其中一个是断路器.
Hystrix是一种断路器应用.
我不知道他们俩之间的区别.如果Ribbon已经带有断路器功能,为什么要使用Hystrix.
我可以在同一个连接器中使用这两个应用程序