camel git commit: Downgrade Hazelcast to version 3.6, as OSGi feature doesn't work actually
Repository: camel Updated Branches: refs/heads/master 99e854f21 -> 1c3a3e0ec Downgrade Hazelcast to version 3.6, as OSGi feature doesn't work actually Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1c3a3e0e Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1c3a3e0e Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1c3a3e0e Branch: refs/heads/master Commit: 1c3a3e0ec266980146124c849df25fde59556f0e Parents: 99e854f Author: Andrea CosentinoAuthored: Tue Mar 1 08:42:32 2016 +0100 Committer: Andrea Cosentino Committed: Tue Mar 1 08:46:17 2016 +0100 -- parent/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/1c3a3e0e/parent/pom.xml -- diff --git a/parent/pom.xml b/parent/pom.xml index 4fdcb10..a7f8fa1 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -223,7 +223,7 @@ 1.11 1.6 1.21 -3.6.1 +3.6 1.1.3 1.1.1_1 5.2.4.Final
camel git commit: Upgrade Hazelcast to version 3.6.1
Repository: camel Updated Branches: refs/heads/master eb16b5c14 -> 99e854f21 Upgrade Hazelcast to version 3.6.1 Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/99e854f2 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/99e854f2 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/99e854f2 Branch: refs/heads/master Commit: 99e854f21e1c0e13a463dda9aeda6499a555e9fd Parents: eb16b5c Author: Andrea CosentinoAuthored: Tue Mar 1 08:12:54 2016 +0100 Committer: Andrea Cosentino Committed: Tue Mar 1 08:12:54 2016 +0100 -- parent/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/99e854f2/parent/pom.xml -- diff --git a/parent/pom.xml b/parent/pom.xml index a7f8fa1..4fdcb10 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -223,7 +223,7 @@ 1.11 1.6 1.21 -3.6 +3.6.1 1.1.3 1.1.1_1 5.2.4.Final
svn commit: r981408 - in /websites/production/camel/content: cache/main.pageCache twitter.html
Author: buildbot Date: Mon Feb 29 18:18:46 2016 New Revision: 981408 Log: Production update by buildbot for camel Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/twitter.html Modified: websites/production/camel/content/cache/main.pageCache == Binary files - no diff available. Modified: websites/production/camel/content/twitter.html == --- websites/production/camel/content/twitter.html (original) +++ websites/production/camel/content/twitter.html Mon Feb 29 18:18:46 2016 @@ -96,7 +96,7 @@ URI format -TwitterComponent:The twitter component can be configured with the Twitter account settings which is mandatory to configure before using. You can also configure these options directly in the endpoint.OptionDescriptionconsumerKeyThe consumer keyconsumerSecretThe consumer secretaccessTokenThe access tokenaccessTokenSecretThe access token secretConsumer Endpoints:Rather than the endpoints returning a List through one single route exchange, camel-twitter creates one route exchange per returned object. As an example, if "timeline/home" results in five statuses, the route will be executed five times (one for each Status).EndpointContextBody TypeNoticedirectmessagedirect, pollingtwitter4j.DirectMessagesearchdirect, pollingtwitter4j.Statusstreaming/filterevent, pollingtwitter4j.Statusstreaming/sampleevent, pollingtwitter4j.Statusstreaming/userevent, pollingtwitter4j.StatusCamel 2.16: To receive tweets from protected users and accounts.timeline/homedirect, pollingtwitter4j.Statustimeline/mentionsdirect, pollingtwitter4j.Statustimeline/publicdirect, pollingtwitter4j.Status@deprecated. Use timeline/home or direct/home instead. Removed from Camel 2.11 onwards.timeline/retweetsofmedirect, pollingtwitter4j.Statustimeline/userdirect, pollingtwitter4j.Statustrends/dailyCamel 2.10.1: direct, pollingtwitter4j.Status@deprecated. Removed from Camel 2.11 onwards.trends/weeklyCamel 2.10.1: direct, pollingtwitter4j.Status@deprecated. Removed from Camel 2.11 onwards.Producer Endpoints:EndpointBody TypedirectmessageStringsearchListtwitter4j.Statustimeline/userStringURI OptionsNameDefault ValueDescriptiontypedirectdirect, event, or pollingdelayDelay between polls. The value is 60 seconds by default. The value is in seconds for Camel 2.16 or older. And in millis seconds from Camel 2.17 onwards.consumerKeynullConsumer Key. Can also be configured on the TwitterComponent level instead.consumerSecre tnullConsumer Secret. Can also be configured on the TwitterComponent level instead.accessTokennullAccess Token. Can also be configured on the TwitterComponent level instead.accessTokenSecretnullAccess Token Secret. Can also be configured on the TwitterComponent level instead.usernullUsername, used for user timeline consumption, direct message production, etc.locationsnull'lat,lon;lat,lon;...' Bounding boxes, created by pairs of lat/lons. Can be used for streaming/filterkeywordsnull'foo1,foo2,foo3...' Can be used for search and streaming/filter. See https://support.twitter.com/articles/71577-using-advanced-search; rel="nofollow">Advanced search for keywords syntax for searching with for example OR.userIdsnull'username,username...' Can be used for streaming/filterfilterOldtrueFilter out old tweets, that has previously been polled. This state is stored in memory only, and based on last tweet id. Since Camel 2.11.0 The search producer supports this optionsinceId1Camel 2.11.0: The last tweet id which will be used for pulling the tweets. It is useful when the camel route is restarted after a long running.langnullCamel 2.11.0: The lang string http://en.wikipedia.org/wiki/ISO_639-1; rel="nofollow">ISO_639-1 which will be used for searchingcountnullCamel 2.11.0: Limiting number of results per page.numberOfPages1Camel 2.11.0: The number of pages result which you wan t camel-twitter to consume.httpProxyHostnullCamel 2.12.3: The http proxy host which can be used for the camel-twitter.httpProxyPortnullCamel 2.12.3: The http proxy port which can be used for the camel-twitter.httpProxyUsernullCamel 2.12.3: The http proxy user which can be used for the camel-twitter.httpProxyPasswordnullCamel 2.12.3: The http proxy password which can be used for the camel-twitter.latitudeCamel 2.16:Used by the non-stream geography search to search by latitude. You need to configure all the following options: longitude, latitude, radius, and distanceMetric.longitudeCamel 2.16:Used by the non-stream geography search to search by longitude. You need to co nfigure all the following options: longitude, latitude, radius, and distanceMetric.radiusCamel 2.16:Used by the non-stream geography search to search by radius. You need to configure all the following options: longitude,
[1/3] camel git commit: CAMEL-8258 - Support Streaming from User Endpoint including Direct Messages
Repository: camel Updated Branches: refs/heads/master b09eca278 -> eb16b5c14 http://git-wip-us.apache.org/repos/asf/camel/blob/33b3bd5c/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/AbstractStatusConsumer.java -- diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/AbstractStatusConsumer.java b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/AbstractStatusConsumer.java new file mode 100644 index 000..1e87e14 --- /dev/null +++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/AbstractStatusConsumer.java @@ -0,0 +1,55 @@ +/** + * 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.twitter.consumer.timeline; + +import java.util.List; + +import org.apache.camel.Exchange; +import org.apache.camel.component.twitter.TwitterEndpoint; +import org.apache.camel.component.twitter.consumer.TwitterConsumer; +import org.apache.camel.component.twitter.consumer.TwitterEventType; +import twitter4j.Status; +import twitter4j.TwitterException; + +/** + * Consumes the user's home timeline. + */ +abstract class AbstractStatusConsumer extends TwitterConsumer { + +public AbstractStatusConsumer(TwitterEndpoint endpoint) { +super(endpoint); +} + +@Override +public List pollConsume() throws TwitterException { +List statusList = doPoll(); +for (int i = 0; i < statusList.size(); i++) { +setLastIdIfGreater(statusList.get(i).getId()); +} + +return TwitterEventType.STATUS.createExchangeList(endpoint, statusList); +} + +@Override +public List directConsume() throws TwitterException { +return TwitterEventType.STATUS.createExchangeList(endpoint, doDirect()); +} + +protected abstract List doPoll() throws TwitterException; + +protected abstract List doDirect() throws TwitterException; +} http://git-wip-us.apache.org/repos/asf/camel/blob/33b3bd5c/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/HomeConsumer.java -- diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/HomeConsumer.java b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/HomeConsumer.java index 98d7912..252bacc 100644 --- a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/HomeConsumer.java +++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/HomeConsumer.java @@ -19,30 +19,25 @@ package org.apache.camel.component.twitter.consumer.timeline; import java.util.List; import org.apache.camel.component.twitter.TwitterEndpoint; -import org.apache.camel.component.twitter.consumer.Twitter4JConsumer; - -import twitter4j.Paging; import twitter4j.Status; import twitter4j.TwitterException; /** * Consumes the user's home timeline. */ -public class HomeConsumer extends Twitter4JConsumer { +public class HomeConsumer extends AbstractStatusConsumer { -public HomeConsumer(TwitterEndpoint te) { -super(te); +public HomeConsumer(TwitterEndpoint endpoint) { +super(endpoint); } -public List pollConsume() throws TwitterException { -List list = te.getProperties().getTwitter().getHomeTimeline(new Paging(lastId)); -for (Status s : list) { -checkLastId(s.getId()); -} -return list; +@Override +protected List doPoll() throws TwitterException { +return getTwitter().getHomeTimeline(getLastIdPaging()); } -public List directConsume() throws TwitterException { -return te.getProperties().getTwitter().getHomeTimeline(); +@Override +protected List doDirect() throws TwitterException { +return getTwitter().getHomeTimeline(); } }
[3/3] camel git commit: Fixed CS
Fixed CS Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/eb16b5c1 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/eb16b5c1 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/eb16b5c1 Branch: refs/heads/master Commit: eb16b5c145bbeed7e7f7cce64fd3901e2a4b71eb Parents: 33b3bd5 Author: Andrea CosentinoAuthored: Mon Feb 29 17:38:20 2016 +0100 Committer: Andrea Cosentino Committed: Mon Feb 29 17:38:20 2016 +0100 -- .../org/apache/camel/component/twitter/util/TwitterConverter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/eb16b5c1/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/util/TwitterConverter.java -- diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/util/TwitterConverter.java b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/util/TwitterConverter.java index 2b55814..a650673 100644 --- a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/util/TwitterConverter.java +++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/util/TwitterConverter.java @@ -74,7 +74,7 @@ public final class TwitterConverter { @Converter public static String toString(UserList userList) throws ParseException { - return new StringBuilder() +return new StringBuilder() .append(userList.getCreatedAt()).append(" (").append(userList.getUser().getScreenName()).append(") ") .append(userList.getFullName()) .append(',')
[2/3] camel git commit: CAMEL-8258 - Support Streaming from User Endpoint including Direct Messages
CAMEL-8258 - Support Streaming from User Endpoint including Direct Messages Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/33b3bd5c Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/33b3bd5c Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/33b3bd5c Branch: refs/heads/master Commit: 33b3bd5c9a011788787c094e83848ca666a52724 Parents: b09eca2 Author: lburgazzoliAuthored: Fri Feb 26 12:36:21 2016 +0100 Committer: Andrea Cosentino Committed: Mon Feb 29 17:35:39 2016 +0100 -- .../component/twitter/Twitter4JFactory.java | 173 --- .../component/twitter/TwitterConstants.java | 25 ++- .../twitter/TwitterEndpointDirect.java | 6 +- .../component/twitter/TwitterEndpointEvent.java | 4 +- .../twitter/TwitterEndpointPolling.java | 8 +- .../camel/component/twitter/TwitterHelper.java | 172 ++ .../twitter/consumer/TweeterStatusListener.java | 24 --- .../twitter/consumer/Twitter4JConsumer.java | 72 .../twitter/consumer/TwitterConsumer.java | 86 + .../twitter/consumer/TwitterConsumerDirect.java | 16 +- .../twitter/consumer/TwitterConsumerEvent.java | 33 ++-- .../consumer/TwitterConsumerPolling.java| 38 ++-- .../twitter/consumer/TwitterEventListener.java | 26 +++ .../twitter/consumer/TwitterEventType.java | 77 + .../directmessage/DirectMessageConsumer.java| 28 +-- .../twitter/consumer/search/SearchConsumer.java | 52 +++--- .../streaming/AbstractStreamingConsumer.java| 128 ++ .../consumer/streaming/FilterConsumer.java | 77 - .../streaming/FilterStreamingConsumer.java | 77 + .../consumer/streaming/SampleConsumer.java | 40 - .../streaming/SampleStreamingConsumer.java | 40 + .../consumer/streaming/StreamingConsumer.java | 108 .../streaming/UserStreamingConsumer.java| 156 - .../timeline/AbstractStatusConsumer.java| 55 ++ .../twitter/consumer/timeline/HomeConsumer.java | 23 +-- .../consumer/timeline/MentionsConsumer.java | 23 +-- .../consumer/timeline/RetweetsConsumer.java | 23 +-- .../twitter/consumer/timeline/UserConsumer.java | 23 +-- .../component/twitter/data/ConsumerType.java| 12 +- .../component/twitter/data/EndpointType.java| 12 +- .../component/twitter/data/StreamingType.java | 11 +- .../component/twitter/data/TimelineType.java| 11 +- .../component/twitter/data/TrendsType.java | 11 +- .../twitter/producer/DirectMessageProducer.java | 10 +- .../twitter/producer/SearchProducer.java| 24 +-- .../twitter/producer/Twitter4JProducer.java | 36 .../twitter/producer/TwitterProducer.java | 37 .../twitter/producer/UserProducer.java | 14 +- .../twitter/util/TwitterConverter.java | 28 ++- .../twitter/CamelTwitterTestSupport.java| 65 --- .../component/twitter/UserStreamingTest.java| 49 ++ .../src/test/resources/log4j.properties | 1 + 42 files changed, 1112 insertions(+), 822 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/33b3bd5c/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/Twitter4JFactory.java -- diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/Twitter4JFactory.java b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/Twitter4JFactory.java deleted file mode 100644 index 9025164..000 --- a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/Twitter4JFactory.java +++ /dev/null @@ -1,173 +0,0 @@ -/** - * 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.twitter; - -import java.util.regex.Pattern; - -import org.apache.camel.component.twitter.consumer.Twitter4JConsumer; -import
camel git commit: Upgrade Kubernetes/Openshift client to version 1.3.72
Repository: camel Updated Branches: refs/heads/master 5e37c6deb -> b09eca278 Upgrade Kubernetes/Openshift client to version 1.3.72 Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b09eca27 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b09eca27 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b09eca27 Branch: refs/heads/master Commit: b09eca27897af7b13548a665933803cf9f5aa702 Parents: 5e37c6d Author: Andrea CosentinoAuthored: Mon Feb 29 15:40:11 2016 +0100 Committer: Andrea Cosentino Committed: Mon Feb 29 15:40:34 2016 +0100 -- parent/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/b09eca27/parent/pom.xml -- diff --git a/parent/pom.xml b/parent/pom.xml index ef62603..a7f8fa1 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -353,7 +353,7 @@ 4.0.4 6.3.0.Final 0.4.9 -1.3.70 +1.3.72 1.0.41 2.3.0_3 1.8 @@ -427,7 +427,7 @@ 4.7.3 2.4.1 2.7.0.Final -1.3.70 +1.3.72 6.3.0.Final 2.0.8_6 2.4_5
[1/2] camel git commit: Camel catalog - Fixed mistake in filter log options.
Repository: camel Updated Branches: refs/heads/camel-2.16.x 975e88084 -> e67d08c2e refs/heads/master 7fc38807b -> 5e37c6deb Camel catalog - Fixed mistake in filter log options. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5e37c6de Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5e37c6de Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5e37c6de Branch: refs/heads/master Commit: 5e37c6deba0db8d4f8648c25dc1272375907f796 Parents: 7fc3880 Author: Claus IbsenAuthored: Mon Feb 29 15:33:06 2016 +0100 Committer: Claus Ibsen Committed: Mon Feb 29 15:33:06 2016 +0100 -- .../org/apache/camel/catalog/DefaultCamelCatalog.java| 11 +-- .../java/org/apache/camel/catalog/CamelCatalogTest.java | 9 + 2 files changed, 14 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/5e37c6de/platforms/catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java -- diff --git a/platforms/catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java b/platforms/catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java index 47af8b2..4e99524 100644 --- a/platforms/catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java +++ b/platforms/catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java @@ -1447,23 +1447,22 @@ public class DefaultCamelCatalog implements CamelCatalog { */ private Map filterProperties(String scheme, Map options) { if ("log".equals(scheme)) { -Map answer = new LinkedHashMap (); String showAll = options.get("showAll"); if ("true".equals(showAll)) { +Map filtered = new LinkedHashMap (); // remove all the other showXXX options when showAll=true for (Map.Entry entry : options.entrySet()) { String key = entry.getKey(); boolean skip = key.startsWith("show") && !key.equals("showAll"); if (!skip) { -answer.put(key, entry.getValue()); +filtered.put(key, entry.getValue()); } } +return filtered; } -return answer; -} else { -// use as-is -return options; } +// use as-is +return options; } @Override http://git-wip-us.apache.org/repos/asf/camel/blob/5e37c6de/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java -- diff --git a/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java b/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java index ba85f25..830d0bd 100644 --- a/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java +++ b/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java @@ -343,6 +343,15 @@ public class CamelCatalogTest { } @Test +public void testAsEndpointUriLogShort() throws Exception { +Map map = new HashMap (); +map.put("loggerName", "foo"); +map.put("loggerLevel", "DEBUG"); + +assertEquals("log:foo?loggerLevel=DEBUG", catalog.asEndpointUri("log", map, false)); +} + +@Test public void testAsEndpointUriWithplaceholder() throws Exception { Map map = new HashMap (); map.put("query", "{{insert}}");
[2/2] camel git commit: Camel catalog - Fixed mistake in filter log options.
Camel catalog - Fixed mistake in filter log options. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e67d08c2 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e67d08c2 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e67d08c2 Branch: refs/heads/camel-2.16.x Commit: e67d08c2e8e166a3f7eb0483208fc54355233579 Parents: 975e880 Author: Claus IbsenAuthored: Mon Feb 29 15:33:06 2016 +0100 Committer: Claus Ibsen Committed: Mon Feb 29 15:33:27 2016 +0100 -- .../org/apache/camel/catalog/DefaultCamelCatalog.java| 11 +-- .../java/org/apache/camel/catalog/CamelCatalogTest.java | 9 + 2 files changed, 14 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/e67d08c2/platforms/catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java -- diff --git a/platforms/catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java b/platforms/catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java index 47af8b2..4e99524 100644 --- a/platforms/catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java +++ b/platforms/catalog/src/main/java/org/apache/camel/catalog/DefaultCamelCatalog.java @@ -1447,23 +1447,22 @@ public class DefaultCamelCatalog implements CamelCatalog { */ private Map filterProperties(String scheme, Map options) { if ("log".equals(scheme)) { -Map answer = new LinkedHashMap (); String showAll = options.get("showAll"); if ("true".equals(showAll)) { +Map filtered = new LinkedHashMap (); // remove all the other showXXX options when showAll=true for (Map.Entry entry : options.entrySet()) { String key = entry.getKey(); boolean skip = key.startsWith("show") && !key.equals("showAll"); if (!skip) { -answer.put(key, entry.getValue()); +filtered.put(key, entry.getValue()); } } +return filtered; } -return answer; -} else { -// use as-is -return options; } +// use as-is +return options; } @Override http://git-wip-us.apache.org/repos/asf/camel/blob/e67d08c2/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java -- diff --git a/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java b/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java index ba85f25..830d0bd 100644 --- a/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java +++ b/platforms/catalog/src/test/java/org/apache/camel/catalog/CamelCatalogTest.java @@ -343,6 +343,15 @@ public class CamelCatalogTest { } @Test +public void testAsEndpointUriLogShort() throws Exception { +Map map = new HashMap (); +map.put("loggerName", "foo"); +map.put("loggerLevel", "DEBUG"); + +assertEquals("log:foo?loggerLevel=DEBUG", catalog.asEndpointUri("log", map, false)); +} + +@Test public void testAsEndpointUriWithplaceholder() throws Exception { Map map = new HashMap (); map.put("query", "{{insert}}");
camel git commit: Deprecated api on producer - should use endpoint like consumer does
Repository: camel Updated Branches: refs/heads/master 926e509f3 -> 7fc38807b Deprecated api on producer - should use endpoint like consumer does Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7fc38807 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7fc38807 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7fc38807 Branch: refs/heads/master Commit: 7fc38807b801d33c8f87e8b29a0f148b228559ef Parents: 926e509 Author: Claus IbsenAuthored: Mon Feb 29 10:52:43 2016 +0100 Committer: Claus Ibsen Committed: Mon Feb 29 11:36:15 2016 +0100 -- camel-core/src/main/java/org/apache/camel/Producer.java | 4 .../src/main/java/org/apache/camel/impl/ProducerCache.java | 2 +- .../java/org/apache/camel/management/PublishEventNotifier.java | 2 +- .../java/org/apache/camel/impl/CamelPostProcessorHelperTest.java | 2 +- .../org/apache/camel/impl/PojoProduceInterceptEndpointTest.java | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/7fc38807/camel-core/src/main/java/org/apache/camel/Producer.java -- diff --git a/camel-core/src/main/java/org/apache/camel/Producer.java b/camel-core/src/main/java/org/apache/camel/Producer.java index 2b890bc..f6be6f4 100644 --- a/camel-core/src/main/java/org/apache/camel/Producer.java +++ b/camel-core/src/main/java/org/apache/camel/Producer.java @@ -28,7 +28,9 @@ public interface Producer extends Processor, Service, IsSingleton, EndpointAware * Creates a new exchange to send to this endpoint * * @return a newly created exchange + * @deprecated use {@link Endpoint#createExchange()} - will be removed in Camel 3.0 */ +@Deprecated Exchange createExchange(); /** @@ -36,7 +38,9 @@ public interface Producer extends Processor, Service, IsSingleton, EndpointAware * * @param pattern the exchange pattern * @return a newly created exchange + * @deprecated use {@link Endpoint#createExchange(ExchangePattern)} - will be removed in Camel 3.0 */ +@Deprecated Exchange createExchange(ExchangePattern pattern); /** http://git-wip-us.apache.org/repos/asf/camel/blob/7fc38807/camel-core/src/main/java/org/apache/camel/impl/ProducerCache.java -- diff --git a/camel-core/src/main/java/org/apache/camel/impl/ProducerCache.java b/camel-core/src/main/java/org/apache/camel/impl/ProducerCache.java index 586cc69..9be2825 100644 --- a/camel-core/src/main/java/org/apache/camel/impl/ProducerCache.java +++ b/camel-core/src/main/java/org/apache/camel/impl/ProducerCache.java @@ -380,7 +380,7 @@ public class ProducerCache extends ServiceSupport { return doInProducer(endpoint, exchange, pattern, new ProducerCallback() { public Exchange doInProducer(Producer producer, Exchange exchange, ExchangePattern pattern) { if (exchange == null) { -exchange = pattern != null ? producer.createExchange(pattern) : producer.createExchange(); +exchange = pattern != null ? producer.getEndpoint().createExchange(pattern) : producer.getEndpoint().createExchange(); } if (processor != null) { http://git-wip-us.apache.org/repos/asf/camel/blob/7fc38807/camel-core/src/main/java/org/apache/camel/management/PublishEventNotifier.java -- diff --git a/camel-core/src/main/java/org/apache/camel/management/PublishEventNotifier.java b/camel-core/src/main/java/org/apache/camel/management/PublishEventNotifier.java index cd92275..17d0ed9 100644 --- a/camel-core/src/main/java/org/apache/camel/management/PublishEventNotifier.java +++ b/camel-core/src/main/java/org/apache/camel/management/PublishEventNotifier.java @@ -58,7 +58,7 @@ public class PublishEventNotifier extends EventNotifierSupport implements CamelC return; } -Exchange exchange = producer.createExchange(); +Exchange exchange = producer.getEndpoint().createExchange(); exchange.getIn().setBody(event); // make sure we don't send out events for this as well http://git-wip-us.apache.org/repos/asf/camel/blob/7fc38807/camel-core/src/test/java/org/apache/camel/impl/CamelPostProcessorHelperTest.java -- diff --git a/camel-core/src/test/java/org/apache/camel/impl/CamelPostProcessorHelperTest.java b/camel-core/src/test/java/org/apache/camel/impl/CamelPostProcessorHelperTest.java index f4fff4e..3bacc23 100644 ---
camel git commit: Upgrade Okhttp to version 2.7.5
Repository: camel Updated Branches: refs/heads/master 064fe8b10 -> 926e509f3 Upgrade Okhttp to version 2.7.5 Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/926e509f Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/926e509f Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/926e509f Branch: refs/heads/master Commit: 926e509f346bd78ac4e8ce1e924c014dfb0c26f0 Parents: 064fe8b Author: Andrea CosentinoAuthored: Mon Feb 29 10:41:31 2016 +0100 Committer: Andrea Cosentino Committed: Mon Feb 29 10:41:31 2016 +0100 -- parent/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/926e509f/parent/pom.xml -- diff --git a/parent/pom.xml b/parent/pom.xml index f00897b..ef62603 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -520,7 +520,7 @@ 2.2.2.RELEASE 2.5_2 2.12.0 -2.7.4 +2.7.5 1.6.0 0.14.0 1.19
[07/13] camel git commit: Improved AMQP test coverage.
Improved AMQP test coverage. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/dc712e46 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/dc712e46 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/dc712e46 Branch: refs/heads/camel-2.16.x Commit: dc712e461a85cb3490a5e10d7876484ed123cb65 Parents: 57f3ce7 Author: Henryk KonsekAuthored: Tue Dec 1 17:31:18 2015 +0100 Committer: Andrea Cosentino Committed: Mon Feb 29 09:28:35 2016 +0100 -- .../camel/component/amqp/AMQPComponent.java | 2 - .../camel/component/amqp/AMQPRouteTest.java | 48 2 files changed, 28 insertions(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/dc712e46/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java -- diff --git a/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java b/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java index e326cf44..3100e20 100644 --- a/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java +++ b/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java @@ -17,11 +17,9 @@ package org.apache.camel.component.amqp; import java.net.MalformedURLException; -import java.net.URISyntaxException; import javax.jms.ConnectionFactory; import org.apache.camel.CamelContext; -import org.apache.camel.Component; import org.apache.camel.component.jms.JmsComponent; import org.apache.camel.component.jms.JmsConfiguration; import org.apache.qpid.jms.JmsConnectionFactory; http://git-wip-us.apache.org/repos/asf/camel/blob/dc712e46/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java -- diff --git a/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java b/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java index 73ac9e0..d5d37db 100644 --- a/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java +++ b/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java @@ -18,22 +18,38 @@ package org.apache.camel.component.amqp; import org.apache.activemq.broker.BrokerService; import org.apache.camel.CamelContext; +import org.apache.camel.EndpointInject; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.mock.MockEndpoint; import org.apache.camel.test.junit4.CamelTestSupport; -import org.junit.Before; +import org.junit.AfterClass; +import org.junit.BeforeClass; import org.junit.Test; import static org.apache.camel.component.amqp.AMQPComponent.amqpComponent; public class AMQPRouteTest extends CamelTestSupport { -protected MockEndpoint resultEndpoint; +static BrokerService broker; -protected BrokerService broker; +@EndpointInject(uri = "mock:result") +MockEndpoint resultEndpoint; String expectedBody = "Hello there!"; +@BeforeClass +public static void beforeClass() throws Exception { +broker = new BrokerService(); +broker.setPersistent(false); +broker.addConnector("amqp://0.0.0.0:5672"); +broker.start(); +} + +@AfterClass +public static void afterClass() throws Exception { +broker.stop(); +} + @Test public void testJmsQueue() throws Exception { resultEndpoint.expectedMessageCount(1); @@ -43,6 +59,12 @@ public class AMQPRouteTest extends CamelTestSupport { } @Test +public void testRequestReply() { +String response = template.requestBody("amqp1-0:queue:inOut", expectedBody, String.class); +assertEquals("response", response); +} + +@Test public void testJmsTopic() throws Exception { resultEndpoint.expectedMessageCount(2); resultEndpoint.message(0).header("cheese").isEqualTo(123); @@ -50,23 +72,6 @@ public class AMQPRouteTest extends CamelTestSupport { resultEndpoint.assertIsSatisfied(); } -@Before -public void setUp() throws Exception { -broker = new BrokerService(); -broker.setPersistent(false); -broker.addConnector("amqp://0.0.0.0:5672"); -broker.start(); - -super.setUp(); -resultEndpoint = context.getEndpoint("mock:result", MockEndpoint.class); -} - -@Override -public void tearDown() throws Exception { -super.tearDown(); -broker.stop(); -} - protected CamelContext createCamelContext() throws Exception { CamelContext camelContext
[02/13] camel git commit: [CAMEL-9381] Removed AMQP 0.9 tests.
[CAMEL-9381] Removed AMQP 0.9 tests. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/84a43326 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/84a43326 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/84a43326 Branch: refs/heads/camel-2.16.x Commit: 84a43326393a715e64fda41653eb71a3b5cf17d1 Parents: 2e8a013 Author: Henryk KonsekAuthored: Tue Dec 1 15:24:05 2015 +0100 Committer: Andrea Cosentino Committed: Mon Feb 29 09:26:27 2016 +0100 -- .../apache/camel/component/amqp/AMQPRouteTest.java| 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/84a43326/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java -- diff --git a/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java b/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java index b388698..1b63ad8 100644 --- a/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java +++ b/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java @@ -27,9 +27,6 @@ import org.junit.Test; import static org.apache.camel.component.amqp.AMQPComponent.amqpComponent; -/** - * @version - */ public class AMQPRouteTest extends CamelTestSupport { protected MockEndpoint resultEndpoint; protected Broker broker; @@ -38,11 +35,6 @@ public class AMQPRouteTest extends CamelTestSupport { public void testJmsRouteWithTextMessage() throws Exception { String expectedBody = "Hello there!"; -resultEndpoint.expectedMessageCount(1); -resultEndpoint.message(0).header("cheese").isEqualTo(123); -template.sendBodyAndHeader("amqp0-9:queue:ping", expectedBody, "cheese", 123); -resultEndpoint.assertIsSatisfied(); - resultEndpoint.reset(); resultEndpoint.expectedMessageCount(1); resultEndpoint.message(0).header("cheese").isEqualTo(123); @@ -73,7 +65,6 @@ public class AMQPRouteTest extends CamelTestSupport { protected CamelContext createCamelContext() throws Exception { CamelContext camelContext = super.createCamelContext(); -camelContext.addComponent("amqp0-9", amqpComponent("amqp://guest:guest@/test?brokerlist='tcp://localhost:5672'", true)); camelContext.addComponent("amqp1-0", amqpComponent("amqp://guest:guest@localhost:5672?remote-host=test", false)); return camelContext; } @@ -81,14 +72,11 @@ public class AMQPRouteTest extends CamelTestSupport { protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { public void configure() throws Exception { -from("amqp0-9:queue:ping") -.to("log:routing") -.to("mock:result"); - from("amqp1-0:queue:ping") .to("log:routing") .to("mock:result"); } }; } + }
[04/13] camel git commit: Removed unused test class.
Removed unused test class. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/77229016 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/77229016 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/77229016 Branch: refs/heads/camel-2.16.x Commit: 7722901609f2383348d4ae43b7c14b3910b5cbe7 Parents: 6bc17f2 Author: Henryk KonsekAuthored: Tue Dec 1 16:36:12 2015 +0100 Committer: Andrea Cosentino Committed: Mon Feb 29 09:27:35 2016 +0100 -- .../camel/component/amqp/PurchaseOrder.java | 69 1 file changed, 69 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/77229016/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/PurchaseOrder.java -- diff --git a/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/PurchaseOrder.java b/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/PurchaseOrder.java deleted file mode 100644 index 5b10f1f..000 --- a/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/PurchaseOrder.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * 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.amqp; - -import java.io.Serializable; - -/** - * A simple POJO for testing - * - * @version - */ -public class PurchaseOrder implements Serializable { -private static final long serialVersionUID = 1L; - -private String product; -private double amount; - -public PurchaseOrder(String product, double amount) { -this.product = product; -this.amount = amount; -} - -@Override -public boolean equals(Object other) { -if (this == other) { -return true; -} -if (other == null) { -return false; -} -if (this.getClass() != other.getClass()) { -return false; -} -PurchaseOrder that = (PurchaseOrder) other; -return this.product.equals(that.product) && this.amount == that.amount; -} - -@Override -public int hashCode() { -return product.hashCode() * 37 + (int) Math.round(amount); -} - -@Override -public String toString() { -return "PurchaseOrder[" + product + " x " + amount + "]"; -} - -public double getAmount() { -return amount; -} - -public String getProduct() { -return product; -} -} \ No newline at end of file
[09/13] camel git commit: [camel-amqp] Avoiding tests' port conflicts.
[camel-amqp] Avoiding tests' port conflicts. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/940077a4 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/940077a4 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/940077a4 Branch: refs/heads/camel-2.16.x Commit: 940077a429a46b9561ae9cf01578e6f2852998d5 Parents: a7f1846 Author: Henryk KonsekAuthored: Thu Dec 3 12:17:54 2015 +0100 Committer: Andrea Cosentino Committed: Mon Feb 29 09:29:08 2016 +0100 -- .../camel/component/amqp/AMQPRouteTest.java | 21 +++- 1 file changed, 12 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/940077a4/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java -- diff --git a/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java b/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java index d5d37db..ce89bc6 100644 --- a/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java +++ b/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java @@ -21,6 +21,7 @@ import org.apache.camel.CamelContext; import org.apache.camel.EndpointInject; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.test.AvailablePortFinder; import org.apache.camel.test.junit4.CamelTestSupport; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -30,6 +31,8 @@ import static org.apache.camel.component.amqp.AMQPComponent.amqpComponent; public class AMQPRouteTest extends CamelTestSupport { +static int amqpPort = AvailablePortFinder.getNextAvailable(); + static BrokerService broker; @EndpointInject(uri = "mock:result") @@ -41,7 +44,7 @@ public class AMQPRouteTest extends CamelTestSupport { public static void beforeClass() throws Exception { broker = new BrokerService(); broker.setPersistent(false); -broker.addConnector("amqp://0.0.0.0:5672"); +broker.addConnector("amqp://0.0.0.0:" + amqpPort); broker.start(); } @@ -54,13 +57,13 @@ public class AMQPRouteTest extends CamelTestSupport { public void testJmsQueue() throws Exception { resultEndpoint.expectedMessageCount(1); resultEndpoint.message(0).header("cheese").isEqualTo(123); -template.sendBodyAndHeader("amqp1-0:queue:ping", expectedBody, "cheese", 123); +template.sendBodyAndHeader("amqp:queue:ping", expectedBody, "cheese", 123); resultEndpoint.assertIsSatisfied(); } @Test public void testRequestReply() { -String response = template.requestBody("amqp1-0:queue:inOut", expectedBody, String.class); +String response = template.requestBody("amqp:queue:inOut", expectedBody, String.class); assertEquals("response", response); } @@ -68,31 +71,31 @@ public class AMQPRouteTest extends CamelTestSupport { public void testJmsTopic() throws Exception { resultEndpoint.expectedMessageCount(2); resultEndpoint.message(0).header("cheese").isEqualTo(123); -template.sendBodyAndHeader("amqp1-0:topic:ping", expectedBody, "cheese", 123); +template.sendBodyAndHeader("amqp:topic:ping", expectedBody, "cheese", 123); resultEndpoint.assertIsSatisfied(); } protected CamelContext createCamelContext() throws Exception { CamelContext camelContext = super.createCamelContext(); -camelContext.addComponent("amqp1-0", amqpComponent("amqp://localhost:5672")); +camelContext.addComponent("amqp", amqpComponent("amqp://localhost:" + amqpPort)); return camelContext; } protected RouteBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { public void configure() throws Exception { -from("amqp1-0:queue:ping") +from("amqp:queue:ping") .to("log:routing") .to("mock:result"); -from("amqp1-0:queue:inOut") +from("amqp:queue:inOut") .setBody().constant("response"); -from("amqp1-0:topic:ping") +from("amqp:topic:ping") .to("log:routing") .to("mock:result"); -from("amqp1-0:topic:ping") +from("amqp:topic:ping") .to("log:routing") .to("mock:result"); }
[12/13] camel git commit: [camel-amqp] Added missing topic pre-configuration.
[camel-amqp] Added missing topic pre-configuration. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/4d169c98 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4d169c98 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4d169c98 Branch: refs/heads/camel-2.16.x Commit: 4d169c984b1b94c9e24532dc29ef05f4418af120 Parents: 6987fb9 Author: Henryk KonsekAuthored: Thu Dec 3 13:27:46 2015 +0100 Committer: Andrea Cosentino Committed: Mon Feb 29 09:30:00 2016 +0100 -- .../main/java/org/apache/camel/component/amqp/AMQPComponent.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/4d169c98/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java -- diff --git a/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java b/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java index dc4c2ed..6dd8226 100644 --- a/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java +++ b/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java @@ -55,7 +55,9 @@ public class AMQPComponent extends JmsComponent { Set connectionDetails = getCamelContext().getRegistry().findByType(AMQPConnectionDetails.class); if (connectionDetails.size() == 1) { AMQPConnectionDetails details = connectionDetails.iterator().next(); -setConnectionFactory(new JmsConnectionFactory(details.username(), details.password(), details.uri())); +JmsConnectionFactory connectionFactory = new JmsConnectionFactory(details.username(), details.password(), details.uri()); +connectionFactory.setTopicPrefix("topic://"); +setConnectionFactory(connectionFactory); } super.doStart(); }
[05/13] camel git commit: Added AMQP topic tests.
Added AMQP topic tests. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1b0ce863 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1b0ce863 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1b0ce863 Branch: refs/heads/camel-2.16.x Commit: 1b0ce863408ddde61bb581f0dc643abc8dac65cd Parents: 7722901 Author: Henryk KonsekAuthored: Tue Dec 1 16:37:20 2015 +0100 Committer: Andrea Cosentino Committed: Mon Feb 29 09:27:56 2016 +0100 -- .../camel/component/amqp/AMQPRouteTest.java | 30 +++- 1 file changed, 23 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/1b0ce863/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java -- diff --git a/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java b/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java index e78e035..e2a6f15 100644 --- a/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java +++ b/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java @@ -24,23 +24,31 @@ import org.apache.camel.test.junit4.CamelTestSupport; import org.junit.Before; import org.junit.Test; -import static org.apache.camel.component.amqp.AMQPComponent.amqpComponent; +import static org.apache.camel.component.amqp.AMQPComponent.amqp10Component; public class AMQPRouteTest extends CamelTestSupport { + protected MockEndpoint resultEndpoint; + protected BrokerService broker; - -@Test -public void testJmsRouteWithTextMessage() throws Exception { -String expectedBody = "Hello there!"; -resultEndpoint.reset(); +String expectedBody = "Hello there!"; + +@Test +public void testJmsQueue() throws Exception { resultEndpoint.expectedMessageCount(1); resultEndpoint.message(0).header("cheese").isEqualTo(123); template.sendBodyAndHeader("amqp1-0:queue:ping", expectedBody, "cheese", 123); resultEndpoint.assertIsSatisfied(); } +@Test +public void testJmsTopic() throws Exception { +resultEndpoint.expectedMessageCount(2); +resultEndpoint.message(0).header("cheese").isEqualTo(123); +template.sendBodyAndHeader("amqp1-0:topic:ping", expectedBody, "cheese", 123); +resultEndpoint.assertIsSatisfied(); +} @Before public void setUp() throws Exception { @@ -61,7 +69,7 @@ public class AMQPRouteTest extends CamelTestSupport { protected CamelContext createCamelContext() throws Exception { CamelContext camelContext = super.createCamelContext(); -camelContext.addComponent("amqp1-0", amqpComponent("amqp://localhost:5672", false)); +camelContext.addComponent("amqp1-0", amqp10Component("amqp://localhost:5672")); return camelContext; } @@ -71,6 +79,14 @@ public class AMQPRouteTest extends CamelTestSupport { from("amqp1-0:queue:ping") .to("log:routing") .to("mock:result"); + +from("amqp1-0:topic:ping") +.to("log:routing") +.to("mock:result"); + +from("amqp1-0:topic:ping") +.to("log:routing") +.to("mock:result"); } }; }
[11/13] camel git commit: [camel-amqp] Added AMQP connection details.
[camel-amqp] Added AMQP connection details. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/6987fb90 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6987fb90 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6987fb90 Branch: refs/heads/camel-2.16.x Commit: 6987fb909b2880eacda9fff22e936358d71497fa Parents: 160f02d Author: Henryk KonsekAuthored: Thu Dec 3 13:16:30 2015 +0100 Committer: Andrea Cosentino Committed: Mon Feb 29 09:29:40 2016 +0100 -- .../camel/component/amqp/AMQPComponent.java | 13 ++ .../component/amqp/AMQPConnectionDetails.java | 49 .../camel/component/amqp/AMQPRouteTest.java | 36 +- 3 files changed, 86 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/6987fb90/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java -- diff --git a/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java b/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java index 8dcf7e6..dc4c2ed 100644 --- a/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java +++ b/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java @@ -17,6 +17,7 @@ package org.apache.camel.component.amqp; import java.net.MalformedURLException; +import java.util.Set; import javax.jms.ConnectionFactory; import org.apache.camel.CamelContext; @@ -47,6 +48,18 @@ public class AMQPComponent extends JmsComponent { setConnectionFactory(connectionFactory); } +// Life-cycle + +@Override +protected void doStart() throws Exception { +Set connectionDetails = getCamelContext().getRegistry().findByType(AMQPConnectionDetails.class); +if (connectionDetails.size() == 1) { +AMQPConnectionDetails details = connectionDetails.iterator().next(); +setConnectionFactory(new JmsConnectionFactory(details.username(), details.password(), details.uri())); +} +super.doStart(); +} + // Factory methods /** http://git-wip-us.apache.org/repos/asf/camel/blob/6987fb90/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPConnectionDetails.java -- diff --git a/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPConnectionDetails.java b/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPConnectionDetails.java new file mode 100644 index 000..545bd27 --- /dev/null +++ b/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPConnectionDetails.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.amqp; + +public class AMQPConnectionDetails { + +private final String uri; + +private final String username; + +private final String password; + +public AMQPConnectionDetails(String uri, String username, String password) { +this.uri = uri; +this.username = username; +this.password = password; +} + +public AMQPConnectionDetails(String uri) { +this(uri, null, null); +} + +public String uri() { +return uri; +} + +public String username() { +return username; +} + +public String password() { +return password; +} + +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/6987fb90/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java -- diff --git a/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java b/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java index
[06/13] camel git commit: [CAMEL-9381] Upgraded AMQP factory methods.
[CAMEL-9381] Upgraded AMQP factory methods. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/57f3ce7f Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/57f3ce7f Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/57f3ce7f Branch: refs/heads/camel-2.16.x Commit: 57f3ce7f1c52a0bdc724c368009bb4c864b0e453 Parents: 1b0ce86 Author: Henryk KonsekAuthored: Tue Dec 1 17:14:21 2015 +0100 Committer: Andrea Cosentino Committed: Mon Feb 29 09:28:14 2016 +0100 -- .../camel/component/amqp/AMQPComponent.java | 23 .../camel/component/amqp/AMQPRouteTest.java | 4 ++-- 2 files changed, 11 insertions(+), 16 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/57f3ce7f/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java -- diff --git a/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java b/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java index 383b960..e326cf44 100644 --- a/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java +++ b/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java @@ -47,22 +47,17 @@ public class AMQPComponent extends JmsComponent { setConnectionFactory(connectionFactory); } -public static Component amqpComponent(String uri, boolean old) throws MalformedURLException, URISyntaxException { -if (old) { -return amqpComponentOld(uri); -} -return new AMQPComponent(new JmsConnectionFactory(uri)); -} - -public static Component amqpComponentOld(String uri) throws URISyntaxException { -return new AMQPComponent(new JmsConnectionFactory(uri)); -} - -public static Component amqpComponent(String uri) throws MalformedURLException { -return new AMQPComponent(new JmsConnectionFactory(uri)); +/** + * Use {@code amqpComponent(String uri)} instead. + */ +@Deprecated +public static AMQPComponent amqp10Component(String uri) throws MalformedURLException { +JmsConnectionFactory connectionFactory = new JmsConnectionFactory(uri); +connectionFactory.setTopicPrefix("topic://"); +return new AMQPComponent(connectionFactory); } -public static AMQPComponent amqp10Component(String uri) throws MalformedURLException { +public static AMQPComponent amqpComponent(String uri) { JmsConnectionFactory connectionFactory = new JmsConnectionFactory(uri); connectionFactory.setTopicPrefix("topic://"); return new AMQPComponent(connectionFactory); http://git-wip-us.apache.org/repos/asf/camel/blob/57f3ce7f/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java -- diff --git a/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java b/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java index e2a6f15..73ac9e0 100644 --- a/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java +++ b/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java @@ -24,7 +24,7 @@ import org.apache.camel.test.junit4.CamelTestSupport; import org.junit.Before; import org.junit.Test; -import static org.apache.camel.component.amqp.AMQPComponent.amqp10Component; +import static org.apache.camel.component.amqp.AMQPComponent.amqpComponent; public class AMQPRouteTest extends CamelTestSupport { @@ -69,7 +69,7 @@ public class AMQPRouteTest extends CamelTestSupport { protected CamelContext createCamelContext() throws Exception { CamelContext camelContext = super.createCamelContext(); -camelContext.addComponent("amqp1-0", amqp10Component("amqp://localhost:5672")); +camelContext.addComponent("amqp1-0", amqpComponent("amqp://localhost:5672")); return camelContext; }
[03/13] camel git commit: [CAMEL-9381] Upgraded AMQP to qpid-jms-client.
[CAMEL-9381] Upgraded AMQP to qpid-jms-client. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/6bc17f21 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6bc17f21 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6bc17f21 Branch: refs/heads/camel-2.16.x Commit: 6bc17f21362834c9b244a9228a4946fcae6c Parents: 84a4332 Author: Henryk KonsekAuthored: Tue Dec 1 16:30:22 2015 +0100 Committer: Andrea Cosentino Committed: Mon Feb 29 09:26:46 2016 +0100 -- components/camel-amqp/pom.xml | 22 ++-- .../camel/component/amqp/AMQPComponent.java | 11 ++-- .../camel/component/amqp/AMQPRouteTest.java | 20 +++ .../camel-amqp/src/test/resources/config.json | 27 - .../camel-amqp/src/test/resources/log4j.xml | 37 - components/camel-amqp/src/test/resources/passwd | 23 .../src/test/resources/virtualhosts.xml | 58 parent/pom.xml | 1 + .../features/src/main/resources/features.xml| 4 +- 9 files changed, 34 insertions(+), 169 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/6bc17f21/components/camel-amqp/pom.xml -- diff --git a/components/camel-amqp/pom.xml b/components/camel-amqp/pom.xml index c2f6891..0bc653d 100644 --- a/components/camel-amqp/pom.xml +++ b/components/camel-amqp/pom.xml @@ -30,6 +30,13 @@ Camel AMQP component which is based on the Apache Qid project + + + org.apache.qpid.jms, + ${camel.osgi.import.defaults}, + * + org.apache.camel.component.amqp.* org.apache.camel.spi.ComponentResolver;component=amqp @@ -46,8 +53,8 @@ org.apache.qpid - qpid-amqp-1-0-client-jms - ${qpid-version} + qpid-jms-client + ${qpid-jms-client-version} org.apache.qpid @@ -57,9 +64,14 @@ - org.apache.qpid - qpid-broker - ${qpid-version} + org.apache.activemq + activemq-broker + test + + + org.apache.activemq + activemq-amqp + ${activemq-version} test http://git-wip-us.apache.org/repos/asf/camel/blob/6bc17f21/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java -- diff --git a/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java b/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java index 6397fd4..383b960 100644 --- a/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java +++ b/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java @@ -24,8 +24,7 @@ import org.apache.camel.CamelContext; import org.apache.camel.Component; import org.apache.camel.component.jms.JmsComponent; import org.apache.camel.component.jms.JmsConfiguration; -import org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl; -import org.apache.qpid.client.AMQConnectionFactory; +import org.apache.qpid.jms.JmsConnectionFactory; /** * This component supports the AMQP protocol using the Client API of the Apache Qpid project. @@ -52,19 +51,19 @@ public class AMQPComponent extends JmsComponent { if (old) { return amqpComponentOld(uri); } -return new AMQPComponent(ConnectionFactoryImpl.createFromURL(uri)); +return new AMQPComponent(new JmsConnectionFactory(uri)); } public static Component amqpComponentOld(String uri) throws URISyntaxException { -return new AMQPComponent(new AMQConnectionFactory(uri)); +return new AMQPComponent(new JmsConnectionFactory(uri)); } public static Component amqpComponent(String uri) throws MalformedURLException { -return new AMQPComponent(ConnectionFactoryImpl.createFromURL(uri)); +return new AMQPComponent(new JmsConnectionFactory(uri)); } public static AMQPComponent amqp10Component(String uri) throws MalformedURLException { -ConnectionFactoryImpl connectionFactory = ConnectionFactoryImpl.createFromURL(uri); +JmsConnectionFactory connectionFactory = new JmsConnectionFactory(uri); connectionFactory.setTopicPrefix("topic://"); return new AMQPComponent(connectionFactory); } http://git-wip-us.apache.org/repos/asf/camel/blob/6bc17f21/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java -- diff --git
[10/13] camel git commit: [camel-amqp] Added extra tests.
[camel-amqp] Added extra tests. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/160f02d3 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/160f02d3 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/160f02d3 Branch: refs/heads/camel-2.16.x Commit: 160f02d315b7792c3ec4afd86fa1029594a8c254 Parents: 940077a Author: Henryk KonsekAuthored: Thu Dec 3 12:57:57 2015 +0100 Committer: Andrea Cosentino Committed: Mon Feb 29 09:29:28 2016 +0100 -- .../camel/component/amqp/AMQPRouteTest.java | 22 1 file changed, 22 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/160f02d3/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java -- diff --git a/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java b/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java index ce89bc6..3ed0935 100644 --- a/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java +++ b/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java @@ -20,6 +20,7 @@ import org.apache.activemq.broker.BrokerService; import org.apache.camel.CamelContext; import org.apache.camel.EndpointInject; import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.jms.JmsConstants; import org.apache.camel.component.mock.MockEndpoint; import org.apache.camel.test.AvailablePortFinder; import org.apache.camel.test.junit4.CamelTestSupport; @@ -75,6 +76,23 @@ public class AMQPRouteTest extends CamelTestSupport { resultEndpoint.assertIsSatisfied(); } +@Test +public void testPrefixWildcard() throws Exception { +resultEndpoint.expectedMessageCount(1); +template.sendBody("amqp:wildcard.foo.bar", expectedBody); +resultEndpoint.assertIsSatisfied(); +} + +@Test +public void testIncludeDestination() throws Exception { +resultEndpoint.expectedMessageCount(1); +resultEndpoint.message(0).header("JMSDestination").isEqualTo("ping"); +template.sendBody("amqp:queue:ping", expectedBody); +resultEndpoint.assertIsSatisfied(); +} + +// Routes fixtures + protected CamelContext createCamelContext() throws Exception { CamelContext camelContext = super.createCamelContext(); camelContext.addComponent("amqp", amqpComponent("amqp://localhost:" + amqpPort)); @@ -98,6 +116,10 @@ public class AMQPRouteTest extends CamelTestSupport { from("amqp:topic:ping") .to("log:routing") .to("mock:result"); + +from("amqp:queue:wildcard.>") +.to("log:routing") +.to("mock:result"); } }; }
[13/13] camel git commit: [CAMEL-9388] Provide properties-based AMQP connection discovery.
[CAMEL-9388] Provide properties-based AMQP connection discovery. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/975e8808 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/975e8808 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/975e8808 Branch: refs/heads/camel-2.16.x Commit: 975e8808410a7e2c2bdd8f0ab5982ea88fae0b28 Parents: 4d169c9 Author: Henryk KonsekAuthored: Thu Dec 3 16:04:36 2015 +0100 Committer: Andrea Cosentino Committed: Mon Feb 29 09:30:14 2016 +0100 -- .../component/amqp/AMQPConnectionDetails.java | 38 .../camel/component/amqp/AMQPRouteTest.java | 8 - 2 files changed, 45 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/975e8808/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPConnectionDetails.java -- diff --git a/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPConnectionDetails.java b/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPConnectionDetails.java index 545bd27..fa06b5b 100644 --- a/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPConnectionDetails.java +++ b/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPConnectionDetails.java @@ -16,8 +16,19 @@ */ package org.apache.camel.component.amqp; +import org.apache.camel.CamelContext; +import org.apache.camel.component.properties.PropertiesComponent; + public class AMQPConnectionDetails { +public static final String AMQP_HOST = "AMQP_SERVICE_HOST"; + +public static final String AMQP_PORT = "AMQP_SERVICE_PORT"; + +public static final String AMQP_USERNAME = "AMQP_SERVICE_USERNAME"; + +public static final String AMQP_PASSWORD = "AMQP_SERVICE_PASSWORD"; + private final String uri; private final String username; @@ -34,6 +45,21 @@ public class AMQPConnectionDetails { this(uri, null, null); } +public static AMQPConnectionDetails discoverAMQP(CamelContext camelContext) { +try { +PropertiesComponent propertiesComponent = camelContext.getComponent("properties", PropertiesComponent.class); + +String host = property(propertiesComponent, AMQP_HOST, "localhost"); +int port = Integer.parseInt(property(propertiesComponent, AMQP_PORT , "5672")); +String username = property(propertiesComponent, AMQP_USERNAME, null); +String password = property(propertiesComponent, AMQP_PASSWORD, null); + +return new AMQPConnectionDetails("amqp://" + host + ":" + port, username, password); +} catch (Exception e) { +throw new RuntimeException(e); +} +} + public String uri() { return uri; } @@ -46,4 +72,16 @@ public class AMQPConnectionDetails { return password; } +// Helpers + +private static String property(PropertiesComponent propertiesComponent, String key, String defaultValue) { +try { +return propertiesComponent.parseUri(propertiesComponent.getPrefixToken() + key + propertiesComponent.getSuffixToken()); +} catch (IllegalArgumentException e) { +return defaultValue; +} catch (Exception e) { +throw new RuntimeException(e); +} +} + } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/975e8808/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java -- diff --git a/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java b/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java index fa7319d..e7303fc 100644 --- a/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java +++ b/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java @@ -22,6 +22,7 @@ import org.apache.camel.EndpointInject; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.mock.MockEndpoint; import org.apache.camel.impl.JndiRegistry; +import org.apache.camel.impl.PropertyPlaceholderDelegateRegistry; import org.apache.camel.test.AvailablePortFinder; import org.apache.camel.test.junit4.CamelTestSupport; import org.junit.AfterClass; @@ -29,6 +30,8 @@ import org.junit.BeforeClass; import org.junit.Test; import static org.apache.camel.component.amqp.AMQPComponent.amqpComponent; +import static org.apache.camel.component.amqp.AMQPConnectionDetails.AMQP_PORT; +import static
[01/13] camel git commit: Updated Javadoc.
Repository: camel Updated Branches: refs/heads/camel-2.16.x c7e57023e -> 975e88084 Updated Javadoc. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2e8a0134 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2e8a0134 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2e8a0134 Branch: refs/heads/camel-2.16.x Commit: 2e8a0134f65fc31918655d744051cf9b62a8c6ef Parents: c7e5702 Author: Henryk KonsekAuthored: Fri Oct 9 10:11:13 2015 +0200 Committer: Andrea Cosentino Committed: Mon Feb 29 09:26:09 2016 +0100 -- .../main/java/org/apache/camel/component/amqp/AMQPEndpoint.java | 4 1 file changed, 4 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/2e8a0134/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPEndpoint.java -- diff --git a/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPEndpoint.java b/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPEndpoint.java index ce630f6..4fb5c9e 100644 --- a/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPEndpoint.java +++ b/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPEndpoint.java @@ -22,6 +22,10 @@ import org.apache.camel.spi.UriEndpoint; @UriEndpoint(scheme = "amqp", extendsScheme = "jms", title = "AMQP", syntax = "amqp:destinationType:destinationName", consumerClass = JmsConsumer.class, label = "messaging") +/** + * AMQP endpoint. This class extends JmsEndpoint because it uses Apache Qpid JMS-compatible client for + * performing the AMQP connectivity. + */ public class AMQPEndpoint extends JmsEndpoint { }
[08/13] camel git commit: [camel-amqp] Added extra factory methods.
[camel-amqp] Added extra factory methods. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a7f18460 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a7f18460 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a7f18460 Branch: refs/heads/camel-2.16.x Commit: a7f184603c16081b23b4edbc4e329f41582eb88a Parents: dc712e4 Author: Henryk KonsekAuthored: Thu Dec 3 12:15:50 2015 +0100 Committer: Andrea Cosentino Committed: Mon Feb 29 09:28:54 2016 +0100 -- .../org/apache/camel/component/amqp/AMQPComponent.java| 10 ++ 1 file changed, 10 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/a7f18460/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java -- diff --git a/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java b/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java index 3100e20..8dcf7e6 100644 --- a/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java +++ b/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java @@ -29,6 +29,8 @@ import org.apache.qpid.jms.JmsConnectionFactory; */ public class AMQPComponent extends JmsComponent { +// Constructors + public AMQPComponent() { super(AMQPEndpoint.class); } @@ -45,6 +47,8 @@ public class AMQPComponent extends JmsComponent { setConnectionFactory(connectionFactory); } +// Factory methods + /** * Use {@code amqpComponent(String uri)} instead. */ @@ -61,4 +65,10 @@ public class AMQPComponent extends JmsComponent { return new AMQPComponent(connectionFactory); } +public static AMQPComponent amqpComponent(String uri, String username, String password) { +JmsConnectionFactory connectionFactory = new JmsConnectionFactory(username, password, uri); +connectionFactory.setTopicPrefix("topic://"); +return new AMQPComponent(connectionFactory); +} + }