Coder Social home page Coder Social logo

ee_homework_3's Introduction

SpringBoot JPA Demo

学号姓名

16301070 梁洪铭

四次作业

第一次作业

第二次作业

第三次作业

第四次作业

第一次作业的基础:

实现了基础的注册登录功能,同时展示t_gym跟t_user两表的数据。

实现了两表关联,UserEntity跟Gym是多对一的关系,在Gym类中建立关联。

实现Spring Cache,多次查询在第一次查询后不再从数据库中查询。

实现了分页,但未在前端页面显示。

实现了Auditing,创建时间,更新时间自动生成。> 前端的展示我用了thymeleaf来映射数据。

第二次作业基础:

  1. Restful Service , restful api的设计。修改了上次的url设计
  2. RateLimiting 限流实现,简单的限流。100s内允许10次访问为测试用例。
  3. Online API documentation。 Using swagger实现接口文档生成
  4. Cache部分保留之前的spring cache
  5. Spring Security 尝试配置,但配置尚未完成。

本次完成的点

Kafka 应用

Kafka消息队列的应用。

先运行zookeeper

zookeeper-server-start.bat ../../config/zookeeper.properties

1560417069279

接着运行Kafka

kafka-server-start.bat ../../config/server.properties

1560417117253

  1. 新增目录结构

1560415537502

  1. 生产者

1560415967396

Publisher发送message消息。

kafkaTemplate.send(TopicConst.PAY_TOPIC,msg); 参数为 String topic + String msg。

  1. 消费者

1560416089880

消费者进行消费。

注解 @KafkaListener (topic),监听对应topic的消息,后调用logger将消息打印在控制台。

  1. 定义消息类

1560416462489

  1. 自定义工具类产生消息

1560416486858

  1. 编写Conrtroller接口进行测试

1560416508712

写了一个循环,不停地发布消息,前端浏览器每刷新一次页面,发布者发布信息。

之前运行了kafka,现在运行项目

1560417345941

发布,消费信息记录如图。

ee_homework_3's People

Contributors

pegasusliang avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.