You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2017/01/12 12:16:11 UTC

[1/7] camel git commit: CAMEL-10375: Move camel-couchbase from extra to ASF

Repository: camel
Updated Branches:
  refs/heads/master ab530bfe7 -> 9d4a1ec96


http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseComponentTest.java
----------------------------------------------------------------------
diff --git a/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseComponentTest.java b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseComponentTest.java
new file mode 100644
index 0000000..cd3850a
--- /dev/null
+++ b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseComponentTest.java
@@ -0,0 +1,179 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.couchbase;
+
+import java.net.URI;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Endpoint;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+
+@RunWith(MockitoJUnitRunner.class)
+public class CouchbaseComponentTest {
+
+    @Mock
+    private CamelContext context;
+
+    @Test
+    public void testEndpointCreated() throws Exception {
+        Map<String, Object> params = new HashMap<String, Object>();
+
+        String uri = "couchbase:http://localhost:9191/bucket";
+        String remaining = "http://localhost:9191/bucket";
+
+        Endpoint endpoint = new CouchbaseComponent(context).createEndpoint(uri, remaining, params);
+        assertNotNull(endpoint);
+    }
+
+    @Test
+    public void testPropertiesSet() throws Exception {
+        Map<String, Object> params = new HashMap<String, Object>();
+        params.put("username", "ugol");
+        params.put("password", "pwd");
+        params.put("additionalHosts", "127.0.0.1,example.com,another-host");
+        params.put("persistTo", 2);
+        params.put("replicateTo", 3);
+
+        String uri = "couchdb:http://localhost:91234/bucket";
+        String remaining = "http://localhost:91234/bucket";
+
+        CouchbaseEndpoint endpoint = new CouchbaseComponent(context).createEndpoint(uri, remaining, params);
+
+        assertEquals("http", endpoint.getProtocol());
+        assertEquals("localhost", endpoint.getHostname());
+        assertEquals("bucket", endpoint.getBucket());
+        assertEquals(91234, endpoint.getPort());
+        assertEquals("ugol", endpoint.getUsername());
+        assertEquals("pwd", endpoint.getPassword());
+        assertEquals("127.0.0.1,example.com,another-host", endpoint.getAdditionalHosts());
+        assertEquals(2, endpoint.getPersistTo());
+        assertEquals(3, endpoint.getReplicateTo());
+    }
+
+    @Test
+    public void testCouchbaseURI() throws Exception {
+
+        Map<String, Object> params = new HashMap<String, Object>();
+        String uri = "couchbase:http://localhost/bucket?param=true";
+        String remaining = "http://localhost/bucket?param=true";
+
+        CouchbaseEndpoint endpoint = new CouchbaseComponent(context).createEndpoint(uri, remaining, params);
+        assertEquals(new URI("http://localhost:8091/pools"), endpoint.makeBootstrapURI()[0]);
+
+    }
+
+    @Test
+    public void testCouchbaseAdditionalHosts() throws Exception {
+
+        Map<String, Object> params = new HashMap<String, Object>();
+        params.put("additionalHosts", "127.0.0.1,example.com,another-host");
+        String uri = "couchbase:http://localhost/bucket?param=true";
+        String remaining = "http://localhost/bucket?param=true";
+
+        CouchbaseEndpoint endpoint = new CouchbaseComponent(context).createEndpoint(uri, remaining, params);
+
+        // System.out.print(endpoint.makeBootstrapURI()[0].toString() + " " +
+        // endpoint.makeBootstrapURI().length + " ");
+        URI[] endpointArray = endpoint.makeBootstrapURI();
+        assertEquals(new URI("http://localhost:8091/pools"), endpointArray[0]);
+        assertEquals(new URI("http://127.0.0.1:8091/pools"), endpointArray[1]);
+        assertEquals(new URI("http://example.com:8091/pools"), endpointArray[2]);
+        assertEquals(new URI("http://another-host:8091/pools"), endpointArray[3]);
+        assertEquals(4, endpointArray.length);
+
+    }
+
+    @Test
+    public void testCouchbaseAdditionalHostsWithSpaces() throws Exception {
+
+        Map<String, Object> params = new HashMap<String, Object>();
+        params.put("additionalHosts", " 127.0.0.1, example.com, another-host ");
+        String uri = "couchbase:http://localhost/bucket?param=true";
+        String remaining = "http://localhost/bucket?param=true";
+
+        CouchbaseEndpoint endpoint = new CouchbaseComponent(context).createEndpoint(uri, remaining, params);
+
+        // System.out.print(endpoint.makeBootstrapURI()[0].toString() + " " +
+        // endpoint.makeBootstrapURI().length + " ");
+        URI[] endpointArray = endpoint.makeBootstrapURI();
+        assertEquals(new URI("http://localhost:8091/pools"), endpointArray[0]);
+        assertEquals(new URI("http://127.0.0.1:8091/pools"), endpointArray[1]);
+        assertEquals(new URI("http://example.com:8091/pools"), endpointArray[2]);
+        assertEquals(new URI("http://another-host:8091/pools"), endpointArray[3]);
+        assertEquals(4, endpointArray.length);
+
+    }
+
+    @Test
+    public void testCouchbaseDuplicateAdditionalHosts() throws Exception {
+
+        Map<String, Object> params = new HashMap<String, Object>();
+        params.put("additionalHosts", "127.0.0.1,localhost, localhost");
+        String uri = "couchbase:http://localhost/bucket?param=true";
+        String remaining = "http://localhost/bucket?param=true";
+
+        CouchbaseEndpoint endpoint = new CouchbaseComponent(context).createEndpoint(uri, remaining, params);
+        URI[] endpointArray = endpoint.makeBootstrapURI();
+        assertEquals(2, endpointArray.length);
+        assertEquals(new URI("http://localhost:8091/pools"), endpointArray[0]);
+        assertEquals(new URI("http://127.0.0.1:8091/pools"), endpointArray[1]);
+
+    }
+
+    @Test
+    public void testCouchbaseNullAdditionalHosts() throws Exception {
+
+        Map<String, Object> params = new HashMap<String, Object>();
+        params.put("additionalHosts", null);
+        String uri = "couchbase:http://localhost/bucket?param=true";
+        String remaining = "http://localhost/bucket?param=true";
+
+        CouchbaseEndpoint endpoint = new CouchbaseComponent(context).createEndpoint(uri, remaining, params);
+
+        // System.out.print(endpoint.makeBootstrapURI()[0].toString() + " " +
+        // endpoint.makeBootstrapURI().length + " ");
+        URI[] endpointArray = endpoint.makeBootstrapURI();
+
+        assertEquals(1, endpointArray.length);
+
+    }
+
+    @Test
+    public void testCouchbasePersistToAndReplicateToParameters() throws Exception {
+
+        Map<String, Object> params = new HashMap<String, Object>();
+        params.put("persistTo", "1");
+        params.put("replicateTo", "2");
+        String uri = "couchbase:http://localhost/bucket?param=true";
+        String remaining = "http://localhost/bucket?param=true";
+
+        CouchbaseEndpoint endpoint = new CouchbaseComponent(context).createEndpoint(uri, remaining, params);
+
+        assertEquals(1, endpoint.getPersistTo());
+        assertEquals(2, endpoint.getReplicateTo());
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseConsumerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseConsumerTest.java b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseConsumerTest.java
new file mode 100644
index 0000000..3a52077
--- /dev/null
+++ b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseConsumerTest.java
@@ -0,0 +1,41 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.couchbase;
+
+
+import java.net.URI;
+import java.util.ArrayList;
+
+import com.couchbase.client.CouchbaseClient;
+import com.couchbase.client.vbucket.ConfigurationException;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.junit.Test;
+
+public class CouchbaseConsumerTest {
+
+    @Test(expected = ConfigurationException.class)
+    public void testNewCouchbaseConsumer() throws Exception {
+        CouchbaseConsumer couchbaseConsumer = new CouchbaseConsumer(new CouchbaseEndpoint(), new CouchbaseClient(new ArrayList<URI>(), "bucketName", "pwd"), new Processor() {
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                // Nothing to do
+            }
+        });
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseEndpointTest.java
----------------------------------------------------------------------
diff --git a/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseEndpointTest.java b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseEndpointTest.java
new file mode 100644
index 0000000..722b797
--- /dev/null
+++ b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseEndpointTest.java
@@ -0,0 +1,162 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.couchbase;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.junit.Test;
+
+import static org.apache.camel.component.couchbase.CouchbaseConstants.DEFAULT_COUCHBASE_PORT;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+
+public class CouchbaseEndpointTest {
+
+    @Test
+    public void assertSingleton() throws Exception {
+        CouchbaseEndpoint endpoint = new CouchbaseEndpoint("couchbase:http://localhost/bucket", "http://localhost/bucket", new CouchbaseComponent());
+        assertTrue(endpoint.isSingleton());
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testBucketRequired() throws Exception {
+        new CouchbaseEndpoint("couchbase:http://localhost:80", "http://localhost:80", new CouchbaseComponent());
+    }
+
+    @Test
+    public void testDefaultPortIsSet() throws Exception {
+        CouchbaseEndpoint endpoint = new CouchbaseEndpoint("couchbase:http://localhost/bucket", "http://localhost/bucket", new CouchbaseComponent());
+        assertEquals(DEFAULT_COUCHBASE_PORT, endpoint.getPort());
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testHostnameRequired() throws Exception {
+        new CouchbaseEndpoint("couchbase:http://:80/bucket", "couchbase://:80/bucket", new CouchbaseComponent());
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testSchemeRequired() throws Exception {
+        new CouchbaseEndpoint("couchbase:localhost:80/bucket", "localhost:80/bucket", new CouchbaseComponent());
+    }
+
+    @Test
+    public void testCouchbaseEndpoint() {
+        new CouchbaseEndpoint();
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testCouchbaseEndpointWithoutProtocol() throws Exception {
+        new CouchbaseEndpoint("localhost:80/bucket", "localhost:80/bucket", new CouchbaseComponent());
+    }
+
+    @Test
+    public void testCouchbaseEndpointUri() {
+        new CouchbaseEndpoint("couchbase:localhost:80/bucket", new CouchbaseComponent());
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testCouchbaseEndpointCreateProducer() throws Exception {
+        new CouchbaseEndpoint("couchbase:localhost:80/bucket", new CouchbaseComponent()).createProducer();
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testCouchbaseEndpointCreateConsumer() throws Exception {
+        new CouchbaseEndpoint("couchbase:localhost:80/bucket", new CouchbaseComponent()).createConsumer(new Processor() {
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                // Nothing to do
+            }
+        });
+    }
+
+    @Test
+    public void testCouchbaseEndpontSettersAndGetters() {
+        CouchbaseEndpoint endpoint = new CouchbaseEndpoint();
+
+        endpoint.setProtocol("couchbase");
+        assertTrue(endpoint.getProtocol().equals("couchbase"));
+
+        endpoint.setBucket("bucket");
+        assertTrue(endpoint.getBucket().equals("bucket"));
+
+        endpoint.setHostname("localhost");
+        assertTrue(endpoint.getHostname().equals("localhost"));
+
+        endpoint.setPort(80);
+        assertTrue(endpoint.getPort() == 80);
+
+        endpoint.setOperation("PUT");
+        assertTrue(endpoint.getOperation().equals("PUT"));
+
+        endpoint.setStartingIdForInsertsFrom(1L);
+        assertTrue(endpoint.getStartingIdForInsertsFrom() == 1L);
+
+        endpoint.setProducerRetryAttempts(5);
+        assertTrue(endpoint.getProducerRetryAttempts() == 5);
+
+        endpoint.setProducerRetryPause(1);
+        assertTrue(endpoint.getProducerRetryPause() == 1);
+
+        endpoint.setDesignDocumentName("beer");
+        assertTrue(endpoint.getDesignDocumentName().equals("beer"));
+
+        endpoint.setViewName("brewery_beers");
+        assertTrue(endpoint.getViewName().equals("brewery_beers"));
+
+        endpoint.setLimit(1);
+        assertTrue(endpoint.getLimit() == 1);
+
+        endpoint.setSkip(1);
+        assertTrue(endpoint.getSkip() == 1);
+
+        endpoint.setRangeStartKey("");
+        assertTrue(endpoint.getRangeStartKey().equals(""));
+
+        endpoint.setRangeEndKey("");
+        assertTrue(endpoint.getRangeEndKey().equals(""));
+
+        endpoint.setConsumerProcessedStrategy("delete");
+        assertTrue(endpoint.getConsumerProcessedStrategy().equals("delete"));
+
+        endpoint.setOpTimeOut(1L);
+        assertTrue(endpoint.getOpTimeOut() == 1L);
+
+        endpoint.setTimeoutExceptionThreshold(1);
+        assertTrue(endpoint.getTimeoutExceptionThreshold() == 1);
+
+        endpoint.setReadBufferSize(1);
+        assertTrue(endpoint.getReadBufferSize() == 1);
+
+        endpoint.setShouldOptimize(true);
+        assertTrue(endpoint.isShouldOptimize());
+
+        endpoint.setMaxReconnectDelay(1L);
+        assertTrue(endpoint.getMaxReconnectDelay() == 1L);
+
+        endpoint.setOpQueueMaxBlockTime(1L);
+        assertTrue(endpoint.getOpQueueMaxBlockTime() == 1L);
+
+        endpoint.setObsPollInterval(1L);
+        assertTrue(endpoint.getObsPollInterval() == 1L);
+
+        endpoint.setObsTimeout(1L);
+        assertTrue(endpoint.getObsTimeout() == 1L);
+
+        endpoint.setDescending(false);
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseProducerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseProducerTest.java b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseProducerTest.java
new file mode 100644
index 0000000..a2230fb
--- /dev/null
+++ b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/CouchbaseProducerTest.java
@@ -0,0 +1,231 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.couchbase;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.couchbase.client.CouchbaseClient;
+
+import net.spy.memcached.PersistTo;
+import net.spy.memcached.ReplicateTo;
+import net.spy.memcached.internal.OperationFuture;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.InvalidPayloadException;
+import org.apache.camel.Message;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+
+import static org.apache.camel.component.couchbase.CouchbaseConstants.HEADER_TTL;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.mockito.MockitoAnnotations.initMocks;
+
+public class CouchbaseProducerTest {
+
+    @Mock
+    private CouchbaseClient client;
+
+    @Mock
+    private CouchbaseEndpoint endpoint;
+
+    @Mock
+    private Exchange exchange;
+
+    @Mock
+    private Message msg;
+
+    @Mock
+    private OperationFuture response;
+
+    private CouchbaseProducer producer;
+
+    @Before
+    public void before() throws Exception {
+        initMocks(this);
+        when(endpoint.getProducerRetryAttempts()).thenReturn(CouchbaseConstants.DEFAULT_PRODUCER_RETRIES);
+        producer = new CouchbaseProducer(endpoint, client, 0, 0);
+        when(exchange.getIn()).thenReturn(msg);
+    }
+
+    @SuppressWarnings("unchecked")
+    @Test(expected = CouchbaseException.class)
+    public void testBodyMandatory() throws Exception {
+        when(msg.getMandatoryBody()).thenThrow(InvalidPayloadException.class);
+        producer.process(exchange);
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testPersistToLowerThanSupported() throws Exception {
+        producer = new CouchbaseProducer(endpoint, client, -1, 0);
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testPersistToHigherThanSupported() throws Exception {
+        producer = new CouchbaseProducer(endpoint, client, 5, 0);
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testReplicateToLowerThanSupported() throws Exception {
+        producer = new CouchbaseProducer(endpoint, client, 0, -1);
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testReplicateToHigherThanSupported() throws Exception {
+        producer = new CouchbaseProducer(endpoint, client, 0, 4);
+    }
+
+    @Test
+    public void testMaximumValuesForPersistToAndRepicateTo() throws Exception {
+        try {
+            producer = new CouchbaseProducer(endpoint, client, 4, 3);
+        } catch (IllegalArgumentException e) {
+            Assert.fail("Exception was thrown while testing maximum values for persistTo and replicateTo parameters " + e.getMessage());
+        }
+    }
+
+    @Test
+    public void testExpiryTimeIsSet() throws Exception {
+        OperationFuture of = mock(OperationFuture.class);
+        when(of.get()).thenAnswer(new Answer<Object>() {
+            @Override
+            public Object answer(InvocationOnMock invocation) throws Exception {
+                return true;
+
+            }
+        });
+
+        when(client.set(org.mockito.Matchers.anyString(), org.mockito.Matchers.anyInt(), org.mockito.Matchers.anyObject(), org.mockito.Matchers.any(PersistTo.class),
+                        org.mockito.Matchers.any(ReplicateTo.class))).thenReturn(of);
+        // Mock out some headers so we can set an expiry
+        int expiry = 5000;
+        Map<String, Object> testHeaders = new HashMap<String, Object>();
+        testHeaders.put("CCB_TTL", Integer.toString(expiry));
+        when(msg.getHeaders()).thenReturn(testHeaders);
+        when(msg.getHeader(HEADER_TTL, String.class)).thenReturn(Integer.toString(expiry));
+
+        when(endpoint.getId()).thenReturn("123");
+        when(endpoint.getOperation()).thenReturn("CCB_PUT");
+        Message outmsg = mock(Message.class);
+        when(exchange.getOut()).thenReturn(msg);
+
+        producer.process(exchange);
+
+        verify(client).set(org.mockito.Matchers.anyString(), Mockito.eq(expiry), org.mockito.Matchers.anyObject(), org.mockito.Matchers.any(PersistTo.class),
+                           org.mockito.Matchers.any(ReplicateTo.class));
+
+    }
+
+    @Test
+    public void testTimeOutRetryToException() throws Exception {
+
+        OperationFuture of = mock(OperationFuture.class);
+        when(of.get()).thenAnswer(new Answer<Object>() {
+            @Override
+            public Object answer(InvocationOnMock invocation) throws Exception {
+                throw new RuntimeException("Timed out waiting for operation");
+
+            }
+        });
+
+        when(client.set(org.mockito.Matchers.anyString(), org.mockito.Matchers.anyInt(), org.mockito.Matchers.anyObject(), org.mockito.Matchers.any(PersistTo.class),
+                        org.mockito.Matchers.any(ReplicateTo.class))).thenReturn(of);
+        when(endpoint.getId()).thenReturn("123");
+        when(endpoint.getOperation()).thenReturn("CCB_PUT");
+        try {
+            producer.process(exchange);
+        } catch (Exception e) {
+            // do nothing
+            verify(of, times(3)).get();
+        }
+
+    }
+
+    @Test
+    public void testTimeOutRetryThenSuccess() throws Exception {
+
+        OperationFuture of = mock(OperationFuture.class);
+        when(of.get()).thenAnswer(new Answer<Object>() {
+            @Override
+            public Object answer(InvocationOnMock invocation) throws Exception {
+                throw new RuntimeException("Timed out waiting for operation");
+
+            }
+        }).thenAnswer(new Answer<Object>() {
+            @Override
+            public Object answer(InvocationOnMock invocation) throws Exception {
+                return true;
+
+            }
+        });
+
+        when(client.set(org.mockito.Matchers.anyString(), org.mockito.Matchers.anyInt(), org.mockito.Matchers.anyObject(), org.mockito.Matchers.any(PersistTo.class),
+                        org.mockito.Matchers.any(ReplicateTo.class))).thenReturn(of);
+        when(endpoint.getId()).thenReturn("123");
+        when(endpoint.getOperation()).thenReturn("CCB_PUT");
+        when(exchange.getOut()).thenReturn(msg);
+
+        producer.process(exchange);
+
+        verify(of, times(2)).get();
+        verify(msg).setBody(true);
+    }
+
+    @Test
+    public void testTimeOutRetryTwiceThenSuccess() throws Exception {
+
+        OperationFuture of = mock(OperationFuture.class);
+        when(of.get()).thenAnswer(new Answer<Object>() {
+            @Override
+            public Object answer(InvocationOnMock invocation) throws Exception {
+                throw new RuntimeException("Timed out waiting for operation");
+
+            }
+        }).thenAnswer(new Answer<Object>() {
+            @Override
+            public Object answer(InvocationOnMock invocation) throws Exception {
+                throw new RuntimeException("Timed out waiting for operation");
+
+            }
+        }).thenAnswer(new Answer<Object>() {
+            @Override
+            public Object answer(InvocationOnMock invocation) throws Exception {
+                return true;
+
+            }
+        });
+
+        when(client.set(org.mockito.Matchers.anyString(), org.mockito.Matchers.anyInt(), org.mockito.Matchers.anyObject(), org.mockito.Matchers.any(PersistTo.class),
+                        org.mockito.Matchers.any(ReplicateTo.class))).thenReturn(of);
+        when(endpoint.getId()).thenReturn("123");
+        when(endpoint.getOperation()).thenReturn("CCB_PUT");
+        when(exchange.getOut()).thenReturn(msg);
+
+        producer.process(exchange);
+
+        verify(of, times(3)).get();
+        verify(msg).setBody(true);
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/ProduceMessagesSimpleTest.java
----------------------------------------------------------------------
diff --git a/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/ProduceMessagesSimpleTest.java b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/ProduceMessagesSimpleTest.java
new file mode 100644
index 0000000..cc2d5a9
--- /dev/null
+++ b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/ProduceMessagesSimpleTest.java
@@ -0,0 +1,51 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.couchbase;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class ProduceMessagesSimpleTest extends CamelTestSupport {
+
+    // Ignore test since build environment does not have any couchbase instance
+    @Ignore
+    @Test
+    public void testInsert() throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedMessageCount(1);
+
+        template.sendBody("direct:start", "ugol");
+        assertMockEndpointsSatisfied();
+
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+
+                // need couchbase installed on localhost
+                from("direct:start").setHeader(CouchbaseConstants.HEADER_ID, constant("120770")).to("couchbase:http://localhost/default").to("mock:result");
+
+            }
+        };
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/ProduceMessagesWithAutoIDIntegrationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/ProduceMessagesWithAutoIDIntegrationTest.java b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/ProduceMessagesWithAutoIDIntegrationTest.java
new file mode 100644
index 0000000..1da92f7
--- /dev/null
+++ b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/ProduceMessagesWithAutoIDIntegrationTest.java
@@ -0,0 +1,49 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.couchbase;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+public class ProduceMessagesWithAutoIDIntegrationTest extends CamelTestSupport {
+
+    @Test
+    public void testInsert() throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedMessageCount(2);
+
+        template.sendBody("direct:start", "ugol1");
+        template.sendBody("direct:start", "ugol2");
+
+        assertMockEndpointsSatisfied();
+
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+
+                // need couchbase installed on localhost
+                from("direct:start").to("couchbase:http://localhost/default?autoStartIdForInserts=true&startingIdForInsertsFrom=1000").to("mock:result");
+            }
+        };
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/RemoveMessagesIntegrationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/RemoveMessagesIntegrationTest.java b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/RemoveMessagesIntegrationTest.java
new file mode 100644
index 0000000..0ac050d
--- /dev/null
+++ b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/RemoveMessagesIntegrationTest.java
@@ -0,0 +1,49 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.couchbase;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+public class RemoveMessagesIntegrationTest extends CamelTestSupport {
+
+    @Test
+    public void testInsert() throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedMessageCount(2);
+
+        template.sendBody("direct:start", "ugol1");
+        template.sendBody("direct:start", "ugol2");
+
+        assertMockEndpointsSatisfied();
+
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+
+                // need couchbase installed on localhost
+                from("direct:start").setHeader(CouchbaseConstants.HEADER_ID, constant("120770")).to("couchbase:http://localhost/default?operation='DELETE'").to("mock:result");
+            }
+        };
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components/camel-couchbase/src/test/resources/log4j2.properties
----------------------------------------------------------------------
diff --git a/components/camel-couchbase/src/test/resources/log4j2.properties b/components/camel-couchbase/src/test/resources/log4j2.properties
new file mode 100644
index 0000000..1388037
--- /dev/null
+++ b/components/camel-couchbase/src/test/resources/log4j2.properties
@@ -0,0 +1,30 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+appender.file.type = File
+appender.file.name = file
+appender.file.fileName = target/camel-couchbase-test.log
+appender.file.layout.type = PatternLayout
+appender.file.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
+appender.out.type = Console
+appender.out.name = out
+appender.out.layout.type = PatternLayout
+appender.out.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
+logger.kubernetes.name = org.apache.camel.component.couchbase
+logger.kubernetes.level = DEBUG
+rootLogger.level = INFO
+rootLogger.appenderRef.file.ref = file

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components/pom.xml
----------------------------------------------------------------------
diff --git a/components/pom.xml b/components/pom.xml
index 9852969..def06f5 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -94,6 +94,7 @@
     <module>camel-cometd</module>
     <module>camel-consul</module>
     <module>camel-context</module>
+    <module>camel-couchbase</module>
     <module>camel-couchdb</module>
     <module>camel-crypto</module>
     <module>camel-csv</module>

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index f3e813f..d92df30 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -914,6 +914,11 @@
       </dependency>
       <dependency>
         <groupId>org.apache.camel</groupId>
+        <artifactId>camel-couchbase</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.camel</groupId>
         <artifactId>camel-couchdb</artifactId>
         <version>${project.version}</version>
       </dependency>
@@ -2217,6 +2222,11 @@
       </dependency>
       <dependency>
         <groupId>org.apache.camel</groupId>
+        <artifactId>camel-couchbase-starter</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.camel</groupId>
         <artifactId>camel-couchdb-starter</artifactId>
         <version>${project.version}</version>
       </dependency>


[6/7] camel git commit: CAMEL-10375: Added camel-couchbase Karaf feature and related test

Posted by ac...@apache.org.
CAMEL-10375: Added camel-couchbase Karaf feature and related test


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f9e6a4a1
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f9e6a4a1
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f9e6a4a1

Branch: refs/heads/master
Commit: f9e6a4a18095a8fbf9f97778cd7641720deac246
Parents: d6b1944
Author: Andrea Cosentino <an...@gmail.com>
Authored: Thu Jan 12 13:09:26 2017 +0100
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu Jan 12 13:14:46 2017 +0100

----------------------------------------------------------------------
 .../features/src/main/resources/features.xml    |  6 ++++
 .../camel/itest/karaf/CamelCouchbaseTest.java   | 33 ++++++++++++++++++++
 2 files changed, 39 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/f9e6a4a1/platforms/karaf/features/src/main/resources/features.xml
----------------------------------------------------------------------
diff --git a/platforms/karaf/features/src/main/resources/features.xml b/platforms/karaf/features/src/main/resources/features.xml
index 25b7119..df0dc44 100644
--- a/platforms/karaf/features/src/main/resources/features.xml
+++ b/platforms/karaf/features/src/main/resources/features.xml
@@ -399,6 +399,12 @@
     <bundle dependency='true'>mvn:javax.servlet/javax.servlet-api/${javax.servlet-api-version}</bundle>
     <bundle>mvn:org.apache.camel/camel-couchdb/${project.version}</bundle>
   </feature>
+  <feature name='camel-couchbase' version='${project.version}' resolver='(obr)' start-level='50'>
+    <feature version='${project.version}'>camel-core</feature>
+    <bundle dependency='true'>wrap:mvn:net.spy/spymemcached/${spymemcached-version}</bundle>
+    <bundle dependency='true'>wrap:mvn:com.couchbase.client/couchbase-client/1.4.12</bundle>
+    <bundle>mvn:org.apache.camel/camel-couchbase/${project.version}</bundle>
+  </feature>
   <feature name='camel-crypto' version='${project.version}' resolver='(obr)' start-level='50'>
     <feature version='${project.version}'>camel-core</feature>
     <bundle dependency='true'>mvn:commons-codec/commons-codec/${commons-codec-version}</bundle>

http://git-wip-us.apache.org/repos/asf/camel/blob/f9e6a4a1/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelCouchbaseTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelCouchbaseTest.java b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelCouchbaseTest.java
new file mode 100644
index 0000000..03898a1
--- /dev/null
+++ b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelCouchbaseTest.java
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.itest.karaf;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.junit.PaxExam;
+
+@RunWith(PaxExam.class)
+public class CamelCouchbaseTest extends BaseKarafTest {
+
+    public static final String COMPONENT = extractName(CamelCouchbaseTest.class);
+
+    @Test
+    public void test() throws Exception {
+        testComponent(COMPONENT);
+    }
+
+}
\ No newline at end of file


[2/7] camel git commit: CAMEL-10375: Move camel-couchbase from extra to ASF

Posted by ac...@apache.org.
CAMEL-10375: Move camel-couchbase from extra to ASF


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/0f1f14fa
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0f1f14fa
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0f1f14fa

Branch: refs/heads/master
Commit: 0f1f14fa972fd739a4db8614ff9a63361f9c0cb3
Parents: ab530bf
Author: Andrea Cosentino <an...@gmail.com>
Authored: Thu Jan 12 11:42:51 2017 +0100
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu Jan 12 13:14:45 2017 +0100

----------------------------------------------------------------------
 apache-camel/pom.xml                            |   9 +
 .../src/main/descriptors/common-bin.xml         |   2 +
 .../camel-couchbase-starter/pom.xml             |  51 ++
 .../CouchbaseComponentAutoConfiguration.java    |  80 +++
 .../src/main/resources/META-INF/LICENSE.txt     | 203 +++++++
 .../src/main/resources/META-INF/NOTICE.txt      |  11 +
 ...dditional-spring-configuration-metadata.json |  10 +
 .../main/resources/META-INF/spring.factories    |  19 +
 .../src/main/resources/META-INF/spring.provides |  18 +
 components-starter/pom.xml                      |   1 +
 components/camel-couchbase/pom.xml              |  77 +++
 .../component/couchbase/CouchbaseComponent.java |  44 ++
 .../component/couchbase/CouchbaseConstants.java |  50 ++
 .../component/couchbase/CouchbaseConsumer.java  | 155 +++++
 .../component/couchbase/CouchbaseEndpoint.java  | 590 +++++++++++++++++++
 .../component/couchbase/CouchbaseException.java |  37 ++
 .../component/couchbase/CouchbaseProducer.java  | 160 +++++
 .../src/main/resources/META-INF/LICENSE.txt     | 203 +++++++
 .../src/main/resources/META-INF/NOTICE.txt      |  11 +
 .../org/apache/camel/component/couchbase        |  19 +
 ...umeBeerMessagesWithLimitIntegrationTest.java |  48 ++
 .../couchbase/CouchbaseComponentTest.java       | 179 ++++++
 .../couchbase/CouchbaseConsumerTest.java        |  41 ++
 .../couchbase/CouchbaseEndpointTest.java        | 162 +++++
 .../couchbase/CouchbaseProducerTest.java        | 231 ++++++++
 .../couchbase/ProduceMessagesSimpleTest.java    |  51 ++
 ...roduceMessagesWithAutoIDIntegrationTest.java |  49 ++
 .../RemoveMessagesIntegrationTest.java          |  49 ++
 .../src/test/resources/log4j2.properties        |  30 +
 components/pom.xml                              |   1 +
 parent/pom.xml                                  |  10 +
 31 files changed, 2601 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/apache-camel/pom.xml
----------------------------------------------------------------------
diff --git a/apache-camel/pom.xml b/apache-camel/pom.xml
index 835a2f0..86d1559 100644
--- a/apache-camel/pom.xml
+++ b/apache-camel/pom.xml
@@ -191,6 +191,10 @@
     </dependency>
     <dependency>
       <groupId>org.apache.camel</groupId>
+      <artifactId>camel-couchbase</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
       <artifactId>camel-couchdb</artifactId>
     </dependency>
     <dependency>
@@ -1202,6 +1206,11 @@
     </dependency>
     <dependency>
       <groupId>org.apache.camel</groupId>
+      <artifactId>camel-couchbase-starter</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
       <artifactId>camel-crypto-starter</artifactId>
       <version>${project.version}</version>
     </dependency>

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/apache-camel/src/main/descriptors/common-bin.xml
----------------------------------------------------------------------
diff --git a/apache-camel/src/main/descriptors/common-bin.xml b/apache-camel/src/main/descriptors/common-bin.xml
index e9dd576..5e1c25d 100644
--- a/apache-camel/src/main/descriptors/common-bin.xml
+++ b/apache-camel/src/main/descriptors/common-bin.xml
@@ -59,6 +59,7 @@
         <include>org.apache.camel:camel-consul</include>
         <include>org.apache.camel:camel-context</include>
         <include>org.apache.camel:camel-couchdb</include>
+        <include>org.apache.camel:camel-couchbase</include>
         <include>org.apache.camel:camel-crypto</include>
         <include>org.apache.camel:camel-csv</include>
         <include>org.apache.camel:camel-cxf</include>
@@ -329,6 +330,7 @@
         <include>org.apache.camel:camel-core-starter</include>
         <include>org.apache.camel:camel-core-xml-starter</include>
         <include>org.apache.camel:camel-couchdb-starter</include>
+        <include>org.apache.camel:camel-couchbase-starter</include>
         <include>org.apache.camel:camel-crypto-starter</include>
         <include>org.apache.camel:camel-csv-starter</include>
         <include>org.apache.camel:camel-cxf-starter</include>

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components-starter/camel-couchbase-starter/pom.xml
----------------------------------------------------------------------
diff --git a/components-starter/camel-couchbase-starter/pom.xml b/components-starter/camel-couchbase-starter/pom.xml
new file mode 100644
index 0000000..d4a53f2
--- /dev/null
+++ b/components-starter/camel-couchbase-starter/pom.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.camel</groupId>
+    <artifactId>components-starter</artifactId>
+    <version>2.19.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>camel-couchbase-starter</artifactId>
+  <packaging>jar</packaging>
+  <name>Spring-Boot Starter :: Camel Extra :: Couchbase</name>
+  <description>Spring-Boot Starter for Camel Couchbase component</description>
+  <dependencies>
+    <dependency>
+      <groupId>org.springframework.boot</groupId>
+      <artifactId>spring-boot-starter</artifactId>
+      <version>${spring-boot-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-couchbase</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <!--START OF GENERATED CODE-->
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-core-starter</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-spring-boot-starter</artifactId>
+    </dependency>
+    <!--END OF GENERATED CODE-->
+  </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components-starter/camel-couchbase-starter/src/main/java/org/apache/camel/component/couchbase/springboot/CouchbaseComponentAutoConfiguration.java
----------------------------------------------------------------------
diff --git a/components-starter/camel-couchbase-starter/src/main/java/org/apache/camel/component/couchbase/springboot/CouchbaseComponentAutoConfiguration.java b/components-starter/camel-couchbase-starter/src/main/java/org/apache/camel/component/couchbase/springboot/CouchbaseComponentAutoConfiguration.java
new file mode 100644
index 0000000..e9bdd3b
--- /dev/null
+++ b/components-starter/camel-couchbase-starter/src/main/java/org/apache/camel/component/couchbase/springboot/CouchbaseComponentAutoConfiguration.java
@@ -0,0 +1,80 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.couchbase.springboot;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.couchbase.CouchbaseComponent;
+import org.springframework.boot.autoconfigure.AutoConfigureAfter;
+import org.springframework.boot.autoconfigure.condition.ConditionMessage;
+import org.springframework.boot.autoconfigure.condition.ConditionOutcome;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.autoconfigure.condition.SpringBootCondition;
+import org.springframework.boot.bind.RelaxedPropertyResolver;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ConditionContext;
+import org.springframework.context.annotation.Conditional;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.core.type.AnnotatedTypeMetadata;
+
+/**
+ * Generated by camel-package-maven-plugin - do not edit this file!
+ */
+@Configuration
+@ConditionalOnBean(type = "org.apache.camel.spring.boot.CamelAutoConfiguration")
+@Conditional(CouchbaseComponentAutoConfiguration.Condition.class)
+@AutoConfigureAfter(name = "org.apache.camel.spring.boot.CamelAutoConfiguration")
+public class CouchbaseComponentAutoConfiguration {
+
+    @Lazy
+    @Bean(name = "couchbase-component")
+    @ConditionalOnClass(CamelContext.class)
+    @ConditionalOnMissingBean(CouchbaseComponent.class)
+    public CouchbaseComponent configureCouchbaseComponent(
+            CamelContext camelContext) throws Exception {
+        CouchbaseComponent component = new CouchbaseComponent();
+        component.setCamelContext(camelContext);
+        return component;
+    }
+
+    public static class Condition extends SpringBootCondition {
+        @Override
+        public ConditionOutcome getMatchOutcome(
+                ConditionContext conditionContext,
+                AnnotatedTypeMetadata annotatedTypeMetadata) {
+            boolean groupEnabled = isEnabled(conditionContext,
+                    "camel.component.", true);
+            ConditionMessage.Builder message = ConditionMessage
+                    .forCondition("camel.component.couchbase");
+            if (isEnabled(conditionContext, "camel.component.couchbase.",
+                    groupEnabled)) {
+                return ConditionOutcome.match(message.because("enabled"));
+            }
+            return ConditionOutcome.noMatch(message.because("not enabled"));
+        }
+
+        private boolean isEnabled(
+                org.springframework.context.annotation.ConditionContext context,
+                java.lang.String prefix, boolean defaultValue) {
+            RelaxedPropertyResolver resolver = new RelaxedPropertyResolver(
+                    context.getEnvironment(), prefix);
+            return resolver.getProperty("enabled", Boolean.class, defaultValue);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components-starter/camel-couchbase-starter/src/main/resources/META-INF/LICENSE.txt
----------------------------------------------------------------------
diff --git a/components-starter/camel-couchbase-starter/src/main/resources/META-INF/LICENSE.txt b/components-starter/camel-couchbase-starter/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000..6b0b127
--- /dev/null
+++ b/components-starter/camel-couchbase-starter/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,203 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components-starter/camel-couchbase-starter/src/main/resources/META-INF/NOTICE.txt
----------------------------------------------------------------------
diff --git a/components-starter/camel-couchbase-starter/src/main/resources/META-INF/NOTICE.txt b/components-starter/camel-couchbase-starter/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 0000000..2e215bf
--- /dev/null
+++ b/components-starter/camel-couchbase-starter/src/main/resources/META-INF/NOTICE.txt
@@ -0,0 +1,11 @@
+   =========================================================================
+   ==  NOTICE file corresponding to the section 4 d of                    ==
+   ==  the Apache License, Version 2.0,                                   ==
+   ==  in this case for the Apache Camel distribution.                    ==
+   =========================================================================
+
+   This product includes software developed by
+   The Apache Software Foundation (http://www.apache.org/).
+
+   Please read the different LICENSE files present in the licenses directory of
+   this distribution.

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components-starter/camel-couchbase-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json
----------------------------------------------------------------------
diff --git a/components-starter/camel-couchbase-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/components-starter/camel-couchbase-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json
new file mode 100644
index 0000000..86842db
--- /dev/null
+++ b/components-starter/camel-couchbase-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json
@@ -0,0 +1,10 @@
+{
+  "properties": [
+    {
+      "defaultValue": true,
+      "name": "camel.component.couchbase.enabled",
+      "description": "Enable couchbase component",
+      "type": "java.lang.Boolean"
+    }
+  ]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components-starter/camel-couchbase-starter/src/main/resources/META-INF/spring.factories
----------------------------------------------------------------------
diff --git a/components-starter/camel-couchbase-starter/src/main/resources/META-INF/spring.factories b/components-starter/camel-couchbase-starter/src/main/resources/META-INF/spring.factories
new file mode 100644
index 0000000..65be58b
--- /dev/null
+++ b/components-starter/camel-couchbase-starter/src/main/resources/META-INF/spring.factories
@@ -0,0 +1,19 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
+org.apache.camel.component.couchbase.springboot.CouchbaseComponentAutoConfiguration

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components-starter/camel-couchbase-starter/src/main/resources/META-INF/spring.provides
----------------------------------------------------------------------
diff --git a/components-starter/camel-couchbase-starter/src/main/resources/META-INF/spring.provides b/components-starter/camel-couchbase-starter/src/main/resources/META-INF/spring.provides
new file mode 100644
index 0000000..cfe55a0
--- /dev/null
+++ b/components-starter/camel-couchbase-starter/src/main/resources/META-INF/spring.provides
@@ -0,0 +1,18 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+provides: camel-couchbase
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components-starter/pom.xml
----------------------------------------------------------------------
diff --git a/components-starter/pom.xml b/components-starter/pom.xml
index 8af07b8..87f05e3 100644
--- a/components-starter/pom.xml
+++ b/components-starter/pom.xml
@@ -107,6 +107,7 @@
     <module>camel-context-starter</module>
     <module>camel-core-starter</module>
     <module>camel-core-xml-starter</module>
+    <module>camel-couchbase-starter</module>
     <module>camel-couchdb-starter</module>
     <module>camel-crypto-starter</module>
     <module>camel-csv-starter</module>

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components/camel-couchbase/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-couchbase/pom.xml b/components/camel-couchbase/pom.xml
new file mode 100644
index 0000000..5996cd4
--- /dev/null
+++ b/components/camel-couchbase/pom.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    https://camel-extra.github.io
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public License
+    as published by the Free Software Foundation; either version 3
+    of the License, or (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU Lesser General Public License for more details.
+
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+    02110-1301, USA.
+
+    http://www.gnu.org/licenses/lgpl-3.0-standalone.html
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.camel</groupId>
+    <artifactId>components</artifactId>
+    <version>2.19.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>camel-couchbase</artifactId>
+  <packaging>jar</packaging>
+  <name>Camel :: Couchbase</name>
+  <description>Camel Couchbase component</description>
+
+  <properties>
+    <camel.osgi.export.pkg>org.apache.camel.component.couchbase</camel.osgi.export.pkg>
+    <camel.osgi.export.service>org.apache.camel.spi.ComponentResolver;component=couchbase
+    </camel.osgi.export.service>
+  </properties>
+
+  <dependencies>
+
+    <dependency>
+      <groupId>com.couchbase.client</groupId>
+      <artifactId>couchbase-client</artifactId>
+      <version>1.4.12</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-core</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>camel-test</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+  </dependencies>
+
+
+</project>

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseComponent.java b/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseComponent.java
new file mode 100644
index 0000000..74f02c1
--- /dev/null
+++ b/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseComponent.java
@@ -0,0 +1,44 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.couchbase;
+
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.impl.DefaultComponent;
+
+/**
+ * Couchbase component.
+ */
+
+public class CouchbaseComponent extends DefaultComponent {
+
+    public CouchbaseComponent() {
+
+    }
+
+    public CouchbaseComponent(CamelContext context) {
+        super(context);
+    }
+
+    @Override
+    protected CouchbaseEndpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
+        CouchbaseEndpoint endpoint = new CouchbaseEndpoint(uri, remaining, this);
+        setProperties(endpoint, parameters);
+        return endpoint;
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseConstants.java
----------------------------------------------------------------------
diff --git a/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseConstants.java b/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseConstants.java
new file mode 100644
index 0000000..8831fe8
--- /dev/null
+++ b/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseConstants.java
@@ -0,0 +1,50 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.couchbase;
+
+/**
+ * Couchbase Constants and default connection parameters
+ */
+
+public interface CouchbaseConstants {
+
+    String COUCHBASE_URI_ERROR = "Invalid URI. Format must be of the form couchbase:http[s]://hostname[:port]/bucket?[options...]";
+    String COUCHBASE_PUT = "CCB_PUT";
+    String COUCHBASE_GET = "CCB_GET";
+    String COUCHBASE_DELETE = "CCB_DEL";
+    String DEFAULT_DESIGN_DOCUMENT_NAME = "beer";
+    String DEFAULT_VIEWNAME = "brewery_beers";
+    String HEADER_KEY = "CCB_KEY";
+    String HEADER_ID = "CCB_ID";
+    String HEADER_TTL = "CCB_TTL";
+    String HEADER_DESIGN_DOCUMENT_NAME = "CCB_DDN";
+    String HEADER_VIEWNAME = "CCB_VN";
+
+    int DEFAULT_PRODUCER_RETRIES = 2;
+    int DEFAULT_PAUSE_BETWEEN_RETRIES = 5000;
+    int DEFAULT_COUCHBASE_PORT = 8091;
+    int DEFAULT_TTL = 0;
+    long DEFAULT_OP_TIMEOUT = 2500;
+    int DEFAULT_TIMEOUT_EXCEPTION_THRESHOLD = 998;
+    int DEFAULT_READ_BUFFER_SIZE = 16384;
+    long DEFAULT_OP_QUEUE_MAX_BLOCK_TIME = 10000;
+    long DEFAULT_MAX_RECONNECT_DELAY = 30000;
+    long DEFAULT_OBS_POLL_INTERVAL = 400;
+    long DEFAULT_OBS_TIMEOUT = -1;
+    String DEFAULT_CONSUME_PROCESSED_STRATEGY = "none";
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseConsumer.java b/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseConsumer.java
new file mode 100644
index 0000000..e9b307e
--- /dev/null
+++ b/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseConsumer.java
@@ -0,0 +1,155 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.couchbase;
+
+import com.couchbase.client.CouchbaseClient;
+import com.couchbase.client.protocol.views.Query;
+import com.couchbase.client.protocol.views.View;
+import com.couchbase.client.protocol.views.ViewResponse;
+import com.couchbase.client.protocol.views.ViewRow;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.impl.DefaultScheduledPollConsumer;
+
+import static org.apache.camel.component.couchbase.CouchbaseConstants.HEADER_DESIGN_DOCUMENT_NAME;
+import static org.apache.camel.component.couchbase.CouchbaseConstants.HEADER_ID;
+import static org.apache.camel.component.couchbase.CouchbaseConstants.HEADER_KEY;
+import static org.apache.camel.component.couchbase.CouchbaseConstants.HEADER_VIEWNAME;
+
+public class CouchbaseConsumer extends DefaultScheduledPollConsumer {
+
+    private final CouchbaseEndpoint endpoint;
+    private final CouchbaseClient client;
+    private final View view;
+    private final Query query;
+
+    public CouchbaseConsumer(CouchbaseEndpoint endpoint, CouchbaseClient client, Processor processor) {
+
+        super(endpoint, processor);
+        this.client = client;
+        this.endpoint = endpoint;
+        this.view = client.getView(endpoint.getDesignDocumentName(), endpoint.getViewName());
+        this.query = new Query();
+        init();
+
+    }
+
+    private void init() {
+
+        query.setIncludeDocs(true);
+
+        int limit = endpoint.getLimit();
+        if (limit > 0) {
+            query.setLimit(limit);
+        }
+
+        int skip = endpoint.getSkip();
+        if (skip > 0) {
+            query.setSkip(skip);
+        }
+
+        query.setDescending(endpoint.isDescending());
+
+        String rangeStartKey = endpoint.getRangeStartKey();
+        String rangeEndKey = endpoint.getRangeEndKey();
+        if ("".equals(rangeStartKey) || "".equals(rangeEndKey)) {
+            return;
+        }
+        query.setRange(rangeStartKey, rangeEndKey);
+
+    }
+
+    @Override
+    protected void doStart() throws Exception {
+        log.info("Starting Couchbase consumer");
+        super.doStart();
+    }
+
+    @Override
+    protected void doStop() throws Exception {
+        log.info("Stopping Couchbase consumer");
+        super.doStop();
+    }
+
+    @Override
+    protected synchronized int poll() throws Exception {
+        ViewResponse result = client.query(view, query);
+        log.info("Received result set from Couchbase");
+
+        if (log.isTraceEnabled()) {
+            log.trace("ViewResponse = {}", result);
+        }
+
+        String consumerProcessedStrategy = endpoint.getConsumerProcessedStrategy();
+
+        for (ViewRow row : result) {
+
+            String id = row.getId();
+            Object doc = row.getDocument();
+
+            String key = row.getKey();
+            String designDocumentName = endpoint.getDesignDocumentName();
+            String viewName = endpoint.getViewName();
+
+            Exchange exchange = endpoint.createExchange();
+            exchange.getIn().setBody(doc);
+            exchange.getIn().setHeader(HEADER_ID, id);
+            exchange.getIn().setHeader(HEADER_KEY, key);
+            exchange.getIn().setHeader(HEADER_DESIGN_DOCUMENT_NAME, designDocumentName);
+            exchange.getIn().setHeader(HEADER_VIEWNAME, viewName);
+
+            if ("delete".equalsIgnoreCase(consumerProcessedStrategy)) {
+                if (log.isTraceEnabled()) {
+                    log.trace("Deleting doc with ID {}", id);
+                }
+                client.delete(id);
+            } else if ("filter".equalsIgnoreCase(consumerProcessedStrategy)) {
+                if (log.isTraceEnabled()) {
+                    log.trace("Filtering out ID {}", id);
+                }
+                // add filter for already processed docs
+            } else {
+                log.trace("No strategy set for already processed docs, beware of duplicates!");
+            }
+
+            logDetails(id, doc, key, designDocumentName, viewName, exchange);
+
+            try {
+                this.getProcessor().process(exchange);
+            } catch (Exception e) {
+                this.getExceptionHandler().handleException("Error processing exchange.", exchange, e);
+            }
+        }
+
+        return result.size();
+    }
+
+    private void logDetails(String id, Object doc, String key, String designDocumentName, String viewName, Exchange exchange) {
+
+        if (log.isTraceEnabled()) {
+            log.trace("Created exchange = {}", exchange);
+            log.trace("Added Document in body = {}", doc);
+            log.trace("Adding to Header");
+            log.trace("ID = {}", id);
+            log.trace("Key = {}", key);
+            log.trace("Design Document Name = {}", designDocumentName);
+            log.trace("View Name = {}", viewName);
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseEndpoint.java b/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseEndpoint.java
new file mode 100644
index 0000000..46c8d29
--- /dev/null
+++ b/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseEndpoint.java
@@ -0,0 +1,590 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.couchbase;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
+import com.couchbase.client.CouchbaseClient;
+import com.couchbase.client.CouchbaseConnectionFactoryBuilder;
+
+import org.apache.camel.Consumer;
+import org.apache.camel.Processor;
+import org.apache.camel.Producer;
+import org.apache.camel.impl.ScheduledPollEndpoint;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriPath;
+
+import static org.apache.camel.component.couchbase.CouchbaseConstants.COUCHBASE_PUT;
+import static org.apache.camel.component.couchbase.CouchbaseConstants.COUCHBASE_URI_ERROR;
+import static org.apache.camel.component.couchbase.CouchbaseConstants.DEFAULT_CONSUME_PROCESSED_STRATEGY;
+import static org.apache.camel.component.couchbase.CouchbaseConstants.DEFAULT_COUCHBASE_PORT;
+import static org.apache.camel.component.couchbase.CouchbaseConstants.DEFAULT_DESIGN_DOCUMENT_NAME;
+import static org.apache.camel.component.couchbase.CouchbaseConstants.DEFAULT_MAX_RECONNECT_DELAY;
+import static org.apache.camel.component.couchbase.CouchbaseConstants.DEFAULT_OBS_POLL_INTERVAL;
+import static org.apache.camel.component.couchbase.CouchbaseConstants.DEFAULT_OBS_TIMEOUT;
+import static org.apache.camel.component.couchbase.CouchbaseConstants.DEFAULT_OP_QUEUE_MAX_BLOCK_TIME;
+import static org.apache.camel.component.couchbase.CouchbaseConstants.DEFAULT_OP_TIMEOUT;
+import static org.apache.camel.component.couchbase.CouchbaseConstants.DEFAULT_PAUSE_BETWEEN_RETRIES;
+import static org.apache.camel.component.couchbase.CouchbaseConstants.DEFAULT_PRODUCER_RETRIES;
+import static org.apache.camel.component.couchbase.CouchbaseConstants.DEFAULT_READ_BUFFER_SIZE;
+import static org.apache.camel.component.couchbase.CouchbaseConstants.DEFAULT_TIMEOUT_EXCEPTION_THRESHOLD;
+import static org.apache.camel.component.couchbase.CouchbaseConstants.DEFAULT_VIEWNAME;
+
+/**
+ * Represents a Couchbase endpoint that can query Views with a Poll strategy
+ * and/or produce various type of operations.
+ */
+@UriEndpoint(scheme = "couchbase", title = "Couchbase", syntax = "couchbase:url", consumerClass = CouchbaseConsumer.class, label = "database,nosql")
+public class CouchbaseEndpoint extends ScheduledPollEndpoint {
+
+    @UriPath
+    private String protocol;
+    private String bucket;
+    private String hostname;
+    private int port;
+
+    // Couchbase key
+    @UriParam
+    private String key;
+
+    // Authentication
+    @UriParam
+    private String username = "";
+    @UriParam
+    private String password = "";
+
+    // Additional hosts
+    @UriParam
+    private String additionalHosts = "";
+
+    // Persistence and replication parameters
+    @UriParam
+    private int persistTo;
+
+    @UriParam
+    private int replicateTo;
+
+    // Producer parameters
+    @UriParam
+    private String operation = COUCHBASE_PUT;
+    @UriParam
+    private boolean autoStartIdForInserts;
+    @UriParam
+    private int producerRetryAttempts = DEFAULT_PRODUCER_RETRIES;
+    @UriParam
+    private int producerRetryPause = DEFAULT_PAUSE_BETWEEN_RETRIES;
+
+    @UriParam
+    private long startingIdForInsertsFrom;
+    // View control
+    @UriParam
+    private String designDocumentName = DEFAULT_DESIGN_DOCUMENT_NAME;
+    @UriParam
+    private String viewName = DEFAULT_VIEWNAME;
+    @UriParam
+    private int limit = -1;
+    @UriParam
+    private boolean descending;
+    @UriParam
+    private int skip = -1;
+    @UriParam
+    private String rangeStartKey = "";
+
+    @UriParam
+    private String rangeEndKey = "";
+
+    // Consumer strategy
+    @UriParam
+    private String consumerProcessedStrategy = DEFAULT_CONSUME_PROCESSED_STRATEGY;
+
+    // Connection fine tuning parameters
+    @UriParam
+    private long opTimeOut = DEFAULT_OP_TIMEOUT;
+    @UriParam
+    private int timeoutExceptionThreshold = DEFAULT_TIMEOUT_EXCEPTION_THRESHOLD;
+    @UriParam
+    private int readBufferSize = DEFAULT_READ_BUFFER_SIZE;
+    @UriParam
+    private boolean shouldOptimize;
+    @UriParam
+    private long maxReconnectDelay = DEFAULT_MAX_RECONNECT_DELAY;
+    @UriParam
+    private long opQueueMaxBlockTime = DEFAULT_OP_QUEUE_MAX_BLOCK_TIME;
+    @UriParam
+    private long obsPollInterval = DEFAULT_OBS_POLL_INTERVAL;
+    @UriParam
+    private long obsTimeout = DEFAULT_OBS_TIMEOUT;
+
+    public CouchbaseEndpoint() {
+    }
+
+    public CouchbaseEndpoint(String uri, String remaining, CouchbaseComponent component) throws URISyntaxException {
+        super(uri, component);
+        URI remainingUri = new URI(remaining);
+
+        protocol = remainingUri.getScheme();
+        if (protocol == null) {
+            throw new IllegalArgumentException(COUCHBASE_URI_ERROR);
+        }
+
+        port = remainingUri.getPort() == -1 ? DEFAULT_COUCHBASE_PORT : remainingUri.getPort();
+
+        if (remainingUri.getPath() == null || remainingUri.getPath().trim().length() == 0) {
+            throw new IllegalArgumentException(COUCHBASE_URI_ERROR);
+        }
+        bucket = remainingUri.getPath().substring(1);
+
+        hostname = remainingUri.getHost();
+        if (hostname == null) {
+            throw new IllegalArgumentException(COUCHBASE_URI_ERROR);
+        }
+    }
+
+    public CouchbaseEndpoint(String endpointUri, CouchbaseComponent component) {
+        super(endpointUri, component);
+    }
+
+    @Override
+    public Producer createProducer() throws Exception {
+        return new CouchbaseProducer(this, createClient(), persistTo, replicateTo);
+    }
+
+    @Override
+    public Consumer createConsumer(Processor processor) throws Exception {
+        return new CouchbaseConsumer(this, createClient(), processor);
+    }
+
+    @Override
+    public boolean isSingleton() {
+        return true;
+    }
+
+    public String getProtocol() {
+        return protocol;
+    }
+
+    /**
+     * The protocol to use
+     */
+    public void setProtocol(String protocol) {
+        this.protocol = protocol;
+    }
+
+    public String getBucket() {
+        return bucket;
+    }
+
+    /**
+     * The bucket to use
+     */
+    public void setBucket(String bucket) {
+        this.bucket = bucket;
+    }
+
+    public String getHostname() {
+        return hostname;
+    }
+
+    /**
+     * The hostname to use
+     */
+    public void setHostname(String hostname) {
+        this.hostname = hostname;
+    }
+
+    public int getPort() {
+        return port;
+    }
+
+    /**
+     * The port number to use
+     */
+    public void setPort(int port) {
+        this.port = port;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    /**
+     * The key to use
+     */
+    public void setKey(String key) {
+        this.key = key;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    /**
+     * The username to use
+     */
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    /**
+     * The password to use
+     */
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getAdditionalHosts() {
+        return additionalHosts;
+    }
+
+    /**
+     * The additional hosts
+     */
+    public void setAdditionalHosts(String additionalHosts) {
+        this.additionalHosts = additionalHosts;
+    }
+
+    public int getPersistTo() {
+        return persistTo;
+    }
+
+    /**
+     * Where to persist the data
+     */
+    public void setPersistTo(int persistTo) {
+        this.persistTo = persistTo;
+    }
+
+    public int getReplicateTo() {
+        return replicateTo;
+    }
+
+    /**
+     * Where to replicate the data
+     */
+    public void setReplicateTo(int replicateTo) {
+        this.replicateTo = replicateTo;
+    }
+
+    public String getOperation() {
+        return operation;
+    }
+
+    /**
+     * The operation to do
+     */
+    public void setOperation(String operation) {
+        this.operation = operation;
+    }
+
+    public boolean isAutoStartIdForInserts() {
+        return autoStartIdForInserts;
+    }
+
+    /**
+     * Define if we want an autostart Id when we are doing an insert operation
+     */
+    public void setAutoStartIdForInserts(boolean autoStartIdForInserts) {
+        this.autoStartIdForInserts = autoStartIdForInserts;
+    }
+
+    public long getStartingIdForInsertsFrom() {
+        return startingIdForInsertsFrom;
+    }
+
+    /**
+     * Define the starting Id where we are doing an insert operation
+     */
+    public void setStartingIdForInsertsFrom(long startingIdForInsertsFrom) {
+        this.startingIdForInsertsFrom = startingIdForInsertsFrom;
+    }
+
+    public int getProducerRetryAttempts() {
+        return producerRetryAttempts;
+    }
+
+    /**
+     * Define the number of retry attempts
+     */
+    public void setProducerRetryAttempts(int producerRetryAttempts) {
+        this.producerRetryAttempts = producerRetryAttempts;
+    }
+
+    public int getProducerRetryPause() {
+        return producerRetryPause;
+    }
+
+    /**
+     * Define the retry pause between different attempts
+     */
+    public void setProducerRetryPause(int producerRetryPause) {
+        this.producerRetryPause = producerRetryPause;
+    }
+
+    public String getDesignDocumentName() {
+        return designDocumentName;
+    }
+
+    /**
+     * The design document name to use
+     */
+    public void setDesignDocumentName(String designDocumentName) {
+        this.designDocumentName = designDocumentName;
+    }
+
+    public String getViewName() {
+        return viewName;
+    }
+
+    /**
+     * The view name to use
+     */
+    public void setViewName(String viewName) {
+        this.viewName = viewName;
+    }
+
+    public int getLimit() {
+        return limit;
+    }
+
+    /**
+     * The output limit to use
+     */
+    public void setLimit(int limit) {
+        this.limit = limit;
+    }
+
+    public boolean isDescending() {
+        return descending;
+    }
+
+    /**
+     * Define if this operation is descending or not
+     */
+    public void setDescending(boolean descending) {
+        this.descending = descending;
+    }
+
+    public int getSkip() {
+        return skip;
+    }
+
+    /**
+     * Define the skip to use
+     */
+    public void setSkip(int skip) {
+        this.skip = skip;
+    }
+
+    public String getRangeStartKey() {
+        return rangeStartKey;
+    }
+
+    /**
+     * Define a range for the start key
+     */
+    public void setRangeStartKey(String rangeStartKey) {
+        this.rangeStartKey = rangeStartKey;
+    }
+
+    public String getRangeEndKey() {
+        return rangeEndKey;
+    }
+
+    /**
+     * Define a range for the end key
+     */
+    public void setRangeEndKey(String rangeEndKey) {
+        this.rangeEndKey = rangeEndKey;
+    }
+
+    public String getConsumerProcessedStrategy() {
+        return consumerProcessedStrategy;
+    }
+
+    /**
+     * Define the consumer Processed strategy to use
+     */
+    public void setConsumerProcessedStrategy(String consumerProcessedStrategy) {
+        this.consumerProcessedStrategy = consumerProcessedStrategy;
+    }
+
+    public long getOpTimeOut() {
+        return opTimeOut;
+    }
+
+    /**
+     * Define the operation timeout
+     */
+    public void setOpTimeOut(long opTimeOut) {
+        this.opTimeOut = opTimeOut;
+    }
+
+    public int getTimeoutExceptionThreshold() {
+        return timeoutExceptionThreshold;
+    }
+
+    /**
+     * Define the threshold for throwing a timeout Exception
+     */
+    public void setTimeoutExceptionThreshold(int timeoutExceptionThreshold) {
+        this.timeoutExceptionThreshold = timeoutExceptionThreshold;
+    }
+
+    public int getReadBufferSize() {
+        return readBufferSize;
+    }
+
+    /**
+     * Define the buffer size
+     */
+    public void setReadBufferSize(int readBufferSize) {
+        this.readBufferSize = readBufferSize;
+    }
+
+    public boolean isShouldOptimize() {
+        return shouldOptimize;
+    }
+
+    /**
+     * Define if we want to use optimization or not where possible
+     */
+    public void setShouldOptimize(boolean shouldOptimize) {
+        this.shouldOptimize = shouldOptimize;
+    }
+
+    public long getMaxReconnectDelay() {
+        return maxReconnectDelay;
+    }
+
+    /**
+     * Define the max delay during a reconnection
+     */
+    public void setMaxReconnectDelay(long maxReconnectDelay) {
+        this.maxReconnectDelay = maxReconnectDelay;
+    }
+
+    public long getOpQueueMaxBlockTime() {
+        return opQueueMaxBlockTime;
+    }
+
+    /**
+     * Define the max time an operation can be in queue blocked
+     */
+    public void setOpQueueMaxBlockTime(long opQueueMaxBlockTime) {
+        this.opQueueMaxBlockTime = opQueueMaxBlockTime;
+    }
+
+    public long getObsPollInterval() {
+        return obsPollInterval;
+    }
+
+    /**
+     * Define the observation polling interval
+     */
+    public void setObsPollInterval(long obsPollInterval) {
+        this.obsPollInterval = obsPollInterval;
+    }
+
+    public long getObsTimeout() {
+        return obsTimeout;
+    }
+
+    /**
+     * Define the observation timeout
+     */
+    public void setObsTimeout(long obsTimeout) {
+        this.obsTimeout = obsTimeout;
+    }
+
+    public URI[] makeBootstrapURI() throws URISyntaxException {
+
+        if (additionalHosts == null || "".equals(additionalHosts)) {
+            return new URI[] {new URI(protocol + "://" + hostname + ":" + port + "/pools")};
+        }
+        return getAllUris();
+
+    }
+
+    private URI[] getAllUris() throws URISyntaxException {
+
+        String[] hosts = additionalHosts.split(",");
+
+        for (int i = 0; i < hosts.length; i++) {
+            hosts[i] = hosts[i].trim();
+        }
+
+        List<String> hostList = new ArrayList<String>();
+        hostList.add(hostname);
+        hostList.addAll(Arrays.asList(hosts));
+        Set<String> hostSet = new LinkedHashSet<String>(hostList);
+        hosts = hostSet.toArray(new String[hostSet.size()]);
+
+        URI[] uriArray = new URI[hosts.length];
+
+        for (int i = 0; i < hosts.length; i++) {
+            uriArray[i] = new URI(protocol + "://" + hosts[i] + ":" + port + "/pools");
+        }
+
+        return uriArray;
+    }
+
+    private CouchbaseClient createClient() throws IOException, URISyntaxException {
+        List<URI> hosts = Arrays.asList(makeBootstrapURI());
+
+        CouchbaseConnectionFactoryBuilder cfb = new CouchbaseConnectionFactoryBuilder();
+
+        if (opTimeOut != DEFAULT_OP_TIMEOUT) {
+            cfb.setOpTimeout(opTimeOut);
+        }
+        if (timeoutExceptionThreshold != DEFAULT_TIMEOUT_EXCEPTION_THRESHOLD) {
+            cfb.setTimeoutExceptionThreshold(timeoutExceptionThreshold);
+        }
+        if (readBufferSize != DEFAULT_READ_BUFFER_SIZE) {
+            cfb.setReadBufferSize(readBufferSize);
+        }
+        if (shouldOptimize) {
+            cfb.setShouldOptimize(true);
+        }
+        if (maxReconnectDelay != DEFAULT_MAX_RECONNECT_DELAY) {
+            cfb.setMaxReconnectDelay(maxReconnectDelay);
+        }
+        if (opQueueMaxBlockTime != DEFAULT_OP_QUEUE_MAX_BLOCK_TIME) {
+            cfb.setOpQueueMaxBlockTime(opQueueMaxBlockTime);
+        }
+        if (obsPollInterval != DEFAULT_OBS_POLL_INTERVAL) {
+            cfb.setObsPollInterval(obsPollInterval);
+        }
+        if (obsTimeout != DEFAULT_OBS_TIMEOUT) {
+            cfb.setObsTimeout(obsTimeout);
+        }
+
+        return new CouchbaseClient(cfb.buildCouchbaseConnection(hosts, bucket, username, password));
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseException.java
----------------------------------------------------------------------
diff --git a/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseException.java b/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseException.java
new file mode 100644
index 0000000..d9d81c0
--- /dev/null
+++ b/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseException.java
@@ -0,0 +1,37 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.couchbase;
+
+import org.apache.camel.CamelExchangeException;
+import org.apache.camel.Exchange;
+
+/**
+ * Couchbase exception.
+ */
+
+public class CouchbaseException extends CamelExchangeException {
+
+    private static final long serialVersionUID = 1L;
+
+    public CouchbaseException(String message, Exchange exchange) {
+        super(message, exchange);
+    }
+
+    public CouchbaseException(String message, Exchange exchange, Throwable cause) {
+        super(message, exchange, cause);
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseProducer.java b/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseProducer.java
new file mode 100644
index 0000000..bccc244
--- /dev/null
+++ b/components/camel-couchbase/src/main/java/org/apache/camel/component/couchbase/CouchbaseProducer.java
@@ -0,0 +1,160 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.couchbase;
+
+import java.util.Map;
+import java.util.concurrent.Future;
+
+import com.couchbase.client.CouchbaseClientIF;
+
+import net.spy.memcached.PersistTo;
+import net.spy.memcached.ReplicateTo;
+import net.spy.memcached.internal.OperationFuture;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.impl.DefaultProducer;
+
+import static org.apache.camel.component.couchbase.CouchbaseConstants.COUCHBASE_DELETE;
+import static org.apache.camel.component.couchbase.CouchbaseConstants.COUCHBASE_GET;
+import static org.apache.camel.component.couchbase.CouchbaseConstants.COUCHBASE_PUT;
+import static org.apache.camel.component.couchbase.CouchbaseConstants.DEFAULT_TTL;
+import static org.apache.camel.component.couchbase.CouchbaseConstants.HEADER_ID;
+import static org.apache.camel.component.couchbase.CouchbaseConstants.HEADER_TTL;
+
+/**
+ * Couchbase producer generates various type of operations. PUT, GET, and DELETE
+ * are currently supported
+ */
+
+public class CouchbaseProducer extends DefaultProducer {
+
+    private CouchbaseEndpoint endpoint;
+    private CouchbaseClientIF client;
+    private long startId;
+    private PersistTo persistTo;
+    private ReplicateTo replicateTo;
+    private int producerRetryAttempts;
+    private int producerRetryPause;
+
+    public CouchbaseProducer(CouchbaseEndpoint endpoint, CouchbaseClientIF client, int persistTo, int replicateTo) throws Exception {
+        super(endpoint);
+        this.endpoint = endpoint;
+        this.client = client;
+        if (endpoint.isAutoStartIdForInserts()) {
+            this.startId = endpoint.getStartingIdForInsertsFrom();
+        }
+        this.producerRetryAttempts = endpoint.getProducerRetryAttempts();
+        this.producerRetryPause = endpoint.getProducerRetryPause();
+
+        switch (persistTo) {
+        case 0:
+            this.persistTo = PersistTo.ZERO;
+            break;
+        case 1:
+            this.persistTo = PersistTo.MASTER;
+            break;
+        case 2:
+            this.persistTo = PersistTo.TWO;
+            break;
+        case 3:
+            this.persistTo = PersistTo.THREE;
+            break;
+        case 4:
+            this.persistTo = PersistTo.FOUR;
+            break;
+        default:
+            throw new IllegalArgumentException("Unsupported persistTo parameter. Supported values are 0 to 4. Currently provided: " + persistTo);
+        }
+
+        switch (replicateTo) {
+        case 0:
+            this.replicateTo = ReplicateTo.ZERO;
+            break;
+        case 1:
+            this.replicateTo = ReplicateTo.ONE;
+            break;
+        case 2:
+            this.replicateTo = ReplicateTo.TWO;
+            break;
+        case 3:
+            this.replicateTo = ReplicateTo.THREE;
+            break;
+        default:
+            throw new IllegalArgumentException("Unsupported replicateTo parameter. Supported values are 0 to 3. Currently provided: " + replicateTo);
+        }
+
+    }
+
+    @Override
+    public void process(Exchange exchange) throws Exception {
+
+        Map<String, Object> headers = exchange.getIn().getHeaders();
+
+        String id = (headers.containsKey(HEADER_ID)) ? exchange.getIn().getHeader(HEADER_ID, String.class) : endpoint.getId();
+
+        int ttl = (headers.containsKey(HEADER_TTL)) ? Integer.parseInt(exchange.getIn().getHeader(HEADER_TTL, String.class)) : DEFAULT_TTL;
+
+        if (endpoint.isAutoStartIdForInserts()) {
+            id = Long.toString(startId);
+            startId++;
+        } else if (id == null) {
+            throw new CouchbaseException(HEADER_ID + " is not specified in message header or endpoint URL.", exchange);
+        }
+
+        if (endpoint.getOperation().equals(COUCHBASE_PUT)) {
+            log.info("Type of operation: PUT");
+            Object obj = exchange.getIn().getBody();
+            exchange.getOut().setBody(setDocument(id, ttl, obj, persistTo, replicateTo));
+        } else if (endpoint.getOperation().equals(COUCHBASE_GET)) {
+            log.info("Type of operation: GET");
+            Object result = client.get(id);
+            exchange.getOut().setBody(result);
+        } else if (endpoint.getOperation().equals(COUCHBASE_DELETE)) {
+            log.info("Type of operation: DELETE");
+            Future<Boolean> result = client.delete(id);
+            exchange.getOut().setBody(result.get());
+        }
+
+        // cleanup the cache headers
+        exchange.getIn().removeHeader(HEADER_ID);
+
+    }
+
+    private Boolean setDocument(String id, int expiry, Object obj, PersistTo persistTo, ReplicateTo replicateTo) throws Exception {
+        return setDocument(id, expiry, obj, producerRetryAttempts, persistTo, replicateTo);
+    }
+
+    private Boolean setDocument(String id, int expiry, Object obj, int retryAttempts, PersistTo persistTo, ReplicateTo replicateTo) throws Exception {
+
+        OperationFuture<Boolean> result = client.set(id, expiry, obj, persistTo, replicateTo);
+        try {
+            if (!result.get()) {
+                throw new Exception("Unable to save Document. " + id);
+            }
+            return true;
+        } catch (Exception e) {
+            if (retryAttempts <= 0) {
+                throw e;
+            } else {
+                log.info("Unable to save Document, retrying in " + producerRetryPause + "ms (" + retryAttempts + ")");
+                Thread.sleep(producerRetryPause);
+                return setDocument(id, expiry, obj, retryAttempts - 1, persistTo, replicateTo);
+            }
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components/camel-couchbase/src/main/resources/META-INF/LICENSE.txt
----------------------------------------------------------------------
diff --git a/components/camel-couchbase/src/main/resources/META-INF/LICENSE.txt b/components/camel-couchbase/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000..6b0b127
--- /dev/null
+++ b/components/camel-couchbase/src/main/resources/META-INF/LICENSE.txt
@@ -0,0 +1,203 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components/camel-couchbase/src/main/resources/META-INF/NOTICE.txt
----------------------------------------------------------------------
diff --git a/components/camel-couchbase/src/main/resources/META-INF/NOTICE.txt b/components/camel-couchbase/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 0000000..2e215bf
--- /dev/null
+++ b/components/camel-couchbase/src/main/resources/META-INF/NOTICE.txt
@@ -0,0 +1,11 @@
+   =========================================================================
+   ==  NOTICE file corresponding to the section 4 d of                    ==
+   ==  the Apache License, Version 2.0,                                   ==
+   ==  in this case for the Apache Camel distribution.                    ==
+   =========================================================================
+
+   This product includes software developed by
+   The Apache Software Foundation (http://www.apache.org/).
+
+   Please read the different LICENSE files present in the licenses directory of
+   this distribution.

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components/camel-couchbase/src/main/resources/META-INF/services/org/apache/camel/component/couchbase
----------------------------------------------------------------------
diff --git a/components/camel-couchbase/src/main/resources/META-INF/services/org/apache/camel/component/couchbase b/components/camel-couchbase/src/main/resources/META-INF/services/org/apache/camel/component/couchbase
new file mode 100644
index 0000000..c580c63
--- /dev/null
+++ b/components/camel-couchbase/src/main/resources/META-INF/services/org/apache/camel/component/couchbase
@@ -0,0 +1,19 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+class=org.apache.camel.component.couchbase.CouchbaseComponent
+

http://git-wip-us.apache.org/repos/asf/camel/blob/0f1f14fa/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/ConsumeBeerMessagesWithLimitIntegrationTest.java
----------------------------------------------------------------------
diff --git a/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/ConsumeBeerMessagesWithLimitIntegrationTest.java b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/ConsumeBeerMessagesWithLimitIntegrationTest.java
new file mode 100644
index 0000000..a4e3365
--- /dev/null
+++ b/components/camel-couchbase/src/test/java/org/apache/camel/component/couchbase/ConsumeBeerMessagesWithLimitIntegrationTest.java
@@ -0,0 +1,48 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.couchbase;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+public class ConsumeBeerMessagesWithLimitIntegrationTest extends CamelTestSupport {
+
+    @Test
+    public void testQueryForBeers() throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedMessageCount(10);
+
+        assertMockEndpointsSatisfied();
+
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+
+                // need couchbase installed on localhost with beer-sample data
+                from("couchbase:http://localhost/beer-sample?designDocumentName=beer&viewName=brewery_beers&limit=10").to("mock:result");
+            }
+        };
+
+    }
+}


[7/7] camel git commit: CAMEL-10375: Added camel-couchbase to Spring-boot-dm

Posted by ac...@apache.org.
CAMEL-10375: Added camel-couchbase to Spring-boot-dm


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/4eeeda68
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4eeeda68
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4eeeda68

Branch: refs/heads/master
Commit: 4eeeda683466ea0f8168cc91b65ad3cc720bc702
Parents: a9da1c4
Author: Andrea Cosentino <an...@gmail.com>
Authored: Thu Jan 12 12:48:25 2017 +0100
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu Jan 12 13:14:46 2017 +0100

----------------------------------------------------------------------
 .../spring-boot-dm/camel-spring-boot-dependencies/pom.xml | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/4eeeda68/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml b/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml
index 738a8b6..608eb96 100644
--- a/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml
+++ b/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml
@@ -623,6 +623,16 @@
       </dependency>
       <dependency>
         <groupId>org.apache.camel</groupId>
+        <artifactId>camel-couchbase</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.camel</groupId>
+        <artifactId>camel-couchbase-starter</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.camel</groupId>
         <artifactId>camel-couchdb</artifactId>
         <version>${project.version}</version>
       </dependency>


[3/7] camel git commit: CAMEL-10375: Use a specific property for couchbase-client version

Posted by ac...@apache.org.
CAMEL-10375: Use a specific property for couchbase-client version


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/9d4a1ec9
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9d4a1ec9
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9d4a1ec9

Branch: refs/heads/master
Commit: 9d4a1ec966415c079a82f4e6168f357a38e02ce0
Parents: f9e6a4a
Author: Andrea Cosentino <an...@gmail.com>
Authored: Thu Jan 12 13:14:19 2017 +0100
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu Jan 12 13:14:46 2017 +0100

----------------------------------------------------------------------
 components/camel-couchbase/pom.xml                       | 2 +-
 parent/pom.xml                                           | 1 +
 platforms/karaf/features/src/main/resources/features.xml | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/9d4a1ec9/components/camel-couchbase/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-couchbase/pom.xml b/components/camel-couchbase/pom.xml
index 5996cd4..43921de 100644
--- a/components/camel-couchbase/pom.xml
+++ b/components/camel-couchbase/pom.xml
@@ -45,7 +45,7 @@
     <dependency>
       <groupId>com.couchbase.client</groupId>
       <artifactId>couchbase-client</artifactId>
-      <version>1.4.12</version>
+      <version>${couchbase-client-version}</version>
     </dependency>
 
     <dependency>

http://git-wip-us.apache.org/repos/asf/camel/blob/9d4a1ec9/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index d92df30..9f4c191 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -149,6 +149,7 @@
     <consul-client-version>0.13.8</consul-client-version>
     <consul-client-bundle-version>0.13.8_1</consul-client-bundle-version>
     <cobertura-maven-plugin-version>2.7</cobertura-maven-plugin-version>
+    <couchbase-client-version>1.4.12</couchbase-client-version>
     <curator-version>2.11.0</curator-version>
     <cxf-version>3.1.9</cxf-version>
     <cxf-version-range>[3.0,4.0)</cxf-version-range>

http://git-wip-us.apache.org/repos/asf/camel/blob/9d4a1ec9/platforms/karaf/features/src/main/resources/features.xml
----------------------------------------------------------------------
diff --git a/platforms/karaf/features/src/main/resources/features.xml b/platforms/karaf/features/src/main/resources/features.xml
index df0dc44..5648bc8 100644
--- a/platforms/karaf/features/src/main/resources/features.xml
+++ b/platforms/karaf/features/src/main/resources/features.xml
@@ -402,7 +402,7 @@
   <feature name='camel-couchbase' version='${project.version}' resolver='(obr)' start-level='50'>
     <feature version='${project.version}'>camel-core</feature>
     <bundle dependency='true'>wrap:mvn:net.spy/spymemcached/${spymemcached-version}</bundle>
-    <bundle dependency='true'>wrap:mvn:com.couchbase.client/couchbase-client/1.4.12</bundle>
+    <bundle dependency='true'>wrap:mvn:com.couchbase.client/couchbase-client/${couchbase-client-version}</bundle>
     <bundle>mvn:org.apache.camel/camel-couchbase/${project.version}</bundle>
   </feature>
   <feature name='camel-crypto' version='${project.version}' resolver='(obr)' start-level='50'>


[4/7] camel git commit: CAMEL-10375: Added camel-couchbase to Summary and components list in documentation

Posted by ac...@apache.org.
CAMEL-10375: Added camel-couchbase to Summary and components list in documentation


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d6b1944b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d6b1944b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d6b1944b

Branch: refs/heads/master
Commit: d6b1944bc28041fa31ef4e6f0df56990ea92f20a
Parents: 4eeeda6
Author: Andrea Cosentino <an...@gmail.com>
Authored: Thu Jan 12 12:49:45 2017 +0100
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu Jan 12 13:14:46 2017 +0100

----------------------------------------------------------------------
 .../camel-couchbase/src/main/docs/couchbase-component.adoc       | 4 ++--
 components/readme.adoc                                           | 3 +++
 docs/user-manual/en/SUMMARY.md                                   | 1 +
 3 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/d6b1944b/components/camel-couchbase/src/main/docs/couchbase-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-couchbase/src/main/docs/couchbase-component.adoc b/components/camel-couchbase/src/main/docs/couchbase-component.adoc
index f4072c7..439845a 100644
--- a/components/camel-couchbase/src/main/docs/couchbase-component.adoc
+++ b/components/camel-couchbase/src/main/docs/couchbase-component.adoc
@@ -1,4 +1,4 @@
-# Couchbase Component
+## Couchbase Component
 ## Couchbase Component
 
 *Available as of Camel 2.19*
@@ -89,4 +89,4 @@ The Couchbase component supports 47 endpoint options which are listed below:
 | useFixedDelay | scheduler | true | boolean | Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details.
 |=======================================================================
 {% endraw %}
-// endpoint options: END
+// endpoint options: END
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/d6b1944b/components/readme.adoc
----------------------------------------------------------------------
diff --git a/components/readme.adoc b/components/readme.adoc
index 9d6e360..9813764 100644
--- a/components/readme.adoc
+++ b/components/readme.adoc
@@ -114,6 +114,9 @@ Components
 | link:camel-consul/src/main/docs/consul-component.adoc[Consul] (camel-consul) +
 `consul:apiEndpoint` | The camel consul component allows you to work with Consul a distributed highly available datacenter-aware service discovery and configuration system.
 
+| link:camel-couchbase/src/main/docs/couchbase-component.adoc[Couchbase] (camel-couchbase) +
+`couchbase:url` | Represents a Couchbase endpoint that can query Views with a Poll strategy and/or produce various type of operations.
+
 | link:camel-couchdb/src/main/docs/couchdb-component.adoc[CouchDB] (camel-couchdb) +
 `couchdb:protocol:hostname:port/database` | The couchdb component is used for integrate with CouchDB databases.
 

http://git-wip-us.apache.org/repos/asf/camel/blob/d6b1944b/docs/user-manual/en/SUMMARY.md
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md
index e6c39fb..54c6702 100644
--- a/docs/user-manual/en/SUMMARY.md
+++ b/docs/user-manual/en/SUMMARY.md
@@ -160,6 +160,7 @@
 	* [CoAP](coap-component.adoc)
 	* [CometD](cometd-component.adoc)
 	* [Consul](consul-component.adoc)
+	* [Couchbase](couchbase-component.adoc)
 	* [CouchDB](couchdb-component.adoc)
 	* [Crypto (JCE)](crypto-component.adoc)
 	* [CXF](cxf-component.adoc)


[5/7] camel git commit: CAMEL-10375: Added first spike of documentation

Posted by ac...@apache.org.
CAMEL-10375: Added first spike of documentation


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a9da1c48
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a9da1c48
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a9da1c48

Branch: refs/heads/master
Commit: a9da1c480f70342d61b6b10c296dc5b83b1acd1a
Parents: 0f1f14f
Author: Andrea Cosentino <an...@gmail.com>
Authored: Thu Jan 12 11:47:24 2017 +0100
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu Jan 12 13:14:46 2017 +0100

----------------------------------------------------------------------
 .../camel-couchbase-starter/pom.xml             |  2 +-
 .../src/main/docs/couchbase-component.adoc      | 92 ++++++++++++++++++++
 2 files changed, 93 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/a9da1c48/components-starter/camel-couchbase-starter/pom.xml
----------------------------------------------------------------------
diff --git a/components-starter/camel-couchbase-starter/pom.xml b/components-starter/camel-couchbase-starter/pom.xml
index d4a53f2..c88c9c2 100644
--- a/components-starter/camel-couchbase-starter/pom.xml
+++ b/components-starter/camel-couchbase-starter/pom.xml
@@ -24,7 +24,7 @@
   </parent>
   <artifactId>camel-couchbase-starter</artifactId>
   <packaging>jar</packaging>
-  <name>Spring-Boot Starter :: Camel Extra :: Couchbase</name>
+  <name>Spring-Boot Starter :: Camel :: Couchbase</name>
   <description>Spring-Boot Starter for Camel Couchbase component</description>
   <dependencies>
     <dependency>

http://git-wip-us.apache.org/repos/asf/camel/blob/a9da1c48/components/camel-couchbase/src/main/docs/couchbase-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-couchbase/src/main/docs/couchbase-component.adoc b/components/camel-couchbase/src/main/docs/couchbase-component.adoc
new file mode 100644
index 0000000..f4072c7
--- /dev/null
+++ b/components/camel-couchbase/src/main/docs/couchbase-component.adoc
@@ -0,0 +1,92 @@
+# Couchbase Component
+## Couchbase Component
+
+*Available as of Camel 2.19*
+
+The *couchbase:* component allows you to treat
+https://www.couchbase.com/[CouchBase] instances as a producer or consumer
+of messages.
+
+Maven users will need to add the following dependency to their `pom.xml`
+for this component:
+
+[source,xml]
+------------------------------------------------------------
+<dependency>
+    <groupId>org.apache.camel</groupId>
+    <artifactId>camel-couchbase</artifactId>
+    <version>x.x.x</version>
+    <!-- use the same version as your Camel core version -->
+</dependency>
+------------------------------------------------------------
+
+### URI format
+
+[source,java]
+-------------------------------------------------
+couchbase:url
+-------------------------------------------------
+
+### Options
+
+// component options: START
+The Couchbase component has no options.
+// component options: END
+
+// endpoint options: START
+The Couchbase component supports 47 endpoint options which are listed below:
+
+{% raw %}
+[width="100%",cols="2,1,1m,1m,5",options="header"]
+|=======================================================================
+| Name | Group | Default | Java Type | Description
+| protocol | common |  | String | The protocol to use
+| additionalHosts | common |  | String | The additional hosts
+| autoStartIdForInserts | common | false | boolean | Define if we want an autostart Id when we are doing an insert operation
+| consumerProcessedStrategy | common |  | String | Define the consumer Processed strategy to use
+| descending | common | false | boolean | Define if this operation is descending or not
+| designDocumentName | common |  | String | The design document name to use
+| key | common |  | String | The key to use
+| limit | common |  | int | The output limit to use
+| maxReconnectDelay | common |  | long | Define the max delay during a reconnection
+| obsPollInterval | common |  | long | Define the observation polling interval
+| obsTimeout | common |  | long | Define the observation timeout
+| operation | common |  | String | The operation to do
+| opQueueMaxBlockTime | common |  | long | Define the max time an operation can be in queue blocked
+| opTimeOut | common |  | long | Define the operation timeout
+| password | common |  | String | The password to use
+| persistTo | common |  | int | Where to persist the data
+| producerRetryAttempts | common |  | int | Define the number of retry attempts
+| producerRetryPause | common |  | int | Define the retry pause between different attempts
+| rangeEndKey | common |  | String | Define a range for the end key
+| rangeStartKey | common |  | String | Define a range for the start key
+| readBufferSize | common |  | int | Define the buffer size
+| replicateTo | common |  | int | Where to replicate the data
+| shouldOptimize | common | false | boolean | Define if we want to use optimization or not where possible
+| skip | common |  | int | Define the skip to use
+| startingIdForInsertsFrom | common |  | long | Define the starting Id where we are doing an insert operation
+| timeoutExceptionThreshold | common |  | int | Define the threshold for throwing a timeout Exception
+| username | common |  | String | The username to use
+| viewName | common |  | String | The view name to use
+| bridgeErrorHandler | consumer | false | boolean | Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN or ERROR level and ignored.
+| sendEmptyMessageWhenIdle | consumer | false | boolean | If the polling consumer did not poll any files you can enable this option to send an empty message (no body) instead.
+| exceptionHandler | consumer (advanced) |  | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN or ERROR level and ignored.
+| exchangePattern | consumer (advanced) |  | ExchangePattern | Sets the exchange pattern when the consumer creates an exchange.
+| pollStrategy | consumer (advanced) |  | PollingConsumerPollStrategy | A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel.
+| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
+| backoffErrorThreshold | scheduler |  | int | The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in.
+| backoffIdleThreshold | scheduler |  | int | The number of subsequent idle polls that should happen before the backoffMultipler should kick-in.
+| backoffMultiplier | scheduler |  | int | To let the scheduled polling consumer backoff if there has been a number of subsequent idles/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and/or backoffErrorThreshold must also be configured.
+| delay | scheduler | 500 | long | Milliseconds before the next poll. You can also specify time values using units such as 60s (60 seconds) 5m30s (5 minutes and 30 seconds) and 1h (1 hour).
+| greedy | scheduler | false | boolean | If greedy is enabled then the ScheduledPollConsumer will run immediately again if the previous run polled 1 or more messages.
+| initialDelay | scheduler | 1000 | long | Milliseconds before the first poll starts. You can also specify time values using units such as 60s (60 seconds) 5m30s (5 minutes and 30 seconds) and 1h (1 hour).
+| runLoggingLevel | scheduler | TRACE | LoggingLevel | The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that.
+| scheduledExecutorService | scheduler |  | ScheduledExecutorService | Allows for configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool.
+| scheduler | scheduler | none | ScheduledPollConsumerScheduler | To use a cron scheduler from either camel-spring or camel-quartz2 component
+| schedulerProperties | scheduler |  | Map | To configure additional properties when using a custom scheduler or any of the Quartz2 Spring based scheduler.
+| startScheduler | scheduler | true | boolean | Whether the scheduler should be auto started.
+| timeUnit | scheduler | MILLISECONDS | TimeUnit | Time unit for initialDelay and delay options.
+| useFixedDelay | scheduler | true | boolean | Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details.
+|=======================================================================
+{% endraw %}
+// endpoint options: END