当前位置: 首页 > news >正文

平台开发工程师上海seo网站优化

平台开发工程师,上海seo网站优化,三联网站建设工作室,仿站容易还是建站容易对于小型项目来说,我们通常对日志的处理没有那么多的要求,但是当用户量,数据量达到一定的峰值之后,问题就会随之而来。 比如: 用户日志怎么存放。用户日志存放后怎么利用。怎么在存储大量日志而不对系统造成影响。等很…

对于小型项目来说,我们通常对日志的处理没有那么多的要求,但是当用户量,数据量达到一定的峰值之后,问题就会随之而来。
比如:

  1. 用户日志怎么存放。
  2. 用户日志存放后怎么利用。
  3. 怎么在存储大量日志而不对系统造成影响。
  4. 等很多其他的问题,这样我们就需要借助消息队列进行业务的上解耦,数据上更好的传输。
package com.didispace;import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Processor;
import org.springframework.context.annotation.Bean;
import org.springframework.integration.annotation.InboundChannelAdapter;
import org.springframework.integration.annotation.Poller;
import org.springframework.integration.core.MessageSource;
import org.springframework.messaging.support.GenericMessage;import java.util.Date;//@EnableBinding(value = {Processor.class})
public class App2 {private static Logger logger = LoggerFactory.getLogger(HelloApplication.class);@Bean@InboundChannelAdapter(value = Processor.OUTPUT, poller = @Poller(fixedDelay = "2000"))public MessageSource<Date> timerMessageSource() {return () -> new GenericMessage<>(new Date());}@StreamListener(Processor.INPUT)public void receiveFromOutput(Object payload) {logger.info("Received: " + payload);}}
package com.didispace;import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;@SpringBootApplication
public class HelloApplication {public static void main(String[] args) {SpringApplication.run(HelloApplication.class, args);}}
package com.didispace;import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.Output;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.context.annotation.Bean;
import org.springframework.integration.annotation.InboundChannelAdapter;
import org.springframework.integration.annotation.Poller;
import org.springframework.integration.annotation.Transformer;
import org.springframework.integration.core.MessageSource;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.support.GenericMessage;
import org.springframework.scheduling.annotation.EnableScheduling;import java.text.SimpleDateFormat;
import java.util.Date;//@EnableBinding(value = {SinkSender.SinkOutput.class})
public class SinkSender {private static Logger logger = LoggerFactory.getLogger(HelloApplication.class);@Bean@InboundChannelAdapter(value = SinkOutput.OUTPUT, poller = @Poller(fixedDelay = "2000"))public MessageSource<Date> timerMessageSource() {return () -> new GenericMessage<>(new Date());}@Transformer(inputChannel = Sink.INPUT, outputChannel = SinkOutput.OUTPUT)public Object transform(Date message) {return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(message);}public interface SinkOutput {String OUTPUT = "input";@Output(SinkOutput.OUTPUT)MessageChannel output();}
}
package com.didispace;import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.Output;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.context.annotation.Bean;
import org.springframework.integration.annotation.InboundChannelAdapter;
import org.springframework.integration.annotation.Poller;
import org.springframework.integration.core.MessageSource;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.support.GenericMessage;//@EnableBinding(value = {SinkSender2.SinkOutput.class})
public class SinkSender2 {private static Logger logger = LoggerFactory.getLogger(HelloApplication.class);@Bean@InboundChannelAdapter(value = Sink.INPUT, poller = @Poller(fixedDelay = "2000"))public MessageSource<String> timerMessageSource() {return () -> new GenericMessage<>("{\"name\":\"didi\", \"age\":30}");}public interface SinkOutput {String OUTPUT = "input";@Output(SinkOutput.OUTPUT)MessageChannel output();}
}
package com.didispace;import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.messaging.Processor;
import org.springframework.context.annotation.Bean;
import org.springframework.integration.annotation.InboundChannelAdapter;
import org.springframework.integration.annotation.Poller;
import org.springframework.integration.core.MessageSource;
import org.springframework.messaging.support.GenericMessage;//@EnableBinding(value = {Processor.class})
public class SinkSender3 {private static Logger logger = LoggerFactory.getLogger(HelloApplication.class);@Bean@InboundChannelAdapter(value = Processor.OUTPUT, poller = @Poller(fixedDelay = "2000"))public MessageSource<String> timerMessageSource() {
//        Map<String, Object> headers = new HashMap<>();
//        headers.put("content-type", "application/user");return () -> new GenericMessage<>("{\"name\":\"didi\", \"age\":30}");}}
package com.didispace;import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.Output;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.cloud.stream.messaging.Source;
import org.springframework.context.annotation.Bean;
import org.springframework.integration.annotation.InboundChannelAdapter;
import org.springframework.integration.annotation.Poller;
import org.springframework.integration.core.MessageSource;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.support.GenericMessage;@EnableBinding(value = {Source.class})
public class SinkSender4 {private static Logger logger = LoggerFactory.getLogger(HelloApplication.class);@Bean@InboundChannelAdapter(value = Source.OUTPUT, poller = @Poller(fixedDelay = "2000"))public MessageSource<String> timerMessageSource() {return () -> new GenericMessage<>("{\"name\":\"didi\", \"age\":30}");}//    配置属性
//    # Partition
//    spring.cloud.stream.bindings.output.destination=greetings
//    spring.cloud.stream.bindings.output.producer.partitionKeyExpression=payload
//    spring.cloud.stream.bindings.output.producer.partitionCount=2
}
package com.didispace;import java.io.Serializable;public class User implements Serializable {private String name;private Integer age;public User() {}public User(String name, Integer age) {this.name = name;this.age = age;}public String getName() {return name;}public void setName(String name) {this.name = name;}public Integer getAge() {return age;}public void setAge(Integer age) {this.age = age;}@Overridepublic String toString() {return "name=" + name + ", age=" + age;}
}
spring.application.name=rabbitmq-hello-2
server.port=8002# Topic
#spring.cloud.stream.bindings.input.destination=output
#spring.cloud.stream.bindings.output.destination=input
spring.cloud.stream.bindings.input.content-type=application/json
spring.cloud.stream.bindings.output.content-type=application/json# RabbitMQ
#spring.rabbitmq.host=localhost
#spring.rabbitmq.port=5672
#spring.rabbitmq.username=springcloud
#spring.rabbitmq.password=123456# Comsumer Group:input
#spring.cloud.stream.bindings.input.group=Service-A# Partition
spring.cloud.stream.bindings.output.destination=greetings
spring.cloud.stream.bindings.output.producer.partitionKeyExpression=payload
spring.cloud.stream.bindings.output.producer.partitionCount=2
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.didispace</groupId><artifactId>stream-producer</artifactId><version>0.0.1-SNAPSHOT</version><packaging>jar</packaging><name>stream-producer</name><description>Demo project for Spring Boot</description><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>1.3.7.RELEASE</version><relativePath/> <!-- lookup parent from repository --></parent><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding><java.version>1.8</java.version></properties><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-stream-rabbit</artifactId></dependency></dependencies><dependencyManagement><dependencies><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-dependencies</artifactId><version>Brixton.SR5</version><type>pom</type><scope>import</scope></dependency></dependencies></dependencyManagement><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins></build>
</project>
http://www.lbrq.cn/news/2528965.html

相关文章:

  • 上海网站建设 网站开发肇庆seo优化
  • 广西智能网站建设哪家好合肥seo公司
  • 建立网站原理seo关键词优化软件app
  • 免费空间贴吧网络优化公司
  • 个人备案的网站可以做什么seo优化咨询
  • 珠海高端网站建设公司知识付费网站搭建
  • 画册设计效果图汕头seo关键词排名
  • 郴州网站建设哪个好重庆森林为什么不能看
  • 龙华建设局网站uc浏览器网页版入口
  • 西安网页设计师seo网站推广专员招聘
  • 美图秀秀在线修图seo职位要求
  • 那个网站推作者百度首页优化排名
  • 网站建设 资质使用最佳搜索引擎优化工具
  • 描述一下网站建设的基本流程直通车怎么开才有效果
  • 做调味品批发上哪个网站好搜索引擎优化要考虑哪些方面?
  • 淘宝优惠卷网站建设公司是真的假的徐州做网站的公司
  • 网站规划与开发技术专业黄页网站推广服务
  • 网站重新建设的申请dz论坛如何seo
  • 十大免费行情软件网站下载百度搜索榜
  • 电脑如何制作网页教程西安seo培训学校
  • 赤坎手机网站建设公司开源cms建站系统
  • 怎样做网站平台赚钱竞价服务托管公司
  • wordpress意见反馈功能资阳地seo
  • 网站怎么收录百度搜索推广是什么
  • 怎么制作免费网站教程视频百度收录时间
  • 动态网站建设工资优化排名
  • 上行10m做网站服务衡阳seo服务
  • 茶网站建设实训报告深圳快速seo排名优化
  • 专门做广东11选5的网站什么是seo搜索
  • 上海装修公司做网站注册城乡规划师含金量
  • Intellij Idea--解决Cannot download “https://start.spring.io‘: Connect timedout
  • 在 Web3 时代通过自我主权合规重塑 KYC/AML
  • 基于JavaWeb的兼职发布平台的设计与实现
  • vue3插槽详解
  • C#_运算符重载 operator
  • [机缘参悟-237]:AI人工神经网络与人类的神经网络工作原理的相似性