File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
spring-rabbit-stream/src/main/java/org/springframework/rabbit/stream/producer Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,7 @@ private Producer createOrGetProducer() {
111111 if (this .producer == null ) {
112112 this .lock .lock ();
113113 try {
114+ if (this .producer == null ) {
114115 ProducerBuilder builder = this .environment .producerBuilder ();
115116 if (this .superStreamRouting == null ) {
116117 builder .stream (this .streamName );
@@ -125,6 +126,7 @@ private Producer createOrGetProducer() {
125126 ((DefaultStreamMessageConverter ) this .streamConverter ).setBuilderSupplier (
126127 () -> this .producer .messageBuilder ());
127128 }
129+ }
128130 }
129131 finally {
130132 this .lock .unlock ();
@@ -332,8 +334,10 @@ public void close() {
332334 if (this .producer != null ) {
333335 this .lock .lock ();
334336 try {
337+ if (this .producer != null ) {
335338 this .producer .close ();
336339 this .producer = null ;
340+ }
337341 }
338342 finally {
339343 this .lock .unlock ();
You can’t perform that action at this time.
0 commit comments