Package org.apache.servicemix.client

Examples of org.apache.servicemix.client.DefaultServiceMixClient.send()


            component.getServiceUnitManager().start("su1");

            // Send message
            InOut inout = client.createInOutExchange();
            inout.setService(new QName("http://servicemix.apache.org/demo/", "chained"));
            client.send(inout);

            // Stop and undeploy
            component.getServiceUnitManager().stop("su1");
            component.getServiceUnitManager().shutDown("su1");
            component.getServiceUnitManager().undeploy("su1", path.getAbsolutePath());
View Full Code Here


            // Send message
            inout = client.createInOutExchange();
            inout.setService(new QName("http://servicemix.apache.org/demo/", "chained"));
            try {
                client.send(inout);
            } catch (MessagingException e) {
                // Ok, the lw component is undeployed
            }

        }
View Full Code Here

       
        ServiceMixClient client = new DefaultServiceMixClient(jbiContainer);
        InOnly exchange = client.createInOnlyExchange();
        exchange.setService(new QName("urn:test", "in-only"));
        exchange.getInMessage().setContent(new StringSource(MESSAGE));
        client.send(exchange);
       
        done.assertIsSatisfied();
    }

    @Override
View Full Code Here

                // Send message
                exchange = createExchange(client);
                try {
                    configureExchange(client, exchange);
                    client.send(exchange);
                    fail("Should have failed to send to a no longer deployed component");
                } catch (Throwable e) {
                    LOG.debug(
                            "Caught expected exception as the component is undeployed: "
                                    + e, e);
View Full Code Here

        for (int i = 0; i < nbMsgs; i++) {
            InOnly me = client.createInOnlyExchange();
            me.setService(new QName("http://test", "entryPoint"));
            me.getInMessage().setContent(new StringSource(
                    "<test xmlns=\"http://test\"><echo/><world/><earth/></test>"));
            client.send(me);
        }
        Thread.sleep(2000);
        for (int i = 0; i < nbMsgs; i++) {
            client.receive();
        }
View Full Code Here

            component.getServiceUnitManager().start("su1");

            // Send message
            InOut inout = client.createInOutExchange();
            inout.setService(new QName("http://servicemix.apache.org/demo/", "chained"));
            client.send(inout);

            // Stop and undeploy
            component.getServiceUnitManager().stop("su1");
            component.getServiceUnitManager().shutDown("su1");
            component.getServiceUnitManager().undeploy("su1", path.getAbsolutePath());
View Full Code Here

            // Send message
            inout = client.createInOutExchange();
            inout.setService(new QName("http://servicemix.apache.org/demo/", "chained"));
            try {
                client.send(inout);
            } catch (MessagingException e) {
                // Ok, the lw component is undeployed
            }

        }
View Full Code Here

        for (int i = 0; i < 10; i++) {
            InOut inOut = client.createInOutExchange(service, null, null);
            NormalizedMessage inMessage = inOut.createMessage();
            inMessage.setContent(new StringSource("<test id='" + i + "'/>"));
            inOut.setInMessage(inMessage);
            client.send(inOut);
            inOut = (InOut) client.receive(1000);
            assertNotNull(inOut.getOutMessage());
            client.done(inOut);
        }
    }
View Full Code Here

        assertNull(client.getContext().getEndpointDescriptor(endpoints[0]));
        ServiceEndpoint se = client.getContext().resolveEndpointReference(endpoints[0].getAsReference(null));
        assertNull(client.getContext().getEndpointDescriptor(se));
        InOnly me = client.createInOnlyExchange();
        me.setEndpoint(se);
        client.send(me);
        receiver.getMessageList().assertMessagesReceived(1);
    }
   
    public static class TestExternalEndpoint implements ServiceEndpoint {
        private QName service;
View Full Code Here

        assertNull(client.getContext().getEndpointDescriptor(endpoints[0]));
        ServiceEndpoint se = client.getContext().resolveEndpointReference(endpoints[0].getAsReference(null));
        assertNull(client.getContext().getEndpointDescriptor(se));
        InOnly me = client.createInOnlyExchange();
        me.setEndpoint(se);
        client.send(me);
        receiver.getMessageList().assertMessagesReceived(1);
    }
   
    public static class TestExternalEndpoint implements ServiceEndpoint {
        private QName service;
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.