Package org.mule.api.client

Examples of org.mule.api.client.LocalMuleClient.dispatch()


                messageProcessedLatch.countDown();
                throw new RuntimeException();
            }
        });
        LocalMuleClient client = muleContext.getClient();
        client.dispatch("jms://in3?connector=jmsConnector", MESSAGE_TO_SEND, null);
        if (!messageProcessedLatch.await(TIMEOUT, java.util.concurrent.TimeUnit.MILLISECONDS))
        {
            fail("Message never received by mule");
        }
        MuleMessage response = client.request("jms://dead.letter3?connector=jmsConnector", TIMEOUT);
View Full Code Here


        ports.add(dynamicPort5.getNumber());
        ports.add(dynamicPort6.getNumber());

        greenMailSupport.startServers(ports);
        LocalMuleClient client = muleContext.getClient();
        client.dispatch("jms://in6?connector=jmsConnectorNoRedelivery", MESSAGE_TO_SEND, null);
        endMessageProcessorExecuted.await(TIMEOUT, TimeUnit.MILLISECONDS);
        ((Lifecycle) getFlowConstruct("RollbackTransactionAndSendEmail")).stop();
        MuleMessage response = client.request("jms://in6?connector=jmsConnectorNoRedelivery", TIMEOUT);
        assertThat(response, IsNull.<Object>notNullValue());
        assertThat(response.getPayloadAsString(), is(MESSAGE_TO_SEND));
View Full Code Here

    private void testExceptionStrategy(String destination, Map<String, Object> messageProperties) throws MuleException, InterruptedException
    {
        latch = spy(new CountDownLatch(2));
        LocalMuleClient client = muleContext.getClient();
        client.dispatch(destination, MESSAGE, messageProperties);

        assertFalse(latch.await(3, TimeUnit.SECONDS));
        verify(latch).countDown();
    }
View Full Code Here

    @Test
    public void verifiesNoMuleSessionHeader() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();

        client.dispatch("vm://testInput", TEST_MESSAGE, null);
        MuleMessage response = client.request("vm://testOut", RECEIVE_TIMEOUT);

        assertNotNull("Message was filtered", response);
    }
}
View Full Code Here

    @Test
    public void testIssue() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();
        client.dispatch(VM_TEST_INPUT, TEST_MESSAGE, null);

        assertOnlyOneThreadWaiting(messages, latch);
    }

    public static class BlockingComponent
View Full Code Here

    @Test
    public void testIssue() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();
        client.dispatch(VM_TEST_INPUT, TEST_MESSAGE, null);
        client.dispatch(VM_TEST_INPUT, TEST_MESSAGE, null);

        assertOnlyOneThreadWaiting(messages, latch);
    }
View Full Code Here

    @Test
    public void testIssue() throws Exception
    {
        LocalMuleClient client = muleContext.getClient();
        client.dispatch(VM_TEST_INPUT, TEST_MESSAGE, null);
        client.dispatch(VM_TEST_INPUT, TEST_MESSAGE, null);

        assertOnlyOneThreadWaiting(messages, latch);
    }

    public static class BlockingComponent
View Full Code Here

//            xs.registerConverter(new MyPersistentSetConverter(xs.getMapper()), XStream.PRIORITY_VERY_HIGH);
//            xs.omitField(ProcessInstance.class, "definition");
//            xs.omitField(ProcessInstance.class, "processLogs");
//            String input = xs.toXML(processInstance);
            if (asynchronous) {
                client.dispatch(destinationEndpointUrl, processInstance, null);
            } else {
                MuleMessage muleMessage = client.send(destinationEndpointUrl,
                                                      payload != null ? payload : processInstance,
                                                      null, timeout);
                if (muleMessage != null) {
View Full Code Here

      if (resultVariableValue != null) {
        execution.setVariable(resultVariableValue, result);
      }
      break;
    case ONE_WAY:
      client.dispatch(endpointUrlValue, message);
      break;
    default:
      break;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.