Skip to content

Commit

Permalink
Added logging for table params
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamza Jugon committed Nov 26, 2024
1 parent c646650 commit e71a5ae
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,35 @@

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import com.expedia.apiary.extensions.receiver.common.event.ListenerEvent;

import com.expediagroup.beekeeper.core.model.LifecycleEventType;

@Component
public class TableParameterListenerEventFilter implements ListenerEventFilter {

private static final Logger log = LoggerFactory.getLogger(TableParameterListenerEventFilter.class);

@Override
public boolean isFiltered(ListenerEvent listenerEvent, LifecycleEventType lifecycleEventType) {
Map<String, String> tableParameters = listenerEvent.getTableParameters();

// Log the table params
if (tableParameters != null && !tableParameters.isEmpty()) {
log.info("Processing table parameters for event: {}", tableParameters);
log.debug("Detailed table parameters: {}", tableParameters);
} else {
log.info("No table parameters found for event.");
}

if (tableParameters == null) {
return true;
}

return !Boolean.parseBoolean(tableParameters.get(lifecycleEventType.getTableParameterName()));
}
}

0 comments on commit e71a5ae

Please sign in to comment.