code: private long determineTimeout() {
  
          long timeout = getReceiveTimeout();
  
          JmsResourceHolder resourceHolder = (JmsResourceHolder) TransactionSynchronizationManager
                  .getResource(getConnectionFactory());
          if (resourceHolder != null && resourceHolder.hasTimeout()) {
              timeout = Math.min(timeout, resourceHolder.getTimeToLiveInMillis());
          }
          return timeout;
      }
docs: Determines receive timeout, using logic equivalent to that of {@link JmsTemplate#doReceive(Session, MessageConsumer)
  @return The timeout determined