Package org.mule.api

Examples of org.mule.api.FutureMessageResult


    @Test
    public void testDynamicEndpoint() throws Exception
    {
        MuleClient client = new MuleClient(muleContext);
        FutureMessageResult result = client.sendAsync("vm://inBound", "Hello,world", null, 5000);
        MuleMessage response = result.getMessage(5000);
        assertNotNull(response);
        assertNotNull(response.getPayload());
        assertEquals("step2Service", response.getPayloadAsString());
    }
View Full Code Here


    @Test
    public void testDynamicEndpoint() throws Exception
    {
        MuleClient client = new MuleClient(muleContext);
        FutureMessageResult result = client.sendAsync("vm://inBound", "Hello,world", null, 5000);
        MuleMessage response = result.getMessage(5000);
        assertNotNull(response);
        assertNotNull(response.getPayload());
        assertEquals("step2Service", response.getPayloadAsString());
    }
View Full Code Here

        //<start id="lis_12_xml-remote-dispatch-2"/>
        MuleClient muleClient = new MuleClient(true);
        RemoteDispatcher remoteDispatcher =
             muleClient.getRemoteDispatcher("http://localhost:8080/_remoting");
        //<end id="lis_12_xml-remote-dispatch-2"/>
        FutureMessageResult asyncResponse = remoteDispatcher.sendAsyncRemote(
            "clientServiceChannel", TEST_CLIENT_ID, null);

        MuleMessage result = asyncResponse.getMessage();
        muleClient.dispose();
       
        assertThat(result.getPayloadAsString(), is("fake_client_data"));

        // ensure that Mule client runs in a different context than Mule that is called remotely
View Full Code Here

    {
        //<start id="lis_12_remote-dispatch-2"/>
        MuleClient muleClient = new MuleClient(true);//<co id="lis_12_remote-dispatch-2_1"/>
        RemoteDispatcher remoteDispatcher =
             muleClient.getRemoteDispatcher("tcp://localhost:5555");//<co id="lis_12_remote-dispatch-2_2"/>
        FutureMessageResult asyncResponse =
            remoteDispatcher.sendAsyncRemote(//<co id="lis_12_remote-dispatch-2_3"/>
            "clientServiceChannel",
            TEST_CLIENT_ID,
            null);
        //<end id="lis_12_remote-dispatch-2"/>

        MuleMessage result = asyncResponse.getMessage();
        muleClient.dispose();

        assertThat(result.getPayloadAsString(), is("fake_client_data"));

        // ensure that Mule client runs in a different context than Mule that is called remotely
View Full Code Here

    @Test
    public void usesConnectionTimeout() throws Exception
    {

        final MuleClient client = new MuleClient(muleContext);
        FutureMessageResult result = client.sendAsync("vm://testInput", TEST_MESSAGE, null);

        MuleMessage message = null;
        try
        {
            message = result.getMessage(1000);
        }
        catch (TimeoutException e)
        {
            fail("Connection timeout not honored.");
        }
View Full Code Here

    @Test
    public void usesConnectionTimeout() throws Exception
    {
        final MuleClient client = new MuleClient(muleContext);
        FutureMessageResult result = client.sendAsync("vm://testInput", TEST_MESSAGE, null);

        MuleMessage message = null;
        try
        {
            message = result.getMessage(1000);
        }
        catch (TimeoutException e)
        {
            fail("Connection timeout not honored.");
        }
View Full Code Here

    @Test
    public void socketReadWriteResponseTimeout() throws Exception
    {
        final MuleClient client = new MuleClient(muleContext);
        FutureMessageResult result = client.sendAsync("vm://inboundTest1", "something", null);
        MuleMessage message = null;
        try
        {
            message = result.getMessage(1000);
        }
        catch (TimeoutException e)
        {
            fail("Response timeout not honored.");
        }
View Full Code Here

    @Test
    public void socketConnectionResponseTimeout() throws Exception
    {
        final MuleClient client = new MuleClient(muleContext);
        FutureMessageResult result = client.sendAsync("vm://inboundTest2", "something", null);
        MuleMessage message = null;
        try
        {
            message = result.getMessage(1000);
        }
        catch (TimeoutException e)
        {
            fail("Response timeout not honored.");
        }
View Full Code Here

TOP

Related Classes of org.mule.api.FutureMessageResult

Copyright © 2018 www.massapicom. 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.