Esempio n. 1
0
 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());
     }
   }
 }
Esempio n. 2
0
 /*
  * (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);
     }
   }
 }