Esempio n. 1
0
  /**
   * Will receive an event from an endpointUri determined by the url
   *
   * @param url the Mule url used to determine the destination and transport of the message
   * @param timeout how long to block waiting to receive the event, if set to 0 the receive will not
   *     wait at all and if set to -1 the receive will wait forever
   * @return the message received or null if no message was received
   * @throws org.mule.api.MuleException
   */
  public MuleMessage receive(String url, long timeout) throws MuleException {
    ImmutableEndpoint endpoint =
        manager.getRegistry().lookupEndpointFactory().getOutboundEndpoint(url);

    try {
      return endpoint.request(timeout);
    } catch (Exception e) {
      throw new ReceiveException(endpoint, timeout, e);
    }
  }
Esempio n. 2
0
 public MuleMessage request(long timeout) throws Exception {
   return endpoint.request(timeout);
 }