0
我已經在駱駝周圍找到了很長一段時間了。 我寫了這一小段代碼,將轉發所有傳入的請求 端口8080兩臺服務器vmxp22-SAT-1:8080和vmxp22-SAT-1:8080Apache駱駝 - 類型必須實現繼承的抽象方法錯誤
import java.util.List;
import org.apache.camel.AsyncCallback;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.Endpoint;
import org.apache.camel.processor.loadbalancer.LoadBalancer;
public class Test implements LoadBalancer {
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() {
// START SNIPPET: e1
from("jetty://http://localhost:8080")
.loadBalance().roundRobin()
.to("http://vmxp22-sat-1:8080",
"http://vmxp22-sat-2:8080");
// END SNIPPET: e1
}
};
}
}
但是,當我comiple它在日食我得到以下錯誤
The type Test must implement the inherited abstract method AsyncProcessor.process(Exchange, AsyncCallback) Test.java /first_camel/src/main/java/com/mycompany/first_camel line 24 Java Problem
The type Test must implement the inherited abstract method LoadBalancer.addProcessor(Processor) Test.java /first_camel/src/main/java/com/mycompany/first_camel line 24 Java Problem
The type Test must implement the inherited abstract method LoadBalancer.getProcessors() Test.java /first_camel/src/main/java/com/mycompany/first_camel line 24 Java Problem
The type Test must implement the inherited abstract method LoadBalancer.removeProcessor(Processor) Test.java /first_camel/src/main/java/com/mycompany/first_camel line 24 Java Problem
The type Test must implement the inherited abstract method Processor.process(Exchange) Test.java /first_camel/src/main/java/com/mycompany/first_camel line 24 Java Problem
因爲我是新來的Java和駱駝,我覺得很難整理出來。
任何建議或幫助將非常感激。