hystrix使用dubbo的Filter在client端进行容错保护

服务端内容------------------------------>

1.

package com.okdeer.dubbo_service;

public interface DemoServer {

String sayHello(String str);

}


2.

package com.okdeer.dubbo_service;

import java.util.Date;

public class DemoServerImpl implements DemoServer  {

public String sayHello(String str) {

str = "Hello " + str + " @@^^  2 : " + new Date();

System.out.println("server:" + str);

return str;

}

}


3. 

package com.okdeer.dubbo_service;

import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {

@SuppressWarnings("resource")

public static void main(String[] args) throws Exception {

ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] { "applicationProvider.xml" });

context.start();

System.out.println("按任意键退出");

System.in.read();

context.stop();

}

}

4.


hystrix使用dubbo的Filter在client端进行容错保护_第1张图片

5.

log4j.appender.Stdout=org.apache.log4j.ConsoleAppender

log4j.appender.Stdout.layout=org.apache.log4j.PatternLayout

log4j.appender.Stdout.layout.conversionPattern=%-5p - %-26.26c{1} - %m\n

log4j.rootLogger=INFO,Stdout

log4j.logger.org.apache.wicket=INFO

log4j.logger.org.apache.wicket.protocol.http.HttpSessionStore=INFO

log4j.logger.org.apache.wicket.version=INFO

log4j.logger.org.apache.wicket.RequestCycle=INFO


客户端内容:


https://pan.baidu.com/s/1c5SWWY


hystrix使用dubbo的Filter在client端进行容错保护_第2张图片


pom文件的github地址:


https://github.com/yskgood/dubbo-hystrix-support/blob/master/pom.xml

你可能感兴趣的:(hystrix使用dubbo的Filter在client端进行容错保护)