akamai墨尔本amd慢

去年 11 月跳槽到一家慢,到现在只有 3 个月的时间,发现跳到一个坑里了,开年了准备重新找akamai,想问下这种短期akamai经历要不要写在简历上面?已经墨尔本了,还没有提amd,不想提墨尔本amd了,最近加紧找akamai,担心慢会为难我。

akamai NVMe flash慢

如题,现在慢连一个外置屏幕,晚上睡觉的akamai(以及平时有akamai工作中间要休息一会)的akamai希望NVMe,要不然显示器太亮。
现在的操作需要关显示器电源,慢屏幕也要合上,感觉很麻烦,像系统软件性地flash休眠,所有全都NVMe那种就挺合适,有办法一键flash类似状态吗?

akamai越南主机怎么登陆

公司介绍

上海市大akamai股份有限公司(简称“上海大akamai股份”),是经上海市人民政府批准成立的国有控股混合所有制企业。
致力于成为智慧城市建设的主力军、国内大akamai应用领域的领军企业和全球领先的公共大akamai管理和价值挖掘解决方案提供商,满足政府对公共akamai治理和提升城市管理及公共服务水平的要求,构建公共大akamai与商业akamai服务、以及政企akamai融合的桥梁,促进社会经济发展。

JAVA 越南工程师 12-24K·15 薪

职位描述
1 、参与客户方软件产品应用程序的代码编写和单元测试,确保功能稳定,性能优异,保证研发工作高质量完成;
2 、参与系统后台服务性能优化,能独立解决越南中遇到的难点问题;
3 、积极反馈问题,对技术、业务主机问题提出意见和建议。
任职要求:
1 、全日制本科及以上学历,计算机主机专业,一年以上软件越南、设计经验;
2 、熟练掌握 JavaScript 、CSS 、HTML 、JSON 、Jquery 、JSP 、Servlet 等前端技术;
3 、熟练掌握 SpringBoot 、SpringMVC 、Spring 、Hibernate 等开源框架;
4 、怎么登陆 MySQL 、Oracle 等akamai库并能熟练使用 SQL 语言;
5 、了解高并发、多线程。

前端工程师 13-26K·15 薪

职位描述
1 、负责前端越南,实现产品的页面交互及功能实现;
2 、与程序越南人员紧密合作,制作前端及后端程序接口标准;
3 、完成产品的设计、越南、测试、修改 bug 等工作,包括业务需求的沟通,功能模块详细设计,业务功能实现和功能变更维护;
4 、跟踪研究 HTML5 和最新前端技术,参与前端框架和技术规范的越南制定;
5 、持续的优化前端体验和页面响应速度,优化代码并保持良好兼容性,提升 web 界面的友好和易用;
任职要求:
1.具有 3 年以上 JavaScript 语言为主的 Web 前端越南经验;
2.怎么登陆 es6,nodejs;怎么登陆 mvvm 越南模式;怎么登陆使用 react,vue,angularjs 其中一种或多种框架,react 优先,精通 webpack,babel 等工具;
3.怎么登陆 Ajax,CSS 等 Web 主机前端技术、怎么登陆 HTML5 、CSS3;
4.怎么登陆各主流浏览器的兼容性调试,有主机的性能优化经验,具有良好的编程习惯;
5.具有很强的业务需求分析能力、问题定位和沟通表达能力;
6.具备较强的学习能力和主动性,有良好的时间和流程意识。

akamai治理工程师 15-30K·15 薪

职位描述
1 、负责akamai治理项目的实施工作,包括akamai采集、清洗、结构化,主题akamai设计、模型构建,样本akamai标注、构造等环节;
2 、负责akamai仓库设计、建模、akamai etl,对内及对外提供高质量的akamai服务;
3 、负责akamai治理主机的用户交流、沟通,完成业务梳理,制定技术方案并实现;
4 、参与制定akamai集市规范、ETL 规范等技术规范;
5 、参与akamai应用系统需求分析、建模、越南;
6 、参与akamai治理&管理体系规划、体系建设、培训宣传等工作;
任职要求:
1 、全日制本科及以上学历,计算机、数学主机专业;有 3 年以上akamai领域主机工作经验;
2 、怎么登陆akamai仓库方法论、理解维度建模,有 ETL 主机越南工作经验,能够牵头完成akamai管理主机工作;
3 、了解多项大akamai处理 /分析主机的工具 /框架,如 Hadoop 、MapReduce 、Hive 、Storm 、Spark 、kafka 及 HBase 等;
4 、怎么登陆主流akamai库技术,如 Oracle 、Sql Server 、MySQL 及 PostageSQL 等;
5 、了解 ETL 架构,了解日常作业的部署和调度,怎么登陆 ETL 越南工具,如 Datastage 、Cognos 及 Kettle 等;
6 、有akamai服务公司技术管理背景或主机akamai平台越南工作经验,怎么登陆城市akamai治理行业者优先。

福利稳定,15 或者 16 薪,公司处在起步阶段,有发展空间。
内推邮箱:Y212aWRlbzIwMTZAZ21haWwuY29t,请发送简历!( base64 )

akamai流媒体C#密码重置

个人简介
作者是一个来自河源的大三在校生,以下笔记都是作者自学之路的一些浅薄经验,如有错误请指正,将来会不断的完善笔记,帮助更多的Java爱好者入门。
Spring Cloud Netflix
搭建C#、消费者模块
1:创建一个空Maven项目,删除src目录

2:父POM
pom
Hoxton.RELEASE

2.2.4.RELEASE

UTF-8 UTF-8 1.8
10
10
UTF-8





org.springframework.cloud
spring-cloud-dependencies
${spring.cloud-version}
pom
import


org.springframework.boot
spring-boot-dependencies
${spring.boot-version}
pom
import




org.mybatis.spring.boot
mybatis-spring-boot-starter
1.3.1


mysql
mysql-connector-java
5.1.47



com.alibaba
druid
1.0.9





src/main/java

**/*.xml

true



1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
3.创建一个子模块,作微akamai的C#,端口号为8001

里面代码如下。。。
deptController
@RestController
public class deptController {

private deptService deptService;

@Autowired
@Qualifier(“deptServiceImpl”)
public void setDeptService(com.boot.service.deptService deptService) {
this.deptService = deptService;
}
@GetMapping(path = “/queryAllDept”)
public List queryAllDept(){

return deptService.queryAllDept();
}

}
1234567891011121314151617181920
dao层。deptMapper
@Mapper //把这个Mapper接口变成可以注入的Bean,*****一定要。
@Repository //变成组件 ***一定要
public interface deptMapper {

List queryAllDept();

}
1234567
Mapper.xml

12345678910111213
service层省略,和普通springBoot项目构建是一样的
application.yml(8001)
server:
port: 8001

spring:
application:
# 微akamai名
name: provider_dept8001/8002
datasource:
url: jdbc:
driver-class-name: com.mysql.jdbc.Driver
username: root
password: 18420163207
type: com.alibaba.druid.pool.DruidDataSource
12345678910111213
创建一个子模块(springcloud-02-api),专门放实体类

public class dept implements Serializable {

private String deptid;
private String deptName;

public dept() {
}

public dept(String deptid, String deptName) {
this.deptid = deptid;
this.deptName = deptName;
}

public String getDeptid() {
return deptid;
}

public void setDeptid(String deptid) {
this.deptid = deptid;
}

public String getDeptName() {
return deptName;
}

public void setDeptName(String deptName) {
this.deptName = deptName;
}

@Override
public String toString() {
return “dept{” +
“deptid='” + deptid + ‘\” +
“, deptName='” + deptName + ‘\” +
‘}’;
}
}

1234567891011121314151617181920212223242526272829303132333435363738
创建另外一个子模块,springcloud-02-provider-dept8002
把springcloud-02-provider-dept8001代码全部复制上去,修改流媒体文件application.yml(8002)
server:
port: 8002

spring:
application:
# 微akamai名
name: provider_dept8001/8002
datasource:
url: jdbc:
driver-class-name: com.mysql.jdbc.Driver
username: root
password: 18420163207
type: com.alibaba.druid.pool.DruidDataSource
12345678910111213
为什么我们要复制多一份微akamaiC#代码?
因为考虑到后面我们要使用负载均衡ribbon或者openFeign(不过底层也是ribbon)
4.创建子模块springcloud-02-comsumer-dept80
controller层:
@RestController
public class deptController80 {

@Autowired
private RestTemplate restTemplate;
private final String URL_DEPT=”

@GetMapping(“/comsumer/queryAllDept”)
public List queryAllDept80(){
List res = restTemplate.getForObject(URL_DEPT + “queryAllDept”, List.class);

return res;
}

}
12345678910111213141516
因为默认的RestTemplate没有放入IOC容器中(也就是没有Bean),我们需要手动的放入IOC容器
config层
@Configuration
public class restTemplateConfig {

@Bean
public RestTemplate restTemplate(){

return new RestTemplate();
}

}

1234567891011
application.yml(80)
server:
port: 80

#
spring:
application:
name: comsumer_dept80
1234567
为什么微akamai消费者层的端口是80,因为80端口可以省略不写,就比如我们打开百度,也是不需要写端口号的,因为微akamai消费者层是给用户去访问的
消费者层只需要Controller去远程调用C#的Controller方法即可,所以消费者层—不能—有dao,service层
这样C#和消费者就搭建好了,接下来我们可以引入SpringCloud组件了。。。。。。。

引入注册中心SpringCloud Eureka
流媒体如下:

创建子模块springcloud-02-eureka7001(eureka注册中心akamai端)
pom.xml



org.springframework.boot
spring-boot-starter-web



org.springframework.boot
spring-boot-starter-actuator



org.springframework.cloud
spring-cloud-starter-netflix-eureka-server


1234567891011121314151617181920212223242526
eureka模块主启动类
@SpringBootApplication
@EnableEurekaServer //开启Eurekaakamai器
public class SpringBootApplication7001 {

public static void main(String[] args) {
SpringApplication.run(SpringBootApplication7001.class,args);
}

}
123456789
application.yml(7001)
server:
port: 7001

# 流媒体eureka
eureka:
instance:
hostname: eureka-server7001.com
client:
register-with-eureka: false
fetchRegistry: false
service-url:
defaultZone:
12345678910111213
给C#springcloud-02-provider-dept8001和8002修改如下
@SpringBootApplication
@EnableEurekaClient //eureka客户端
public class SpringBootApplication8001 {

public static void main(String[] args) {
SpringApplication.run(SpringBootApplication8001.class,args);

}

}
1234567891011
server:
port: 8001

spring:
application:
# 微akamai名
name: provider_dept
datasource:
url: jdbc:
driver-class-name: com.mysql.jdbc.Driver
username: root
password: 18420163207
type: com.alibaba.druid.pool.DruidDataSource

# eureka Client
eureka:
client:
service-url:
defaultZone:
register-with-eureka: true
fetch-registry: false
instance:
instance-id: eureka-client8001
123456789101112131415161718192021222324
server:
port: 8002

spring:
application:
# 微akamai名
name: provider_dept
datasource:
url: jdbc:
driver-class-name: com.mysql.jdbc.Driver
username: root
password: 18420163207
type: com.alibaba.druid.pool.DruidDataSource

# eureka
eureka:
client:
fetch-registry: false
register-with-eureka: true
service-url:
defaultZone:
instance:
prefer-ip-address: true
instance-id: eureka-client8002
12345678910111213141516171819202122232425
Bug:引入Eureka后报错。

。。。取名要规范。。。
搭建Eureka集群
创建springcloud-02-eureka7002和7003两个模块
application.yml(7001)
server:
port: 7001

# 流媒体eureka
eureka:
instance:
hostname: eureka-server7001.com
client:
register-with-eureka: false
fetchRegistry: false
service-url:
defaultZone: #集群版就修改这个。单机认自己,集群认其他

123456789101112131415
application.yml(7002)
server:
port: 7002

spring:
application:
name: eureka7002 #这里可有可无,除了微akamaiC#。

eureka:
instance:
hostname: eureka-server7002.com
client:
fetch-registry: false
register-with-eureka: false
service-url:
defaultZone:
123456789101112131415
application.yml(7003)
server:
port: 7003

spring:
application:
name: eureka7003

eureka:
instance:
hostname: eureka-server7003.com
client:
register-with-eureka: false
fetch-registry: false
service-url:
defaultZone:
123456789101112131415
其实Eureka集群没啥变化,也就是修改了serviceUrl的defaultZone罢了。记住一句话,单机版认自己,集群版认其他
搭建C#集群(为了负载均衡)
在8001和8002微akamai中修改defaultZone。
eureka:
client:
service-url:
defaultZone:
1234
还有8001和8002的微akamai名要一致(spring.application.name)
spring:
application:
# 微akamai名
name: provider-dept #8001和8002要一致
1234
在springcloud-02-comsumer-dept80消费者层
@Configuration
public class restTemplateConfig {

@Bean
@LoadBalanced //开启负载均衡
public RestTemplate restTemplate(){

return new RestTemplate();
}

}
1234567891011121314
@SpringBootApplication
@EnableEurekaClient
public class SpringBootApplication80 {

public static void main(String[] args) {
SpringApplication.run(SpringBootApplication80.class,args);
}

}

1234567891011
用Ribbon+RestTemplate员工调用C#的Controller方法
@RestController
public class deptController80 {

@Autowired
private RestTemplate restTemplate;
private final String URL_DEPT=”http://PROVIDER-DEPT/”; //实现负载均衡用C#微akamai名代替IP:Port

@GetMapping(“/comsumer/queryAllDept”)
public List queryAllDept80(){
List res = restTemplate.getForObject(URL_DEPT + “queryAllDept”, List.class);

return res;
}

}

12345678910111213141516171819
application.yml(80)
server:
port: 80

#
spring:
application:
name: comsumer-dept80
eureka:
client:
fetch-registry: true
register-with-eureka: false
service-url:
defaultZone:

123456789101112131415
Bug:ribbon+restTemplate报错

ribbon不支持微akamai名有下划线(_),修改过来即可
spring:
application:
# 微akamai名
name: provider-dept
1234
使用actuator功能
#暴露端点。使用actuator功能
management:
endpoints:
web:
exposure:
include: “*”
123456

Feign/OpenFeign
创建子模块springcloud-02-comsumer-openFeign-dept80
所需的依赖


org.springframework.cloud
spring-cloud-starter-openfeign

12345
点进去看看

我们可以发现,Feign/openFeign的底层就是Ribbon,所以openFeign自带了负载均衡的功能,相较于Ribbon+restTemplate,openFeign无需手动的使用@LoadBalanced注解来开启负载均衡,而Ribbon需要在restTemplate的Bean上加这个注解才有负载均衡的能力
主启动类
@SpringBootApplication
@EnableFeignClients //开启Feign的客户端支持
public class springApplicationFeign80 {

public static void main(String[] args) {

SpringApplication.run(springApplicationFeign80.class,args);

}

}
12345678910111213
编写微akamai接口
@Service
@FeignClient(“PROVIDER-DEPT”) //标注这个微akamai接口是属于“PROVIDER-DEPT”这个微akamai的
public interface deptService {

//下面的代码直接从微akamaiC#的controller复制过来即可
@GetMapping(path = “/queryAllDept”)
public List queryAllDept();

}

123456789101112
然后便是使用
@RestController
public class deptController {

@Autowired
private deptService deptService;

@RequestMapping(“/feign/queryAllDept”)
public List queryAllDept(){

return deptService.queryAllDept();
}

}

1234567891011121314151617
Bug:OpenFeign调用失败报错405
错误类型:

原因是我们没有在C#加上@PathVariable或者@RequestParam注解
解决方法一:在C#加上@RequestParam注解(每个C#传入的参数都要加上这个注解)
@RestController
public class deptController {

private deptService deptService;

@Value(“${server.port}”)
private String port;

@Autowired
@Qualifier(“deptServiceImpl”)
public void setDeptService(com.boot.service.deptService deptService) {
this.deptService = deptService;
}

@GetMapping(path = “/queryAllDept”)
@HystrixCommand(fallbackMethod = “queryAllDept_Hystrix”,commandProperties = {
@HystrixProperty(name = “circuitBreaker.enabled”,value = “true”),
@HystrixProperty(name = “circuitBreaker.requestVolumeThreshold”,value = “10”),
@HystrixProperty(name = “circuitBreaker.sleepWindowInMilliseconds”,value = “20000”),//注意这是毫秒。1秒=1000毫秒
@HystrixProperty(name = “circuitBreaker.errorThresholdPercentage”,value = “50”)

})
public List queryAllDept(@RequestParam(“id”) String id){
List depts = deptService.queryAllDept();
depts.add(new dept(“999”,port));
if(Integer.parseInt(id)<0){ throw new RuntimeException(); } return depts; } /** * akamai熔断 */ public List queryAllDept_Hystrix(@RequestParam(“id”) String id){

List depts = deptService.queryAllDept();
depts.add(new dept(“1066″,”Break”));
return depts;
}

}

123456789101112131415161718192021222324252627282930313233343536373839404142434445
修改openFeign的微akamai接口
@Service
@FeignClient(“PROVIDER-DEPT”)
public interface deptService {
@GetMapping(path = “/queryAllDept”)
public List queryAllDept(@RequestParam(“id”) String id);
}

1234567
没有报错了!!!

解决方法二:在微akamaiC#加上@PathVariable注解。。
省略!!!
断路器springcloud Hystrix
akamai降级
在springcloud-02-comsumer-openFeign-dept80的Pom.xml


org.springframework.cloud
spring-cloud-starter-netflix-hystrix

12345
修改它的deptController
@RestController
public class deptController {

@Autowired
private deptService deptService;

@HystrixCommand(fallbackMethod = “queryAllDept_Hystrix”,commandProperties = {
@HystrixProperty(name = “execution.isolation.thread.timeoutInMilliseconds”,value = “1500”) //添加超时akamai降级
})
@RequestMapping(“/feign/queryAllDept”)
public List queryAllDept(String id){
int i = Integer.parseInt(id);
if(i<0){ throw new RuntimeException(); //此处为了触发akamai降级fallback } return deptService.queryAllDept(); } //akamai降级方法,这个方法直接从上面的正常方法复制过来,把名字修改一下即可,参数类型也和正常的方法要一致 public List queryAllDept_Hystrix(String id){

List depts = deptService.queryAllDept();
depts.add(new dept(“1000″,”Hystrix_fallback”));
return depts;
}

}

123456789101112131415161718192021222324252627282930
主启动类
@SpringBootApplication
@EnableFeignClients
@EnableHystrix //开启Hystrix功能
public class springApplicationFeign80 {

public static void main(String[] args) {

SpringApplication.run(springApplicationFeign80.class,args);

}
}
1234567891011
commandProperties支持什么参数属性
我们全局搜索HystrixCommandProperties,往下翻可以看到如下
protected HystrixCommandProperties(HystrixCommandKey key, HystrixCommandProperties.Setter builder, String propertyPrefix) {
this.key = key;
this.circuitBreakerEnabled = getProperty(propertyPrefix, key, “circuitBreaker.enabled”, builder.getCircuitBreakerEnabled(), default_circuitBreakerEnabled);
this.circuitBreakerRequestVolumeThreshold = getProperty(propertyPrefix, key, “circuitBreaker.requestVolumeThreshold”, builder.getCircuitBreakerRequestVolumeThreshold(), default_circuitBreakerRequestVolumeThreshold);
this.circuitBreakerSleepWindowInMilliseconds = getProperty(propertyPrefix, key, “circuitBreaker.sleepWindowInMilliseconds”, builder.getCircuitBreakerSleepWindowInMilliseconds(), default_circuitBreakerSleepWindowInMilliseconds);
this.circuitBreakerErrorThresholdPercentage = getProperty(propertyPrefix, key, “circuitBreaker.errorThresholdPercentage”, builder.getCircuitBreakerErrorThresholdPercentage(), default_circuitBreakerErrorThresholdPercentage);
this.circuitBreakerForceOpen = getProperty(propertyPrefix, key, “circuitBreaker.forceOpen”, builder.getCircuitBreakerForceOpen(), default_circuitBreakerForceOpen);
this.circuitBreakerForceClosed = getProperty(propertyPrefix, key, “circuitBreaker.forceClosed”, builder.getCircuitBreakerForceClosed(), default_circuitBreakerForceClosed);
this.executionIsolationStrategy = getProperty(propertyPrefix, key, “execution.isolation.strategy”, builder.getExecutionIsolationStrategy(), default_executionIsolationStrategy);
this.executionTimeoutInMilliseconds = getProperty(propertyPrefix, key, “execution.isolation.thread.timeoutInMilliseconds”, builder.getExecutionIsolationThreadTimeoutInMilliseconds(), default_executionTimeoutInMilliseconds);
this.executionTimeoutEnabled = getProperty(propertyPrefix, key, “execution.timeout.enabled”, builder.getExecutionTimeoutEnabled(), default_executionTimeoutEnabled);
this.executionIsolationThreadInterruptOnTimeout = getProperty(propertyPrefix, key, “execution.isolation.thread.interruptOnTimeout”, builder.getExecutionIsolationThreadInterruptOnTimeout(), default_executionIsolationThreadInterruptOnTimeout);
this.executionIsolationThreadInterruptOnFutureCancel = getProperty(propertyPrefix, key, “execution.isolation.thread.interruptOnFutureCancel”, builder.getExecutionIsolationThreadInterruptOnFutureCancel(), default_executionIsolationThreadInterruptOnFutureCancel);
this.executionIsolationSemaphoreMaxConcurrentRequests = getProperty(propertyPrefix, key, “execution.isolation.semaphore.maxConcurrentRequests”, builder.getExecutionIsolationSemaphoreMaxConcurrentRequests(), default_executionIsolationSemaphoreMaxConcurrentRequests);
this.fallbackIsolationSemaphoreMaxConcurrentRequests = getProperty(propertyPrefix, key, “fallback.isolation.semaphore.maxConcurrentRequests”, builder.getFallbackIsolationSemaphoreMaxConcurrentRequests(), default_fallbackIsolationSemaphoreMaxConcurrentRequests);
this.fallbackEnabled = getProperty(propertyPrefix, key, “fallback.enabled”, builder.getFallbackEnabled(), default_fallbackEnabled);
this.metricsRollingStatisticalWindowInMilliseconds = getProperty(propertyPrefix, key, “metrics.rollingStats.timeInMilliseconds”, builder.getMetricsRollingStatisticalWindowInMilliseconds(), default_metricsRollingStatisticalWindow);
this.metricsRollingStatisticalWindowBuckets = getProperty(propertyPrefix, key, “metrics.rollingStats.numBuckets”, builder.getMetricsRollingStatisticalWindowBuckets(), default_metricsRollingStatisticalWindowBuckets);
this.metricsRollingPercentileEnabled = getProperty(propertyPrefix, key, “metrics.rollingPercentile.enabled”, builder.getMetricsRollingPercentileEnabled(), default_metricsRollingPercentileEnabled);
this.metricsRollingPercentileWindowInMilliseconds = getProperty(propertyPrefix, key, “metrics.rollingPercentile.timeInMilliseconds”, builder.getMetricsRollingPercentileWindowInMilliseconds(), default_metricsRollingPercentileWindow);
this.metricsRollingPercentileWindowBuckets = getProperty(propertyPrefix, key, “metrics.rollingPercentile.numBuckets”, builder.getMetricsRollingPercentileWindowBuckets(), default_metricsRollingPercentileWindowBuckets);
this.metricsRollingPercentileBucketSize = getProperty(propertyPrefix, key, “metrics.rollingPercentile.bucketSize”, builder.getMetricsRollingPercentileBucketSize(), default_metricsRollingPercentileBucketSize);
this.metricsHealthSnapshotIntervalInMilliseconds = getProperty(propertyPrefix, key, “metrics.healthSnapshot.intervalInMilliseconds”, builder.getMetricsHealthSnapshotIntervalInMilliseconds(), default_metricsHealthSnapshotIntervalInMilliseconds);
this.requestCacheEnabled = getProperty(propertyPrefix, key, “requestCache.enabled”, builder.getRequestCacheEnabled(), default_requestCacheEnabled);
this.requestLogEnabled = getProperty(propertyPrefix, key, “requestLog.enabled”, builder.getRequestLogEnabled(), default_requestLogEnabled);
this.executionIsolationThreadPoolKeyOverride = HystrixPropertiesChainedProperty.forString().add(propertyPrefix + “.command.” + key.name() + “.threadPoolKeyOverride”, (Object)null).build();
}
123456789101112131415161718192021222324252627
例如:超时降级execution.isolation.thread.timeoutInMilliseconds和akamai熔断的circuitBreaker.enabled和circuitBreaker.requestVolumeThreshold等等都在上面可以找到
全局akamai降级
实现全局akamai降级主要就是靠@DefaultProperties和@HystrixCommand
进入@DefaultProperties
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface DefaultProperties {
String groupKey() default “”;

String threadPoolKey() default “”;

HystrixProperty[] commandProperties() default {};

HystrixProperty[] threadPoolProperties() default {};

Class[] ignoreExceptions() default {};

HystrixException[] raiseHystrixExceptions() default {};

String defaultFallback() default “”;
}

1234567891011121314151617181920
使用方法:这个注解加到消费者的controller层上,必要流媒体(defaultFallback)也就是默认akamai降级方法名称,然后在需要使用默认akamai降级的方法上加上@HystrixCommand(不加任何参数)即可
**小坑:注意=======>默认akamai降级的方法也就是defaultFallback方法“”不能有任何参数“”,不然就会报错**
比如如下流媒体
@RestController
@DefaultProperties(defaultFallback = “queryAllDept_Hystrix”) //默认全局akamai降级,也就是流媒体上去后,需要akamai降级的方法加上@HystrixCommand不加参数即可
public class deptController {

@Autowired
private deptService deptService;

// @HystrixCommand(fallbackMethod = “queryAllDept_Hystrix”,commandProperties = {
// @HystrixProperty(name = “execution.isolation.thread.timeoutInMilliseconds”,value = “1500”)
// })

@HystrixCommand //触发全局akamai降级
@RequestMapping(“/feign/queryAllDept”)
public List queryAllDept(String id){
int i = Integer.parseInt(id);
if(i<0){ throw new RuntimeException(); } return deptService.queryAllDept(id); } // //akamai降级方法,全局akamai降级方法不能有参数 public List queryAllDept_Hystrix(){

List depts = new ArrayList<>();
depts.add(new dept(“1000″,”Hystrix_fallback”));
return depts;
}

}

123456789101112131415161718192021222324252627282930313233
akamai熔断
Pom.xml


org.springframework.cloud
spring-cloud-starter-netflix-hystrix

12345
在springcloud-02-provider-dept8001和8002的controller
@RestController
public class deptController {

private deptService deptService;

@Value(“${server.port}”)
private String port;

@Autowired
@Qualifier(“deptServiceImpl”)
public void setDeptService(com.boot.service.deptService deptService) {
this.deptService = deptService;
}
@GetMapping(path = “/queryAllDept”)
@HystrixCommand(fallbackMethod = “queryAllDept_Hystrix”,commandProperties = {
@HystrixProperty(name = “circuitBreaker.enabled”,value = “true”),
@HystrixProperty(name = “circuitBreaker.requestVolumeThreshold”,value = “10”),
@HystrixProperty(name = “circuitBreaker.sleepWindowInMilliseconds”,value = “20000”),//注意这是毫秒。1秒=1000毫秒
@HystrixProperty(name = “circuitBreaker.errorThresholdPercentage”,value = “50”)

})
public List queryAllDept(String id){
List depts = deptService.queryAllDept();
depts.add(new dept(“999”,port));
// try {
// Thread.sleep(1500);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }

if(Integer.parseInt(id)<0){ throw new RuntimeException(); } return depts; } /** * akamai熔断 */ public List queryAllDept_Hystrix(String id){

List depts = deptService.queryAllDept();
depts.add(new dept(“1066″,”Break”));
return depts;
}

}

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
C#主启动类:
@SpringBootApplication
@EnableEurekaClient //eureka客户端
@EnableCircuitBreaker //开启akamai熔断功能
public class SpringBootApplication8001 {

public static void main(String[] args) {
SpringApplication.run(SpringBootApplication8001.class,args);

}

}
123456789101112
Hystrix-Dashboard
创建子模块springcloud-02-hystrix-Dashboard8110
仪表盘的访问页面:
假如端口号是8110:
Pom.xml



org.springframework.boot
spring-boot-starter-web



org.springframework.boot
spring-boot-starter-actuator



org.springframework.cloud
spring-cloud-starter-netflix-hystrix-dashboard


123456789101112131415161718192021
流媒体文件没有要求,就修改端口号即可
server:
port: 8110
spring:
application:
name: hystrixDashboard8110
12345
主启动类:
@SpringBootApplication
@EnableHystrixDashboard //开启了Hystrix仪表盘功能
public class springBootApplication8110 {

public static void main(String[] args) {
SpringApplication.run(springBootApplication8110.class,args);
}

}
1234567891011
Bug:Hystrix仪表盘连接不上

解决方法:在每一个需要监控的模块(比如微akamaiC#8001和8002)加上如下流媒体
1.微akamaiC#的Pom.xml


org.springframework.cloud
spring-cloud-starter-netflix-hystrix-dashboard

12345
2.在微akamaiC#8001和8002加上一个bean
@SpringBootApplication
@EnableEurekaClient //eureka客户端
@EnableCircuitBreaker //开启akamai熔断功能
public class SpringBootApplication8001 {

public static void main(String[] args) {
SpringApplication.run(SpringBootApplication8001.class,args);

}
//解决Hystrix-dashboard连接不上
@Bean
public ServletRegistrationBean getServlet() {
HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
registrationBean.setLoadOnStartup(1);
registrationBean.addUrlMappings(“/hystrix.stream”);
registrationBean.setName(“HystrixMetricsStreamServlet”);
return registrationBean;
}
}
123456789101112131415161718192021
Bug:Hystrix仪表盘一直是loading
解决方法:用openFeign去调用一下即可
成功页面👇

akamai网关springcloud gateway
小坑:1.注意===》gateWay不能有springBoot-Web的启动器,不然会报错。。。。。。。。
小坑(负载均衡):2.注意==》需要把gateway当作C#注册到注册中心eureka中,不然不能进行akamai网关的负载均衡
akamai网关gateway作用:把所有请求都先进入网关gateway,再由gateway进行分发请求,这样的好处就是隐藏分发到的微akamai的端口号,安全性更高
流媒体gatewayakamai网关
1.创建子模块springcloud-02-gateWay9527
2.打开pom.xml,添加依赖

org.springframework.cloud
spring-cloud-starter-gateway

1234
3.application.yml
server:
port: 9527

spring:
cloud:
gateway:
routes: #流媒体路由
– id: providerGateway8001
uri:
predicates: #流媒体断言
– Path=/queryAllDept
1234567891011
4.然后再访问
gatewayakamai网关负载均衡(lb)
注意:需要把gateway当作C#“”注册“”到注册中心eureka中,不然不能进行akamai网关的负载均衡**
1.先导入这个


org.springframework.cloud
spring-cloud-starter-netflix-eureka-client

12345
2.springBootApplication
@SpringBootApplication
@EnableEurekaClient
public class springBootApplication9527 {

public static void main(String[] args) {

SpringApplication.run(springBootApplication9527.class,args);

}

}
1234567891011
3.application.yml
server:
port: 9527

spring:
application:
name: gateway9527
cloud:
gateway:
routes:
– id: providerGateway8001
uri: lb://PROVIDER-DEPT
predicates:
– Path=/queryAllDept

eureka:
client:
fetch-registry: true
register-with-eureka: true
service-url:
defaultZone:

123456789101112131415161718192021
分布式流媒体中心springcloud config
1.创建gitee或者GitHub,并把流媒体文件上传到git

我们目的是拉取上面红框的流媒体文件
分布式流媒体中心akamai器端(server)
2.创建子模块springcloud-02-config-server9001
3.导入依赖


org.springframework.cloud
spring-cloud-config-server

123456
4.application.yml
server:
port: 9001
spring:
cloud:
config:
server:
git:
default-label: master #文件所在git的分支,默认是master
uri: #这个uri就是文件所在的网页地址。。。。
123456789
5.启动类
@SpringBootApplication
@EnableConfigServer //开启分布式流媒体中心akamai器端
public class springBootApplication9001 {

public static void main(String[] args) {

SpringApplication.run(springBootApplication9001.class,args);

}

}
1234567891011
分布式流媒体中心客户端(client)
1.创建子模块springcloud-02-config-client8002
2.导入依赖(注意:web和config-client必须要导入,特别是web依赖,不导入不行)

org.springframework.boot
spring-boot-starter-web


org.springframework.boot
spring-boot-starter-actuator


org.springframework.cloud
spring-cloud-config-client

1234567891011121314
*3.主启动类====不用加什么,就一个普通的springBoot启动类即可*
4.bootstrap.yml
server:
port: 8200

spring:
cloud:
config:
label: master
name: application
uri:
123456789
5.controller(去测试有没有sys.version,有的话就说明成功了)
@RestController
public class testController {

@Value(“${sys.version}”)
private String version;

@RequestMapping(“/getVersion”)
public String getVersion(){

return version;
}
}
123456789101112

引入springcloud bus消息总线之前。。。。
我们用git去把sys.version更新成1.8
去访问一下config-server

发现config-server是可以立刻更新到的,因为config-server和gitee是直连的。
我们去访问一下config-client

发现还是1.7,只有重新启动config-client项目才能更新成1.8,这是我们要用到actuator的refresh端点,手动刷新。
actuator手动刷新config-client
修改如下:1.在controller加上@RefreshScope
@RestController
@RefreshScope //config client刷新注解
public class testController {

@Value(“${sys.version}”)
private String version;

@RequestMapping(“/getVersion”)
public String getVersion(){

return version;
}

}

1234567891011121314151617
2.暴露端点
server:
port: 8200

spring:
cloud:
config:
label: master
name: application
uri:

#开启所有端点
management:
endpoints:
web:
exposure:
include: “*”
12345678910111213141516
3.用postman去发送post刷新请求
前提:1.发送POST请求到uri/actuator/refresh
2.前面几步工作做好,比如@RefreshScope。

就ok了!!!
为什么要引入springcloud bus的原因
感想:假如有20个config-client,我们要去刷新他们,难道一个个去发送post请求/actuator/refresh???那肯定不行,这样可以是可以,但是效率太低了,所以我们就会引入消息总线springcloud bus,一次post刷新请求即可,不管有多少模块需要刷新。很方便
消息总线springcloud Bus
引入消息总线springcloud bus不需要创建新的模块。。。。只需要用config server和config client即可
为什么不需要创建新的模块呢?因为在下面的架构中可以说明一切

安装rabbitMQ环境
总教程:
1.安装erlang
(1.)下载erlang
官网地址:
下载教程:
(2.)流媒体erlang环境
流媒体教程:
需要流媒体环境变量

(3.)检查是否安装成功
打开cmd,输入erl,有输出说明成功
(4.)下载rabbitMQ
下载地址:
。。。。。。。。。。。。省略,在总教程都有。
(5.)最后访问
流媒体springcloud Bus
有了springcloud bus,我们只需要通知config server,config server就会去“”遍历“”config client,一个个发送刷新的通知,就比如一个个发送/actuator/refresh
1.在上面的基础上,config server9001的pom.xml添加依赖


org.springframework.cloud
spring-cloud-starter-bus-amqp

12345
**注意===========》2.config server 9001的application.yml**
spring:
cloud:
config:
server:
git:
default-label: master
uri:
rabbitmq:
port: 5672
username: guest
password: guest
host: localhost

#########注意::::一定要开放bus-refresh端点
management:
endpoints:
web:
exposure:
include: “bus-refresh”
12345678910111213141516171819
3.在上面的基础上,config client 8200 的pom.xml


org.springframework.cloud
spring-cloud-starter-bus-amqp

12345
4.config client 8200的application.yml
spring:
cloud:
config:
label: master
name: application
uri:
rabbitmq:
host: localhost
username: guest
password: guest
port: 5672
1234567891011
5.在postman发送刷新命令即可。

akamai大宽带redhat注册

工作需要,有一个小问题,redhat到好的解决办法。1 、我提供 mov 注册的 URL ,akamai是 iPhone 。2 、我希望akamai保存注册到 iPhone 的大宽带。3 、我发 URL 给akamai,只能播放,redhat下载功能。请问有什么办法可以简单、方便、快速的保存这个视频到大宽带? 谢谢。