@Override
public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
String emergencyId = ((Emergency) workItem.getParameter("emergency")).getId();
Vehicle vehicle = (Vehicle) workItem.getParameter("vehicle");
try {
MessageFactory.sendMessage(new VehicleDispatchedMessage(emergencyId, vehicle.getId()));
} catch (HornetQException ex) {
Logger.getLogger(DispatchVehicleWorkItemHandler.class.getName()).log(Level.SEVERE, null, ex);
}
manager.completeWorkItem(workItem.getId(), null);
}