@Autowired
private WebsocketService websocketService;
@Override
public void accept(Event<StackOperationFailure> event) {
StackOperationFailure stackOperationFailure = event.getData();
Long stackId = stackOperationFailure.getStackId();
Stack byId = stackRepository.findById(stackId);
MDCBuilder.buildMdcContext(byId);
LOGGER.info("Accepted {} event.", ReactorConfig.STACK_UPDATE_FAILED_EVENT);
String detailedMessage = stackOperationFailure.getDetailedMessage();
stackUpdater.updateMetadataReady(stackId, true);
Stack stack = stackUpdater.updateStackStatus(stackId, Status.AVAILABLE, "Stack update failed. " + detailedMessage);
websocketService.sendToTopicUser(stack.getOwner(), WebsocketEndPoint.STACK,
new StatusMessage(stackId, stack.getName(), "UPDATE_FAILED", detailedMessage));
stackUpdater.updateStackStatusReason(stack.getId(), detailedMessage);