protected List getMessages() throws Exception { QueueSession qs = connector.getQueueSession(); Queue queue = qs.getQueue(endpoint.getEndpointURI().getAddress()); UMOEvent event = (UMOEvent) queue.poll(connector.getQueueTimeout()); if (event != null) { routeMessage(new MuleMessage(event.getTransformedMessage(), event.getMessage())); } return null; }
protected void doConnect() throws Exception { if (connector.isQueueEvents()) { // Ensure we can create a vm queue QueueSession queueSession = connector.getQueueSession(); Queue q = queueSession.getQueue(endpoint.getEndpointURI().getAddress()); if (logger.isDebugEnabled()) { logger.debug( "Current queue depth for queue: " + endpoint.getEndpointURI().getAddress() + " is: " + q.size()); } } }
/* * (non-Javadoc) * * @see org.mule.umo.UMOEventListener#onEvent(org.mule.umo.UMOEvent) */ public void onEvent(UMOEvent event) throws UMOException { if (connector.isQueueEvents()) { QueueSession queueSession = connector.getQueueSession(); Queue queue = queueSession.getQueue(endpoint.getEndpointURI().getAddress()); try { queue.put(event); } catch (InterruptedException e) { throw new MuleException( CoreMessages.interruptedQueuingEventFor(this.endpoint.getEndpointURI()), e); } } else { UMOMessage msg = new MuleMessage(event.getTransformedMessage(), event.getMessage()); synchronized (lock) { routeMessage(msg); } } }