44import ai .superstream .core .SuperstreamManager ;
55import ai .superstream .model .MetadataMessage ;
66import ai .superstream .util .SuperstreamLogger ;
7+ import ai .superstream .util .ClientUtils ;
78import net .bytebuddy .asm .Advice ;
89import java .util .AbstractMap ;
910
1819import java .util .concurrent .atomic .AtomicBoolean ;
1920import java .util .concurrent .atomic .AtomicReference ;
2021import java .lang .ThreadLocal ;
21- import java .util .Collections ;
2222import java .util .List ;
2323import java .util .Arrays ;
2424
@@ -182,24 +182,6 @@ public static void onEnter(@Advice.AllArguments Object[] args) {
182182 immutableOriginalMap .getClass ().getName ());
183183 logger .error (errMsg );
184184
185- // Report the error to the client
186- try {
187- // Get metadata message before reporting
188- AbstractMap .SimpleEntry <MetadataMessage , String > metadataResult = SuperstreamManager .getInstance ().getOrFetchMetadataMessage (bootstrapServers , properties );
189- MetadataMessage metadataMessage = metadataResult .getKey ();
190- SuperstreamManager .getInstance ().reportClientInformation (
191- bootstrapServers ,
192- properties ,
193- metadataMessage ,
194- clientId ,
195- properties ,
196- Collections .emptyMap (), // no optimized configuration since we can't optimize
197- errMsg
198- );
199- } catch (Exception e ) {
200- logger .error ("[ERR-058] Failed to report client error: {}" , e .getMessage (), e );
201- }
202-
203185 // Push ConfigInfo with error and original config for stats reporting
204186 java .util .Deque <ConfigInfo > cfgStack = TL_CFG_STACK .get ();
205187 cfgStack .push (new ConfigInfo (propertiesToMap (properties ), new java .util .HashMap <>(), errMsg ));
@@ -349,7 +331,7 @@ public static void onExit(@Advice.This Object producer) {
349331 }
350332 if (cfgInfo != null ) {
351333 // Use the original configuration from ConfigInfo and get complete config with defaults
352- java .util .Map <String , Object > completeConfig = ai . superstream . core . ClientReporter .getCompleteProducerConfig (cfgInfo .originalConfig );
334+ java .util .Map <String , Object > completeConfig = ClientUtils .getCompleteProducerConfig (cfgInfo .originalConfig );
353335 java .util .Map <String , Object > optimizedConfig = cfgInfo .optimizedConfig != null ? cfgInfo .optimizedConfig : new java .util .HashMap <>();
354336 reporter .setConfigurations (completeConfig , optimizedConfig );
355337 // If optimizedConfig is empty and there is an error, set the error on the reporter
@@ -360,7 +342,7 @@ public static void onExit(@Advice.This Object producer) {
360342 // No ConfigInfo available, so no optimization was performed
361343 // Use the producer properties as both original and optimized (since no changes were made)
362344 java .util .Map <String , Object > originalPropsMap = propertiesToMap (producerProps );
363- java .util .Map <String , Object > completeConfig = ai . superstream . core . ClientReporter .getCompleteProducerConfig (originalPropsMap );
345+ java .util .Map <String , Object > completeConfig = ClientUtils .getCompleteProducerConfig (originalPropsMap );
364346 reporter .setConfigurations (completeConfig , new java .util .HashMap <>());
365347 }
366348
0 commit comments