mirror of https://github.com/apache/activemq.git
[AMQ-7443] Add connection remote addr in the prefetch warn log message
(cherry picked from commit 7339e0516c
)
This commit is contained in:
parent
34bc37d68d
commit
71be503447
|
@ -116,7 +116,11 @@ public class TopicSubscription extends AbstractSubscription {
|
||||||
if (info.getPrefetchSize() > 1 && matched.size() > info.getPrefetchSize()) {
|
if (info.getPrefetchSize() > 1 && matched.size() > info.getPrefetchSize()) {
|
||||||
// Slow consumers should log and set their state as such.
|
// Slow consumers should log and set their state as such.
|
||||||
if (!isSlowConsumer()) {
|
if (!isSlowConsumer()) {
|
||||||
LOG.warn("{}: has twice its prefetch limit pending, without an ack; it appears to be slow", toString());
|
String remoteAddr = null;
|
||||||
|
if (context != null && context.getConnection() != null) {
|
||||||
|
remoteAddr = context.getConnection().getRemoteAddress();
|
||||||
|
}
|
||||||
|
LOG.warn("{}: has twice its prefetch limit pending, without an ack; it appears to be slow{}", toString(), (remoteAddr != null) ? ": " + remoteAddr : "");
|
||||||
setSlowConsumer(true);
|
setSlowConsumer(true);
|
||||||
for (Destination dest: destinations) {
|
for (Destination dest: destinations) {
|
||||||
dest.slowConsumer(getContext(), this);
|
dest.slowConsumer(getContext(), this);
|
||||||
|
@ -133,7 +137,7 @@ public class TopicSubscription extends AbstractSubscription {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!warnedAboutWait) {
|
if (!warnedAboutWait) {
|
||||||
LOG.info("{}: Pending message cursor [{}] is full, temp usag ({}%) or memory usage ({}%) limit reached, blocking message add() pending the release of resources.",
|
LOG.info("{}: Pending message cursor [{}] is full, temp usage ({}%) or memory usage ({}%) limit reached, blocking message add() pending the release of resources.",
|
||||||
new Object[]{
|
new Object[]{
|
||||||
toString(),
|
toString(),
|
||||||
matched,
|
matched,
|
||||||
|
|
Loading…
Reference in New Issue