Skip to content

Commit 4396b21

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

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) {
@@ -347,7 +345,6 @@ protected boolean doReceiveAndExecute(
347345
}
348346
noMessageReceived(invoker, sessionToUse);
349347
// Nevertheless call commit, in order to reset the transaction timeout (if any).
350-
// However, don't do this on Tibco since this may lead to a deadlock there.
351348
if (shouldCommitAfterNoMessageReceived(sessionToUse)) {
352349
commitIfNecessary(sessionToUse, message);
353350
}
@@ -381,17 +378,12 @@ protected boolean isSessionLocallyTransacted(Session session) {
381378

382379
/**
383380
* Determine whether to trigger a commit after no message has been received.
384-
* This is a good idea on any JMS provider other than Tibco, which is what
385-
* this default implementation checks for.
381+
* This is a good idea on any modern-day JMS provider.
386382
* @param session the current JMS Session which received no message
387383
* @return whether to call {@link #commitIfNecessary} on the given Session
388384
*/
389385
protected boolean shouldCommitAfterNoMessageReceived(Session session) {
390-
if (this.commitAfterNoMessageReceived == null) {
391-
Session target = ConnectionFactoryUtils.getTargetSession(session);
392-
this.commitAfterNoMessageReceived = !target.getClass().getName().startsWith("com.tibco.tibjms.");
393-
}
394-
return this.commitAfterNoMessageReceived;
386+
return true;
395387
}
396388

397389
/**

0 commit comments

Comments
 (0)