Package org.mule.api.client

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


        tm = muleContext.getTransactionManager();
        tm.begin();

        // This will fail, since there will be no Mule transaction to join
        MuleClient client = muleContext.getClient();
        client.dispatch("vm://entry?connector=vm-normal", "OK", null);
        Object response = client.request("queue", WAIT);
        assertNull(response);

        tm.commit();
    }
View Full Code Here


    @Test
    public void testDispatch() throws Exception
    {
        serviceComponentAck = false;
        MuleClient client = muleContext.getClient();
        client.dispatch("vm://dispatchIn", "TEST", null);
        MuleMessage message = client.request("vm://out", 10000);
        assertNotNull("Message", message);
    }

    @Test
View Full Code Here

        FileUtils.createFile(firstQueueFile.getAbsolutePath());

        muleContext.start();

        MuleClient client = muleContext.getClient();
        client.dispatch("vm://flowIn", "echo", null);
        MuleMessage result = client.request("vm://" + OUTPUT_QUEUE_NAME, RECEIVE_TIMEOUT);
        assertNotNull(result);
        assertEquals("echo", result.getPayload());
    }
}
View Full Code Here

    @Test
    public void testBoundedQueue() throws Exception
    {
        MuleClient client = muleContext.getClient();
        client.dispatch("vm://in", "Test1", null);
        Thread.sleep(SLEEP);
        client.dispatch("vm://in", "Test2", null);
        Thread.sleep(SLEEP);
        client.dispatch("vm://in", "Test3", null);
        Thread.sleep(SLEEP);
View Full Code Here

    public void testBoundedQueue() throws Exception
    {
        MuleClient client = muleContext.getClient();
        client.dispatch("vm://in", "Test1", null);
        Thread.sleep(SLEEP);
        client.dispatch("vm://in", "Test2", null);
        Thread.sleep(SLEEP);
        client.dispatch("vm://in", "Test3", null);
        Thread.sleep(SLEEP);

        // wait enough for queue offer to timeout
View Full Code Here

        MuleClient client = muleContext.getClient();
        client.dispatch("vm://in", "Test1", null);
        Thread.sleep(SLEEP);
        client.dispatch("vm://in", "Test2", null);
        Thread.sleep(SLEEP);
        client.dispatch("vm://in", "Test3", null);
        Thread.sleep(SLEEP);

        // wait enough for queue offer to timeout
        Thread.sleep(muleContext.getConfiguration().getDefaultQueueTimeout());
View Full Code Here

        // There is a need to guarantee that XaMessageTopicReceiver connected to
        // topic
        Thread.sleep(5000);

        MuleClient client = muleContext.getClient();
        client.dispatch("vm://in", DEFAULT_INPUT_MESSAGE, null);

        MuleMessage result = client.request("vm://out", getTimeout());
        assertNotNull(result);

        result = client.request("vm://out", getTimeout());
View Full Code Here

        muleContext.getRegistry().lookupConnector(CONNECTOR1_NAME).stop();
        assertEquals(muleContext.getRegistry().lookupConnector(CONNECTOR1_NAME).isStarted(), false);
        log.info(CONNECTOR1_NAME + " is stopped");

        client.dispatch("vm://in", DEFAULT_INPUT_MESSAGE, null);
        Thread.sleep(1000);
        muleContext.getRegistry().lookupConnector(CONNECTOR1_NAME).start();
        Thread.sleep(1000);
        log.info(CONNECTOR1_NAME + " is started");
View Full Code Here

        MuleMessage msg = new DefaultMuleMessage("testing", muleContext);
        msg.setReplyTo("ReplyTo");

        // Send asynchronous request
        client.dispatch("EchoVm", msg, null);

        // Wait for asynchronous response
        MuleMessage result = client.request("ReplyTo", RECEIVE_DELAY);
        assertNotNull("Result is null", result);
        assertFalse("Result is null", result.getPayload() instanceof NullPayload);
View Full Code Here

        MuleMessage msg = new DefaultMuleMessage("testing", muleContext);
        msg.setReplyTo("ReplyTo");

        // Send asynchronous request
        client.dispatch("EchoAxisSend", msg, null);

        // Wait for asynchronous response
        MuleMessage result = client.request("ReplyTo", RECEIVE_DELAY);
        assertNotNull("Result is null", result);
        assertFalse("Result is null", result.getPayload() instanceof NullPayload);
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.