Netty-概览
参考文献
新手入门:目前为止最透彻的的Netty高性能原理和框架架构解析
Netty实战
Netty架构图
Netty源码结构
12345678910111213141516171819202122232425 Transport Services Protocol Support+----------------------------------------------+---------------------------------------------------------+| io.netty.transport | io.netty.codec || io.netty.transport.epoll | io.netty.codec.dns ...
OSS工具-rclone
参考文献
rclone
Install
rclone
安装
使用一键安装脚本
1sudo -v ; curl https://rclone.org/install.sh | sudo bash
使用二进制文件安装
1234567891011121314# 获取二进制压缩包,并解压curl -O https://downloads.rclone.org/rclone-current-linux-amd64.zipunzip rclone-current-linux-amd64.zipcd rclone-*-linux-amd64# 将rclone命令放入全局命令目录,并赋予权限sudo cp rclone /usr/bin/sudo chown root:root /usr/bin/rclonesudo chmod 755 /usr/bin/rclone# 安装manpagesudo mkdir -p /usr/local/share/man/man1sudo cp rclone.1 /usr/local/share/man/man1/sudo mandb
配置
rc ...
SpringBoot-注解@Import
参考文献
@Import使用
12345678910111213// org.springframework.context.annotation.Import@Target(ElementType.TYPE)@Retention(RetentionPolicy.RUNTIME)@Documentedpublic @interface Import { /** * {@link Configuration @Configuration}, {@link ImportSelector}, * {@link ImportBeanDefinitionRegistrar}, or regular component classes to import. */ Class<?>[] value();}
允许通过它引入@Configuration标注的类,引入ImportSelector接口和ImportBeanDefinitionRegistrar接口的实现,也包括@Component注解的普通类 ...
SpringBoot-注解@Autowired,@Resource,@Qualifier,@Primary
参考文献
Spring注解@Autowired源码分析
@Autowired
12345678910111213// org.springframework.beans.factory.annotation.Autowired@Target({ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.ANNOTATION_TYPE})@Retention(RetentionPolicy.RUNTIME)@Documentedpublic @interface Autowired { /** * Declares whether the annotated dependency is required. * <p>Defaults to {@code true}. */ boolean required() default true;}
使用场景
@Autowired标 ...
SpringBoot-注解@Value
参考文献
@Value
12345678910111213// org.springframework.beans.factory.annotation.Value@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE})@Retention(RetentionPolicy.RUNTIME)@Documentedpublic @interface Value { /** * The actual value expression such as <code>#{systemProperties.myProp}</code> * or property placeholder such as <code>${my.app.myProp}</code>. */ String value();}
@Value数据来源
1 ...
SpringBoot-注解@Async
参考文献
Spring事件之异步线程执行
@Async
123456789101112131415161718192021// org.springframework.scheduling.annotation.Async@Target({ElementType.TYPE, ElementType.METHOD})@Retention(RetentionPolicy.RUNTIME)@Documentedpublic @interface Async { /** * A qualifier value for the specified asynchronous operation(s). * <p>May be used to determine the target executor to be used when executing * the asynchronous operation(s), matching the qualifier value (or the bean * name) of a specific & ...
SpringBoot-注解@Scheduled
参考文献
@Scheduled
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})@Retention(RetentionPolicy.RUNTIME)@Documented@Repeatable(Schedules.class)public @interface Scheduled { String CRON_DISABLED = ScheduledTaskRegistrar.CRON_DISABLED; // 该参数接收一个cron表达式,cron表达式是一个字符串,字符串以5或6个空格隔开,分开共6或7个域,每一个域代表一个含义. /** * A cron-like expression, extending the usual UN*X definition to include trigger ...
SpringBoot-注解@ComponentScan和注解@ComponentScans
参考文献
@ComponentScan
@ComponentScan用于批量注册Bean.这个注解会让Spring去扫描某些包及其子包中所有的类.然后将满足一定条件的类作为Bean注册到Spring容器中.
12345678910111213141516171819202122232425262728293031323334353637383940414243// org.springframework.context.annotation.ComponentScan@Retention(RetentionPolicy.RUNTIME)@Target(ElementType.TYPE)@Documented@Repeatable(ComponentScans.class)public @interface ComponentScan { // 指定需要扫描的包 @AliasFor("basePackages") String[] value() default {}; // 作用和value一样,value和basePackag ...
SpringBoot-注解@Configuration
参考文献
Spring @Configuration 和 @Component 区别
@Configuration
12345678910111213// org.springframework.context.annotation.Configuration@Target(ElementType.TYPE)@Retention(RetentionPolicy.RUNTIME)@Documented@Componentpublic @interface Configuration { @AliasFor(annotation = Component.class) String value() default ""; boolean proxyBeanMethods() default true;}
使用@Configuration的约束
配置类必须以类的形式提供(不能是工厂方法返回的实例),允许通过生成子类在运行时增强(cglib 动态代理)。
配置类不能是final类(没法动态代理)。
配置注解通常为了通过@Bean注解生 ...
RabbitMQ-配置SSL
参考文献
TLS Support
RabbitMQ使用TLS支持SSL加密处理
https://docs.oracle.com/cd/E19509-01/820-3503/ggfen/index.html
Java Keytool Essentials: Working with Java Keystores
https://github.com/securitysushi/rabbitmq-ssl-example
运维侧配置
使用TSL工具生成证书
1234567git clone https://github.com/rabbitmq/tls-gen tls-gencd tls-gen/basic# private key passwordmake PASSWORD=bunniesmake verifymake infols -l ./result
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626 ...