Skip to content

Commit

Permalink
JmsTemplate uses configured receiveTimeout if shorter than remaining …
Browse files Browse the repository at this point in the history
…transaction timeout

Issue: SPR-10109
  • Loading branch information
jhoeller committed Dec 19, 2012
1 parent b73a7a8 commit d3da2ed
Showing 1 changed file with 2 additions and 2 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -736,7 +736,7 @@ protected Message doReceive(Session session, MessageConsumer consumer) throws JM
JmsResourceHolder resourceHolder =
(JmsResourceHolder) TransactionSynchronizationManager.getResource(getConnectionFactory());
if (resourceHolder != null && resourceHolder.hasTimeout()) {
timeout = resourceHolder.getTimeToLiveInMillis();
timeout = Math.min(timeout, resourceHolder.getTimeToLiveInMillis());
}
Message message = doReceive(consumer, timeout);
if (session.getTransacted()) {
Expand Down

0 comments on commit d3da2ed

Please sign in to comment.