Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YZG
yzg-util
Commits
4ef29162
Commit
4ef29162
authored
Mar 19, 2021
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
不记录系统日志
parent
f4f83fc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
YzgMqProcedure.java
...src/main/java/com/yanzuoguang/mq/plan/YzgMqProcedure.java
+11
-3
No files found.
yzg-util-mq/src/main/java/com/yanzuoguang/mq/plan/YzgMqProcedure.java
View file @
4ef29162
...
@@ -9,6 +9,7 @@ import com.yanzuoguang.util.helper.JsonHelper;
...
@@ -9,6 +9,7 @@ import com.yanzuoguang.util.helper.JsonHelper;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -48,6 +49,9 @@ public class YzgMqProcedure implements InitializingBean {
...
@@ -48,6 +49,9 @@ public class YzgMqProcedure implements InitializingBean {
@Autowired
@Autowired
private
MqService
mqService
;
private
MqService
mqService
;
@Value
(
"${yzg.mq.unit.min:1000}"
)
private
long
min
;
/**
/**
* Invoked by a BeanFactory after it has set all bean properties supplied
* Invoked by a BeanFactory after it has set all bean properties supplied
* (and satisfied BeanFactoryAware and ApplicationContextAware).
* (and satisfied BeanFactoryAware and ApplicationContextAware).
...
@@ -63,8 +67,8 @@ public class YzgMqProcedure implements InitializingBean {
...
@@ -63,8 +67,8 @@ public class YzgMqProcedure implements InitializingBean {
mqService
.
createQueue
(
new
QueueVo
(
YZG_MQ_SYSTEM_QUEUE
));
mqService
.
createQueue
(
new
QueueVo
(
YZG_MQ_SYSTEM_QUEUE
));
mqService
.
createQueue
(
new
QueueVo
(
YZG_MQ_SYSTEM_QUEUE_PLAN
));
mqService
.
createQueue
(
new
QueueVo
(
YZG_MQ_SYSTEM_QUEUE_PLAN
));
if
(
YZG_MQ_SYSTEM_QUEUE_PLAN_TIME
.
isEmpty
())
{
if
(
YZG_MQ_SYSTEM_QUEUE_PLAN_TIME
.
isEmpty
())
{
//
YZG_MQ_SYSTEM_QUEUE_PLAN_TIME.add(YZG_MQ_SYSTEM_QUEUE_PLAN_MILL_SECOND_125);
YZG_MQ_SYSTEM_QUEUE_PLAN_TIME
.
add
(
YZG_MQ_SYSTEM_QUEUE_PLAN_MILL_SECOND_125
);
//
YZG_MQ_SYSTEM_QUEUE_PLAN_TIME.add(YZG_MQ_SYSTEM_QUEUE_PLAN_MILL_SECOND_250);
YZG_MQ_SYSTEM_QUEUE_PLAN_TIME
.
add
(
YZG_MQ_SYSTEM_QUEUE_PLAN_MILL_SECOND_250
);
YZG_MQ_SYSTEM_QUEUE_PLAN_TIME
.
add
(
YZG_MQ_SYSTEM_QUEUE_PLAN_MILL_SECOND_500
);
YZG_MQ_SYSTEM_QUEUE_PLAN_TIME
.
add
(
YZG_MQ_SYSTEM_QUEUE_PLAN_MILL_SECOND_500
);
YZG_MQ_SYSTEM_QUEUE_PLAN_TIME
.
add
(
YZG_MQ_SYSTEM_QUEUE_PLAN_MIN
);
YZG_MQ_SYSTEM_QUEUE_PLAN_TIME
.
add
(
YZG_MQ_SYSTEM_QUEUE_PLAN_MIN
);
long
now
=
YZG_MQ_SYSTEM_QUEUE_PLAN_MIN
.
unit
;
long
now
=
YZG_MQ_SYSTEM_QUEUE_PLAN_MIN
.
unit
;
...
@@ -77,6 +81,10 @@ public class YzgMqProcedure implements InitializingBean {
...
@@ -77,6 +81,10 @@ public class YzgMqProcedure implements InitializingBean {
}
}
}
}
for
(
TimeUnit
item
:
YZG_MQ_SYSTEM_QUEUE_PLAN_TIME
)
{
for
(
TimeUnit
item
:
YZG_MQ_SYSTEM_QUEUE_PLAN_TIME
)
{
// 在时间范围内,则返回大于等待时间的队列
if
(
item
.
unit
<
min
)
{
continue
;
}
mqService
.
createQueue
(
new
QueueVo
(
getQueueName
(
item
),
item
.
unit
,
YZG_MQ_SYSTEM_QUEUE_PLAN
));
mqService
.
createQueue
(
new
QueueVo
(
getQueueName
(
item
),
item
.
unit
,
YZG_MQ_SYSTEM_QUEUE_PLAN
));
}
}
}
}
...
@@ -101,7 +109,7 @@ public class YzgMqProcedure implements InitializingBean {
...
@@ -101,7 +109,7 @@ public class YzgMqProcedure implements InitializingBean {
TimeUnit
prevUnit
=
YZG_MQ_SYSTEM_QUEUE_PLAN_MIN
;
TimeUnit
prevUnit
=
YZG_MQ_SYSTEM_QUEUE_PLAN_MIN
;
for
(
TimeUnit
timeUnit
:
YZG_MQ_SYSTEM_QUEUE_PLAN_TIME
)
{
for
(
TimeUnit
timeUnit
:
YZG_MQ_SYSTEM_QUEUE_PLAN_TIME
)
{
// 在时间范围内,则返回大于等待时间的队列
// 在时间范围内,则返回大于等待时间的队列
if
(
timeUnit
.
unit
>=
waitTime
)
{
if
(
timeUnit
.
unit
>=
waitTime
&&
timeUnit
.
unit
>=
min
)
{
break
;
break
;
}
}
// 上次单位
// 上次单位
...
...
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