@@ -116,8 +116,9 @@ public boolean optimizeProducer(String bootstrapServers, String clientId, Proper
116116
117117 // Check if optimization is active
118118 if (!metadataMessage .isActive ()) {
119- logger .error ("[ERR-054] Superstream optimization is not active for this kafka cluster, please head to the Superstream console and activate it." );
120- reportClientInformation (bootstrapServers , properties , metadataMessage , clientId , originalProperties , Collections .emptyMap ());
119+ String errMsg = "[ERR-054] Superstream optimization is not active for this kafka cluster, please head to the Superstream console and activate it." ;
120+ logger .error (errMsg );
121+ reportClientInformation (bootstrapServers , properties , metadataMessage , clientId , originalProperties , Collections .emptyMap (), errMsg );
121122 return false ;
122123 }
123124
@@ -133,7 +134,7 @@ public boolean optimizeProducer(String bootstrapServers, String clientId, Proper
133134
134135 if (modifiedKeys .isEmpty ()) {
135136 logger .debug ("No configuration parameters were modified" );
136- reportClientInformation (bootstrapServers , properties , metadataMessage , clientId , originalProperties , Collections .emptyMap ());
137+ reportClientInformation (bootstrapServers , properties , metadataMessage , clientId , originalProperties , Collections .emptyMap (), "" );
137138 return false ;
138139 }
139140
@@ -180,7 +181,8 @@ public boolean optimizeProducer(String bootstrapServers, String clientId, Proper
180181 metadataMessage ,
181182 clientId ,
182183 originalProperties ,
183- optimizedProperties
184+ optimizedProperties ,
185+ ""
184186 );
185187
186188 // Log optimization success with linger.ms status based on environment variable
@@ -250,7 +252,8 @@ private List<String> getApplicationTopics() {
250252 */
251253 private void reportClientInformation (String bootstrapServers , Properties originalProperties , MetadataMessage metadataMessage ,
252254 String clientId , Properties originalConfiguration ,
253- Map <String , Object > optimizedConfiguration ) {
255+ Map <String , Object > optimizedConfiguration ,
256+ String error ) {
254257 try {
255258 Map <String , Object > originalConfiguration1 = convertPropertiesToMap (originalConfiguration );
256259 List <String > topics = getApplicationTopics ();
@@ -272,7 +275,8 @@ private void reportClientInformation(String bootstrapServers, Properties origina
272275 originalConfiguration1 ,
273276 optimizedConfiguration ,
274277 mostImpactfulTopic ,
275- producerUuid
278+ producerUuid ,
279+ error
276280 );
277281
278282 if (!success ) {
0 commit comments