go-mds

command module
v0.0.0-...-6c253c0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2020 License: MIT Imports: 6 Imported by: 0

README

go-mds

A reliable message service system developed with golang

消息发送流程

  1. 主动方发送预消息(消息状态为"待确认")
  2. 主动方根据(1)返回的结果执行响应的业务操作
  3. 发送业务处理结果,业务操作与消息确认保证在一个原子操作里面。
  4. 消息中间件根据业务结果, 更新("待发送"--> "发送中")/删除对应的消息
  5. 消息中间件监听并接收待发送状态的消息

消息服务系统

  1. 存储预发送消息
  2. 确认并发送消息
  3. 查询状态确认超时的消息
  4. 确认消息已被成功消息
  5. 查询消费确认超时的消息
  6. 删除消息
  7. 消息状态确认子系统(crontab)
  8. 消息恢复子系统

Api

  1. 消息预发送 POST http://127.0.0.1:3000/api/v1/message/create

    {
        "messageBody": "{'a': 'this is a test'}",
        "messageQueue": "test",
        "messageId": "43296482634873",
        "extra": ""
    }
    

    说明: messageBody为json数据, messageId指定消息发送的唯一Id >

  2. 消息发送确认
    POST http://127.0.0.1:3000/api/v1/message/confirm

     {
        "messageId": "324324234"
     }
    

ToDo

  1. 确认超时的消息需要被删除

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
db
log
mq
utils

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL