@@ -167,11 +167,11 @@ public static class ChannelPublishAdvice {
167167 public static AMQP .BasicProperties setSpanNameAddHeaders (
168168 @ Advice .Argument (0 ) String exchange ,
169169 @ Advice .Argument (1 ) String routingKey ,
170- @ Advice .Argument (4 ) AMQP .BasicProperties props ,
170+ @ Advice .Argument (4 ) AMQP .BasicProperties originalProps ,
171171 @ Advice .Argument (5 ) byte [] body ) {
172172 Context context = Java8BytecodeBridge .currentContext ();
173173 Span span = Java8BytecodeBridge .spanFromContext (context );
174- AMQP .BasicProperties modifiedProps = props ;
174+ AMQP .BasicProperties props = originalProps ;
175175
176176 if (span .getSpanContext ().isValid ()) {
177177 helper ().onPublish (span , exchange , routingKey );
@@ -181,36 +181,36 @@ public static AMQP.BasicProperties setSpanNameAddHeaders(
181181 }
182182
183183 // This is the internal behavior when props are null. We're just doing it earlier now.
184- if (modifiedProps == null ) {
185- modifiedProps = MessageProperties .MINIMAL_BASIC ;
184+ if (props == null ) {
185+ props = MessageProperties .MINIMAL_BASIC ;
186186 }
187- helper ().onProps (context , span , modifiedProps );
187+ helper ().onProps (context , span , props );
188188
189189 // We need to copy the BasicProperties and provide a header map we can modify
190- Map <String , Object > headers = modifiedProps .getHeaders ();
190+ Map <String , Object > headers = props .getHeaders ();
191191 headers = (headers == null ) ? new HashMap <>() : new HashMap <>(headers );
192192
193193 helper ().inject (context , headers , MapSetter .INSTANCE );
194194
195- modifiedProps =
195+ props =
196196 new AMQP .BasicProperties (
197- modifiedProps .getContentType (),
198- modifiedProps .getContentEncoding (),
197+ props .getContentType (),
198+ props .getContentEncoding (),
199199 headers ,
200- modifiedProps .getDeliveryMode (),
201- modifiedProps .getPriority (),
202- modifiedProps .getCorrelationId (),
203- modifiedProps .getReplyTo (),
204- modifiedProps .getExpiration (),
205- modifiedProps .getMessageId (),
206- modifiedProps .getTimestamp (),
207- modifiedProps .getType (),
208- modifiedProps .getUserId (),
209- modifiedProps .getAppId (),
210- modifiedProps .getClusterId ());
200+ props .getDeliveryMode (),
201+ props .getPriority (),
202+ props .getCorrelationId (),
203+ props .getReplyTo (),
204+ props .getExpiration (),
205+ props .getMessageId (),
206+ props .getTimestamp (),
207+ props .getType (),
208+ props .getUserId (),
209+ props .getAppId (),
210+ props .getClusterId ());
211211 }
212212
213- return modifiedProps ;
213+ return props ;
214214 }
215215 }
216216
0 commit comments