// Get the order
Order order = (Order)event.getSource();
String result = processOrder(order);
// Cast the event to a Mule event, we'll use this to get the AppContext
MuleApplicationEvent muleEvent = (MuleApplicationEvent)event;
// Create a new DefaultMuleEvent. This will be sent to the replyTo
// address
MuleApplicationEvent returnEvent = null;
returnEvent = new MuleApplicationEvent(result, "jms://processed.queue");
// Call publish on the application context, Mule will do the rest
muleEvent.getApplicationContext().publishEvent(returnEvent);
}