{
ensurePayloadSerializable(event);
}
catch (final Exception e)
{
throw new MessagingException(
MessageFactory.createStaticMessage("Failed to prepare message for processing"), event, e);
}
try
{
EventStoreKey eventStoreKey = storeEvent(event);
scheduleForProcessing(eventStoreKey);
if (ackExpression == null)
{
return null;
}
Object ackResponsePayload = muleContext.getExpressionManager().evaluate(ackExpression,
event.getMessage());
return new DefaultMuleEvent(new DefaultMuleMessage(ackResponsePayload, event.getMessage(),
muleContext), event);
}
catch (Exception e)
{
throw new MessagingException(
MessageFactory.createStaticMessage("Failed to schedule the event for processing"), event, e);
}
}