File tree 1 file changed +5
-2
lines changed
spring-jms/src/main/java/org/springframework/jms/connection
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2016 the original author or authors.
2
+ * Copyright 2002-2018 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -335,7 +335,10 @@ else if (methodName.startsWith("create")) {
335
335
if (isCacheProducers () && (methodName .equals ("createProducer" ) ||
336
336
methodName .equals ("createSender" ) || methodName .equals ("createPublisher" ))) {
337
337
// Destination argument being null is ok for a producer
338
- return getCachedProducer ((Destination ) args [0 ]);
338
+ Destination dest = (Destination ) args [0 ];
339
+ if (!(dest instanceof TemporaryQueue || dest instanceof TemporaryTopic )) {
340
+ return getCachedProducer (dest );
341
+ }
339
342
}
340
343
else if (isCacheConsumers ()) {
341
344
// let raw JMS invocation throw an exception if Destination (i.e. args[0]) is null
You can’t perform that action at this time.
0 commit comments