Package org.apache.camel

Examples of org.apache.camel.Endpoint.createProducer()


    public void testUsingTimeoutParameter() throws Exception {

        // use a timeout value of 2 seconds (timeout is in millis) so we should actually get a response in this test
        Endpoint endpoint = this.context.getEndpoint("mina:tcp://localhost:" + PORT + "?textline=true&sync=true&timeout=2000");
        Producer producer = endpoint.createProducer();
        producer.start();
        Exchange exchange = producer.createExchange();
        exchange.getIn().setBody("Hello World");
        try {
            producer.process(exchange);
View Full Code Here


        Endpoint endpoint = container.getEndpoint("direct:a");
        Exchange exchange = endpoint.createExchange();
        if (header != null) {
            exchange.getIn().setHeader("foo", header);
        }
        Producer producer = endpoint.createProducer();
        producer.process(exchange);

        log.debug("Interceptor invocation order:" + order);
        assertEquals(expected, order);
    }
View Full Code Here

        // test that we can pool and store as a local file
        Endpoint endpoint = context.getEndpoint(ftpUrl);
        Exchange exchange = endpoint.createExchange();
        exchange.getIn().setBody("Hello World from FTPServer");
        exchange.getIn().setHeader(FileComponent.HEADER_FILE_NAME, "hello.txt");
        Producer producer = endpoint.createProducer();
        producer.start();
        producer.process(exchange);
        producer.stop();
    }
View Full Code Here

        // set the input on the in body
        // must you correct type to match the expected type of an Integer object
        exchange.getIn().setBody(11);

        // to send the exchange we need an producer to do it for us
        Producer producer = endpoint.createProducer();
        // start the producer so it can operate
        producer.start();

        // let the producer process the exchange where it does all the work in this one line of code
        producer.process(exchange);
View Full Code Here

    @Test(expected = ResolveEndpointFailedException.class)
    public void failConnectingToNonExistingRepository() throws Exception {
        Endpoint endpoint = context.getEndpoint("cmis://" + CMIS_ENDPOINT_TEST_SERVER
                + "?username=admin&password=admin&repositoryId=NON_EXISTING_ID");
        Producer producer = endpoint.createProducer();

        Exchange exchange = createExchangeWithInBody("Some content to be store");
        exchange.getIn().getHeaders().put(PropertyIds.NAME, "test.txt");
        producer.process(exchange);
    }
View Full Code Here

    }

    @Test
    public void queryServerForDocumentWithSpecificName() throws Exception {
        Endpoint endpoint = context.getEndpoint("cmis://" + CMIS_ENDPOINT_TEST_SERVER + "?queryMode=true");
        Producer producer = endpoint.createProducer();

        Exchange exchange = createExchangeWithInBody(
                "SELECT * FROM cmis:document WHERE cmis:name = 'test1.txt'");
        producer.process(exchange);

View Full Code Here

    }

    @Test
    public void getResultCountFromHeader() throws Exception {
        Endpoint endpoint = context.getEndpoint("cmis://" + CMIS_ENDPOINT_TEST_SERVER + "?queryMode=true");
        Producer producer = endpoint.createProducer();

        Exchange exchange = createExchangeWithInBody(
                "SELECT * FROM cmis:document WHERE CONTAINS('Camel test content.')");
        producer.process(exchange);

View Full Code Here

    }

    @Test
    public void limitNumberOfResultsWithReadSizeHeader() throws Exception {
        Endpoint endpoint = context.getEndpoint("cmis://" + CMIS_ENDPOINT_TEST_SERVER + "?queryMode=true");
        Producer producer = endpoint.createProducer();

        Exchange exchange = createExchangeWithInBody(
                "SELECT * FROM cmis:document WHERE CONTAINS('Camel test content.')");
        exchange.getIn().getHeaders().put("CamelCMISReadSize", 1);

View Full Code Here

    }

    @Test
    public void retrieveAlsoDocumentContent() throws Exception {
        Endpoint endpoint = context.getEndpoint("cmis://" + CMIS_ENDPOINT_TEST_SERVER + "?queryMode=true");
        Producer producer = endpoint.createProducer();

        Exchange exchange = createExchangeWithInBody(
                "SELECT * FROM cmis:document WHERE cmis:name='test1.txt'");
        exchange.getIn().getHeaders().put("CamelCMISRetrieveContent", true);

View Full Code Here

                    throw new NoSuchEndpointException(uri);
                }

                Producer producer;
                try {
                    producer = endpoint.createProducer();
                    producer.start();
                    producer.process(exchange);
                    producer.stop();
                } catch (Exception e) {
                    throw ObjectHelper.wrapRuntimeCamelException(e);
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.