Feature/fix zipkin spans alternate#5373
Conversation
…el processing of multicast or recipientlist. The original ZipkinState object ends up getting shared by different exchange object copies resulting in issues during push/pop operations. Added interface to allow safe copy of properties which can provide deep object copies for safe copy operations
|
|
||
| /** | ||
| * | ||
| * @author Samrat.Dhillon |
There was a problem hiding this comment.
Please remove author tags
| * | ||
| * @param <T> | ||
| * | ||
| * Interface that allows safe copy of property value object when creating copy of Exchange objects. Classes |
There was a problem hiding this comment.
Can you cleanup the javadoc of this
| */ | ||
| public interface CamelCopySafeProperty<T> { | ||
|
|
||
| CamelCopySafeProperty<T> safeCopy(); |
There was a problem hiding this comment.
Add javadoc here, as its part of camel-api which we should have documented
| * Interface that allows safe copy of property value object when creating copy of Exchange objects. Classes | ||
| * implementing this interface are responsible for creating deep copy of the property value object. | ||
| */ | ||
| public interface CamelCopySafeProperty<T> { |
There was a problem hiding this comment.
Remove Camel in the name, and maybe SafeCopyProperty is a bit better name
| void setDefaultConsumerCallback(AsyncCallback callback); | ||
|
|
||
| /** | ||
| * Method to set properties which for which deep copies can be created |
There was a problem hiding this comment.
Polish javadoc, and same for method below
| @Override | ||
| public <T> T getCopySafeProperty(String key, Class<T> type) { | ||
|
|
||
| Object value = getCopySafeProperties().get(key); |
There was a problem hiding this comment.
Optimize to check if there is any properties at all (ie its null) to then return null quickly
There was a problem hiding this comment.
Thanks @davsclaus . Updated the PR based on your feedback.
|
Can you work on the other tracer components to let them use safe copy too? |
@davsclaus I will take a look at opentracing next. However is it okay if I backport this? We are currently working with 3.7.3 and a fixed zipkin implementation will be very helpful. |
|
ok you can do that |
Fixing CAMEL-16509
Cleaner way of implementing copy safe properties on ExtendedExchange