segmentio / analytics-java

The hassle-free way to integrate analytics into any java application.
https://segment.com/libraries/java
119 stars 92 forks source link

Segment's MessageBuilder context is write-only which prevents additive context building #486

Open rvowles opened 1 month ago

rvowles commented 1 month ago

I am trying to add Segment integration for the Java SDK for FeatureHub (https://featurehub.io) - and I need to be able to capture the state of the features when a message is dropped to Segment. I want to augment the context, but if someone has another MessageTransformer which has set the context, I cannot add to that context (in the MessageBuilder), I can only overwrite it. I get we should create a new Map and stuff the existing data into it so we don't have cross SDK leakage, but we should be able to get the existing context.

edsonjab commented 1 month ago

Hi @rvowles thank you for your report, we start looking into this.