Skip to content

Commit 53fc1e9

Browse files
committed
Avoid outdated Tibco workaround in shouldCommitAfterNoMessageReceived
Issue: SPR-14697 (cherry picked from commit 4396b21)
1 parent 53dc996 commit 53fc1e9

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

spring-jms/src/main/java/org/springframework/jms/listener/AbstractPollingMessageListenerContainer.java

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -91,8 +91,6 @@ public abstract class AbstractPollingMessageListenerContainer extends AbstractMe
9191

9292
private long receiveTimeout = DEFAULT_RECEIVE_TIMEOUT;
9393

94-
private volatile Boolean commitAfterNoMessageReceived;
95-
9694

9795
@Override
9896
public void setSessionTransacted(boolean sessionTransacted) {
@@ -343,7 +341,6 @@ protected boolean doReceiveAndExecute(
343341
}
344342
noMessageReceived(invoker, sessionToUse);
345343
// Nevertheless call commit, in order to reset the transaction timeout (if any).
346-
// However, don't do this on Tibco since this may lead to a deadlock there.
347344
if (shouldCommitAfterNoMessageReceived(sessionToUse)) {
348345
commitIfNecessary(sessionToUse, message);
349346
}
@@ -377,17 +374,12 @@ protected boolean isSessionLocallyTransacted(Session session) {
377374

378375
/**
379376
* Determine whether to trigger a commit after no message has been received.
380-
* This is a good idea on any JMS provider other than Tibco, which is what
381-
* this default implementation checks for.
377+
* This is a good idea on any modern-day JMS provider.
382378
* @param session the current JMS Session which received no message
383379
* @return whether to call {@link #commitIfNecessary} on the given Session
384380
*/
385381
protected boolean shouldCommitAfterNoMessageReceived(Session session) {
386-
if (this.commitAfterNoMessageReceived == null) {
387-
Session target = ConnectionFactoryUtils.getTargetSession(session);
388-
this.commitAfterNoMessageReceived = !target.getClass().getName().startsWith("com.tibco.tibjms.");
389-
}
390-
return this.commitAfterNoMessageReceived;
382+
return true;
391383
}
392384

393385
/**

0 commit comments

Comments
 (0)