Skip to content

Commit f150bf5

Browse files
committed
Make RabbitStreamTemplate.producer as volatile
1 parent b1c6893 commit f150bf5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spring-rabbit-stream/src/main/java/org/springframework/rabbit/stream/producer/RabbitStreamTemplate.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ public class RabbitStreamTemplate implements RabbitStreamOperations, Application
7979

8080
private boolean streamConverterSet;
8181

82-
private Producer producer;
83-
8482
private String beanName;
8583

8684
private ProducerCustomizer producerCustomizer = (name, builder) -> { };
@@ -90,10 +88,12 @@ public class RabbitStreamTemplate implements RabbitStreamOperations, Application
9088
@Nullable
9189
private RabbitStreamTemplateObservationConvention observationConvention;
9290

93-
private volatile boolean observationRegistryObtained;
94-
9591
private ObservationRegistry observationRegistry;
9692

93+
private volatile Producer producer;
94+
95+
private volatile boolean observationRegistryObtained;
96+
9797
/**
9898
* Construct an instance with the provided {@link Environment}.
9999
* @param environment the environment.

0 commit comments

Comments
 (0)