Search in sources :

Example 1 with CreateTableMessage

use of com.netflix.metacat.common.dto.notifications.sns.messages.CreateTableMessage in project metacat by Netflix.

the class SNSNotificationServiceImpl method notifyOfTableCreation.

/**
     * {@inheritDoc}
     */
@Override
@EventListener
public void notifyOfTableCreation(@NonNull final MetacatCreateTablePostEvent event) {
    log.debug("Received CreateTableEvent {}", event);
    CreateTableMessage message = null;
    try {
        message = new CreateTableMessage(UUID.randomUUID().toString(), event.getRequestContext().getTimestamp(), event.getRequestContext().getId(), event.getName().toString(), event.getTable());
        this.publishNotification(this.tableTopicArn, message);
        this.registry.counter(this.registry.createId(Metrics.CounterSNSNotificationTableCreate.name()).withTags(Metrics.statusSuccessMap)).increment();
    } catch (final Exception e) {
        this.handleException(event.getName(), "Unable to publish create table notification", Metrics.CounterSNSNotificationTableCreate.name(), message, e);
    }
}
Also used : CreateTableMessage(com.netflix.metacat.common.dto.notifications.sns.messages.CreateTableMessage) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) IOException(java.io.IOException) EventListener(org.springframework.context.event.EventListener)

Aggregations

JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 CreateTableMessage (com.netflix.metacat.common.dto.notifications.sns.messages.CreateTableMessage)1 IOException (java.io.IOException)1 EventListener (org.springframework.context.event.EventListener)1