Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
message-call-service
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
邵兴业
message-call-service
Commits
d156a3bc
Commit
d156a3bc
authored
Jul 23, 2021
by
Sxy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs: 文档
parent
27947086
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
3 deletions
+72
-3
README.md
+69
-0
routes/index.js
+1
-1
settings.js
+2
-2
No files found.
README.md
0 → 100644
View file @
d156a3bc
#### 实现功能
*
消息请求失败重试
*
消息请求延时发送
#### 启动
> npm run start
>
> 默认 3000端口
#### API
##### 消息请求失败重试
> 重试的阶梯时间 在 setting中配置
请求路径:/sendRetryMessage
method : post
请求参数 :
| 参数 | 类型 | 是否必填 | 备注 |
| :-----: | :----: | :------: | :--------------------------------------------: |
| url | string | Y | 转发的请求地址 |
| method | string | N | 创建请求时使用的方法,默认 post |
| headers | object | N | 请求头, 默认 Content-Type': 'application/json' |
| params | object | N |
`params`
是与请求一起发送的 URL 参数 |
| data | object | N | data 是作为请求体被发送的数据 |
| timeout | int | N |
`timeout`
指定请求超时的秒数, 默认5s |
返回参数 :
```
{
"messageId": "cc6a5cb3-baef-4718-9420-09e54899b232"
}
```
##### 消息请求延时发送
请求路径:/sendDelayMessage
method : post
请求参数 :
| 参数 | 类型 | 是否必填 | 备注 |
| :-------: | :----: | :------: | :----------------------------------------------: |
| url | string | Y | 转发的请求地址 |
| method | string | N | 创建请求时使用的方法,默认 post |
| headers | object | N | 请求头, 默认 Content-Type': 'application/json' |
| params | object | N |
`params`
是与请求一起发送的 URL 参数 |
| data | object | N | data 是作为请求体被发送的数据 |
| timeout | int | N |
`timeout`
指定请求超时的秒数, 默认5s |
| delayTime | int | Y | 延时多长时间返送 , 单位s ,最长不能超过49小时 |
返回参数 :
```
{
"messageId": "cc6a5cb3-baef-4718-9420-09e54899b232"
}
```
routes/index.js
View file @
d156a3bc
...
@@ -20,7 +20,7 @@ router.post('/sendRetryMessage', async (ctx, next) => {
...
@@ -20,7 +20,7 @@ router.post('/sendRetryMessage', async (ctx, next) => {
})
})
/**
/**
* 发送消息 - 队列
* 发送消息 -
延时
队列
*/
*/
router
.
post
(
'/sendDelayMessage'
,
async
(
ctx
,
next
)
=>
{
router
.
post
(
'/sendDelayMessage'
,
async
(
ctx
,
next
)
=>
{
ctx
.
verifyParams
({
ctx
.
verifyParams
({
...
...
settings.js
View file @
d156a3bc
...
@@ -11,7 +11,7 @@ module.exports = {
...
@@ -11,7 +11,7 @@ module.exports = {
vhost
:
'/'
,
vhost
:
'/'
,
},
},
PREFETCH
:
5
,
PREFETCH
:
5
,
LADDERDELAYOPTIONSL
:
{
LADDERDELAYOPTIONSL
:
{
// 重试功能配置
time
:
[
3
,
15
,
30
,
60
],
// 阶梯延时时间
time
:
[
3
,
15
,
30
,
60
],
// 阶梯延时时间
lodderExchangeDLX
:
"lodder.exchange.dlx"
,
// 延时交换器
lodderExchangeDLX
:
"lodder.exchange.dlx"
,
// 延时交换器
lodderQueueKeyDLX
:
"lodder.queueKey.dlx"
,
//lodder.queueKey.dlx.3 lodder.queueKey.dlx.15
lodderQueueKeyDLX
:
"lodder.queueKey.dlx"
,
//lodder.queueKey.dlx.3 lodder.queueKey.dlx.15
...
@@ -20,7 +20,7 @@ module.exports = {
...
@@ -20,7 +20,7 @@ module.exports = {
consumerQueue
:
"consumer.queue"
,
// 正常消费队列
consumerQueue
:
"consumer.queue"
,
// 正常消费队列
consumerRoutingKey
:
"consumer.routingkey"
consumerRoutingKey
:
"consumer.routingkey"
},
},
DELAYOPTIONSL
:
{
DELAYOPTIONSL
:
{
// 延时功能配置
delayExchange
:
"delay.exchange"
,
delayExchange
:
"delay.exchange"
,
delayQueue
:
"delay.queue"
,
delayQueue
:
"delay.queue"
,
delayRoutingKey
:
"delay.routingkey"
delayRoutingKey
:
"delay.routingkey"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment