Package org.apache.servicemix.nmr.api

Examples of org.apache.servicemix.nmr.api.Channel.createExchange()


        final Map<String, Object> props = ServiceHelper.createMap(Endpoint.NAME, "blocking");
        nmr.getEndpointRegistry().register(blocking, props);

        final CountDownLatch done = new CountDownLatch(1);
        final Channel channel = nmr.createChannel();
        final Exchange exchange = channel.createExchange(Pattern.InOnly);
        exchange.setTarget(nmr.getEndpointRegistry().lookup(props));
       
        Thread thread = new Thread(new Runnable() {
            public void run() {
                channel.sendSync(exchange);
View Full Code Here


        nmr = smx;
    }

    protected void sendExchange(Object content) {
        Channel client = nmr.createChannel();
        Exchange exchange = client.createExchange(Pattern.InOnly);
        exchange.setTarget(client.getNMR().getEndpointRegistry().lookup(
                ServiceHelper.createMap(Endpoint.NAME, RECEIVER_ENDPOINT_NAME)));
        exchange.setProperty("prop1", "value1");
        exchange.getIn().setBody(content);
        exchange.getIn().setHeader("prop1", "value2");
View Full Code Here

    public void process(Exchange exchange) throws Exception {
     
      NMR nmr = getEndpoint().getComponent().getNmr();
      Channel client = nmr.createChannel();
     
        org.apache.servicemix.nmr.api.Exchange e = client.createExchange(
            Pattern.fromWsdlUri(exchange.getPattern().getWsdlUri()));
       
        try {
          e.setTarget(nmr.getEndpointRegistry().lookup(
            ServiceHelper.createMap(org.apache.servicemix.nmr.api.Endpoint.NAME,
View Full Code Here

        Thread.sleep(5000);
        NMR nmr = getOsgiService(NMR.class);
        assertNotNull(nmr);
       
        Channel client = nmr.createChannel();
        Exchange e = client.createExchange(Pattern.InOut);
        for (Endpoint ep : nmr.getEndpointRegistry().getServices()) {
            e.setTarget(nmr.getEndpointRegistry().lookup(nmr.getEndpointRegistry().getProperties(ep)));
            e.getIn().setBody(new StringSource("<?xml version=\"1.0\" encoding=\"UTF-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Body><ns2:sayHi xmlns:ns2=\"http://cxf.examples.servicemix.apache.org/\"><arg0>Bonjour</arg0></ns2:sayHi></soap:Body></soap:Envelope>"));
            boolean res = client.sendSync(e);
            assertTrue(res);
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.