Package org.apache.servicemix.nmr.api

Examples of org.apache.servicemix.nmr.api.Channel


    }

    public void testInOnlyJmsTxRbInError() throws Exception {
        createRoute(Transacted.Jms, true, false, true);

        Channel client = nmr1.createChannel();
        Exchange exchange = client.createExchange(Pattern.InOnly);
        exchange.getIn().setBody(new StringSource("<hello/>"));
        exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME, PROXY_ENDPOINT_NAME)));
        client.sendSync(exchange);
        assertEquals(Status.Done, exchange.getStatus());
        client.close();
        receiver.assertExchangesReceived(2, TIMEOUT);
    }
View Full Code Here


    }

    public void testInOnlyXaTxNoRb() throws Exception {
        createRoute(Transacted.Xa, false, false, false);

        Channel client = nmr1.createChannel();
        Exchange exchange = client.createExchange(Pattern.InOnly);
        exchange.getIn().setBody(new StringSource("<hello/>"));
        exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME, PROXY_ENDPOINT_NAME)));
        client.sendSync(exchange);
        assertEquals(Status.Done, exchange.getStatus());
        client.close();
        receiver.assertExchangesReceived(1, TIMEOUT);
    }
View Full Code Here

    }

    public void testInOnlyXaTxNoRbInError() throws Exception {
        createRoute(Transacted.Xa, false, false, true);

        Channel client = nmr1.createChannel();
        Exchange exchange = client.createExchange(Pattern.InOnly);
        exchange.getIn().setBody(new StringSource("<hello/>"));
        exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME, PROXY_ENDPOINT_NAME)));
        client.sendSync(exchange);
        assertEquals(Status.Error, exchange.getStatus());
        client.close();
        receiver.assertExchangesReceived(1, TIMEOUT);
    }
View Full Code Here

    }

    public void testInOnlyXaTxRb() throws Exception {
        createRoute(Transacted.Xa, true, false, false);

        Channel client = nmr1.createChannel();
        Exchange exchange = client.createExchange(Pattern.InOnly);
        exchange.getIn().setBody(new StringSource("<hello/>"));
        exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME, PROXY_ENDPOINT_NAME)));
        client.sendSync(exchange);
        assertEquals(Status.Done, exchange.getStatus());
        client.close();
        receiver.assertExchangesReceived(1, TIMEOUT);
    }
View Full Code Here

    }

    public void testInOnlyXaTxRbInError() throws Exception {
        createRoute(Transacted.Xa, true, false, true);

        Channel client = nmr1.createChannel();
        Exchange exchange = client.createExchange(Pattern.InOnly);
        exchange.getIn().setBody(new StringSource("<hello/>"));
        exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME, PROXY_ENDPOINT_NAME)));
        client.sendSync(exchange);
        assertEquals(Status.Done, exchange.getStatus());
        client.close();
        receiver.assertExchangesReceived(2, TIMEOUT);
    }
View Full Code Here

    }

    public void testInOnlyAckTxNoRb() throws Exception {
        createRoute(Transacted.ClientAck, false, false, false);

        Channel client = nmr1.createChannel();
        Exchange exchange = client.createExchange(Pattern.InOnly);
        exchange.getIn().setBody(new StringSource("<hello/>"));
        exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME, PROXY_ENDPOINT_NAME)));
        client.sendSync(exchange);
        assertEquals(Status.Done, exchange.getStatus());
        client.close();
        receiver.assertExchangesReceived(1, TIMEOUT);
    }
View Full Code Here

    }

    public void testInOnlyAckTxNoRbInError() throws Exception {
        createRoute(Transacted.ClientAck, false, false, true);

        Channel client = nmr1.createChannel();
        Exchange exchange = client.createExchange(Pattern.InOnly);
        exchange.getIn().setBody(new StringSource("<hello/>"));
        exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME, PROXY_ENDPOINT_NAME)));
        client.sendSync(exchange);
        assertEquals(Status.Error, exchange.getStatus());
        client.close();
        receiver.assertExchangesReceived(1, TIMEOUT);
    }
View Full Code Here

    }

    public void testInOnlyAckTxRb() throws Exception {
        createRoute(Transacted.ClientAck, true, false, false);

        Channel client = nmr1.createChannel();
        Exchange exchange = client.createExchange(Pattern.InOnly);
        exchange.getIn().setBody(new StringSource("<hello/>"));
        exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME, PROXY_ENDPOINT_NAME)));
        client.sendSync(exchange);
        assertEquals(Status.Done, exchange.getStatus());
        client.close();
        receiver.assertExchangesReceived(1, TIMEOUT);
    }
View Full Code Here

    }

    public void testInOnlyAckTxRbInError() throws Exception {
        createRoute(Transacted.ClientAck, true, false, true);

        Channel client = nmr1.createChannel();
        Exchange exchange = client.createExchange(Pattern.InOnly);
        exchange.getIn().setBody(new StringSource("<hello/>"));
        exchange.setTarget(nmr1.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME, PROXY_ENDPOINT_NAME)));
        client.sendSync(exchange);
        assertEquals(Status.Done, exchange.getStatus());
        client.close();
        receiver.assertExchangesReceived(2, TIMEOUT);
    }
View Full Code Here

        InternalExchange ie = (InternalExchange) ((MessageExchangeImpl) exchange).getInternalExchange();
        return getChannelToUse(ie).sendSync(ie, timeout);
    }

    protected Channel getChannelToUse(InternalExchange exchange) {
        Channel channelToUse = channel;
        if (exchange.getSource() == null) {
            // We need to look up the channel corresponding to the sender endpoint
            try {
                String sender = (String) exchange.getProperty(SENDER_ENDPOINT);
                if (sender != null) {
View Full Code Here

TOP

Related Classes of org.apache.servicemix.nmr.api.Channel

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.