Giter VIP home page Giter VIP logo

bugu-redis's Introduction

bugu-redis

bugu-redis是一个操作Redis的Java类库,它封装了Redis的各种常用功能,简单易用。

功能介绍

bugu-redis的功能包括2大部分:

1、各种Recipe。包括:

  • StoreRecipe:存储

  • CacheRecipe:缓存

  • QueueRecipe:队列

  • StackRecipe:栈

2、MQClient,用于发送消息。

消息

消息队列:Queue

  • Queue消息模型,采用生产者/消费者(Producer/Consumer)模式实现。
  • 同一个Queue,可以有多个消费者。Queue中的消息,如果被其中一个消费者消费掉了,那么其它的消费者不会接收到该消息。
  • 尽管一个Queue可以有多个消费者,但它更常用于一对一消息通信。
  • Queue中的消息,是有顺序的,即FIFO(先进先出)。
  • Queue中的消息,默认是FIFO的。但可以发布一条紧急消息,它会被插入到队列的头部,被消费者立刻接收到。
  • Queue中的消息,默认是持久保存的。即使消费者不在线,等到它下次上线的时候,仍能接收到该消息。
  • Queue中的消息,默认是持久保存的,直到它被消费掉。但可以设置消息的有效期,如果在有效期内还没被消费,则会自动从队列中移除。

消息广播:Topic

  • Topic消息模型,采用发布/订阅(Publish/Subscribe)模式实现。
  • 同一个Topic,可以有多个订阅者。当有消息发布到该Topic时,所有的订阅者都能接收到该消息。
  • 发布到Topic的消息,默认不会持久保存。只有在线的订阅者,才能接收到该消息。如果订阅者不在线,等到它下次上线的时候,仍然不会接收到该消息。
  • 发布到Topic的消息,默认不会持久保存。但可以发布一条保留消息(retained message),一旦有客户端订阅该Topic,立刻会收到该保留消息。一个Topic只能保存最新的一条保留消息。

使用示例

如何使用bugu-redis,请参考源代码中的单元测试部分。

bugu-redis's People

Contributors

xbwen avatar

Watchers

 avatar  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.