Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
joram
joram
Commits
eaf58e42
Commit
eaf58e42
authored
Jan 15, 2021
by
Andre Freyssinet
Browse files
Disables flow control if max value is less than 0.
parent
5a01406d
Changes
1
Hide whitespace changes
Inline
Side-by-side
joram/joram/mom/core/src/main/java/org/objectweb/joram/mom/dest/AcquisitionQueue.java
View file @
eaf58e42
...
...
@@ -180,16 +180,25 @@ public class AcquisitionQueue extends Queue implements AcquisitionQueueMBean {
this
.
properties
=
properties
;
diff_max
=
Long
.
parseLong
(
properties
.
getProperty
(
DestinationConstants
.
ACQ_QUEUE_MAX_MSG
,
String
.
valueOf
(
diff_max
)));
diff_min
=
Long
.
parseLong
(
properties
.
getProperty
(
DestinationConstants
.
ACQ_QUEUE_MIN_MSG
,
String
.
valueOf
(
diff_min
)));
if
(
diff_max
<
2
)
diff_max
=
2
;
if
(
diff_min
>=
diff_max
)
diff_min
=
diff_max
-
2
;
if
(
diff_min
<
0
)
diff_min
=
0
;
if
(
diff_max
<=
0
)
{
// Flow-control is disabled
diff_max
=
diff_min
=
0
;
}
else
{
diff_min
=
Long
.
parseLong
(
properties
.
getProperty
(
DestinationConstants
.
ACQ_QUEUE_MIN_MSG
,
String
.
valueOf
(
diff_min
)));
if
(
diff_max
<
2
)
diff_max
=
2
;
if
(
diff_min
>=
diff_max
)
diff_min
=
diff_max
-
2
;
if
(
diff_min
<
0
)
diff_min
=
0
;
}
pending_max
=
Long
.
parseLong
(
properties
.
getProperty
(
DestinationConstants
.
ACQ_QUEUE_MAX_PND
,
String
.
valueOf
(
pending_max
)));
pending_min
=
Long
.
parseLong
(
properties
.
getProperty
(
DestinationConstants
.
ACQ_QUEUE_MIN_PND
,
String
.
valueOf
(
pending_min
)));
if
(
pending_max
<
2
)
pending_max
=
2
;
if
(
pending_min
>=
pending_max
)
pending_min
=
pending_max
-
2
;
if
(
pending_min
<
0
)
pending_min
=
0
;
if
(
pending_max
<=
0
)
{
pending_max
=
pending_min
=
0
;
}
else
{
pending_min
=
Long
.
parseLong
(
properties
.
getProperty
(
DestinationConstants
.
ACQ_QUEUE_MIN_PND
,
String
.
valueOf
(
pending_min
)));
if
(
pending_max
<
2
)
pending_max
=
2
;
if
(
pending_min
>=
pending_max
)
pending_min
=
pending_max
-
2
;
if
(
pending_min
<
0
)
pending_min
=
0
;
}
if
(
logger
.
isLoggable
(
BasicLevel
.
INFO
))
logger
.
log
(
BasicLevel
.
INFO
,
...
...
Write
Preview
Supports
Markdown
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