use of org.gytheio.messaging.MessagingException in project alfresco-repository by Alfresco.
the class ExceptionEventsServiceImpl method exceptionGenerated.
@Override
public void exceptionGenerated(String txnId, Throwable t) {
if (enabled) {
try {
long timestamp = System.currentTimeMillis();
String networkId = TenantUtil.getCurrentDomain();
String username = AuthenticationUtil.getFullyAuthenticatedUser();
ExceptionGeneratedEvent event = new ExceptionGeneratedEvent(nextSequenceNumber(), txnId, timestamp, networkId, t, username);
messageProducer.send(event);
} catch (MessagingException e) {
logger.error(e);
}
}
}
use of org.gytheio.messaging.MessagingException in project alfresco-repository by Alfresco.
the class AbstractEventsService method afterRollback.
@Override
public void afterRollback() {
String txnId = AlfrescoTransactionSupport.getTransactionId();
long timestamp = System.currentTimeMillis();
String networkId = TenantUtil.getCurrentDomain();
String username = AuthenticationUtil.getFullyAuthenticatedUser();
Client alfrescoClient = getAlfrescoClient(null);
Event event = new TransactionRolledBackEvent(nextSequenceNumber(), txnId, networkId, timestamp, username, alfrescoClient);
if (logger.isDebugEnabled()) {
logger.debug("sendEvent " + event);
}
try {
messageProducer.send(event);
} catch (MessagingException e) {
// throw new AlfrescoRuntimeException("Failed to send event", e);
// TODO just log for now. How to deal with no running ActiveMQ?
logger.error("Failed to send event " + event, e);
} finally {
TxnEvents events = (TxnEvents) AlfrescoTransactionSupport.getResource(EVENTS_KEY);
if (events != null) {
events.clear();
}
}
}
Aggregations