use of com.netflix.metacat.common.dto.notifications.sns.messages.UpdateTableMessage in project metacat by Netflix.
the class SNSNotificationServiceImpl method notifyOfTableRename.
/**
* {@inheritDoc}
*/
@Override
@EventListener
public void notifyOfTableRename(@NonNull final MetacatRenameTablePostEvent event) {
log.debug("Received RenameTableEvent {}", event);
UpdateTableMessage message = null;
try {
message = this.createUpdateTableMessage(UUID.randomUUID().toString(), event.getRequestContext().getTimestamp(), event.getRequestContext().getId(), event.getName().toString(), event.getOldTable(), event.getCurrentTable());
this.publishNotification(this.tableTopicArn, message);
this.registry.counter(this.registry.createId(Metrics.CounterSNSNotificationTableRename.name()).withTags(Metrics.statusSuccessMap)).increment();
} catch (final Exception e) {
this.handleException(event.getName(), "Unable to publish rename table notification", Metrics.CounterSNSNotificationTableRename.name(), message, e);
}
}
use of com.netflix.metacat.common.dto.notifications.sns.messages.UpdateTableMessage in project metacat by Netflix.
the class SNSNotificationServiceImpl method notifyOfTableUpdate.
/**
* {@inheritDoc}
*/
@Override
@EventListener
public void notifyOfTableUpdate(@NonNull final MetacatUpdateTablePostEvent event) {
log.debug("Received UpdateTableEvent {}", event);
UpdateTableMessage message = null;
try {
message = this.createUpdateTableMessage(UUID.randomUUID().toString(), event.getRequestContext().getTimestamp(), event.getRequestContext().getId(), event.getName().toString(), event.getOldTable(), event.getCurrentTable());
this.publishNotification(this.tableTopicArn, message);
this.registry.counter(this.registry.createId(Metrics.CounterSNSNotificationTableUpdate.name()).withTags(Metrics.statusSuccessMap)).increment();
} catch (final Exception e) {
this.handleException(event.getName(), "Unable to publish update table notification", Metrics.CounterSNSNotificationTableUpdate.name(), message, e);
}
}
Aggregations