svn commit: r989037 [3/3] - in /websites/production/camel/content: cache/main.pageCache camel-2180-release.html eip.html enterprise-integration-patterns.html spring-boot-example.html
Modified: websites/production/camel/content/enterprise-integration-patterns.html == --- websites/production/camel/content/enterprise-integration-patterns.html (original) +++ websites/production/camel/content/enterprise-integration-patterns.html Tue May 24 13:18:43 2016 @@ -75,7 +75,7 @@ -Enterprise Integration PatternsCamel supports most of the http://www.eaipatterns.com/toc.html; rel="nofollow">Enterprise Integration Patterns from the excellent book by http://www.amazon.com/exec/obidos/search-handle-url/105-9796798-8100401?%5Fencoding=UTF8search-type=ssindex=booksfield-author=Gregor%20Hohpe; rel="nofollow">Gregor Hohpe and http://www.amazon.com/exec/obidos/search-handle-url/105-9796798-8100401?%5Fencoding=UTF8search-type=ssindex=booksfield-author=Bobby%20Woolf; rel="nofollow">Bobby Woolf.If you are new to Camel you might want to try the Getting Started in the User Guide before attempti ng to implement these patterns.The EIP icons library is available as a Visio stencil file adapted to render the icons with the Camel color : sand. Download it here for your presentation, functional and technical analysis documents. The original EIP stencil is also available in OpenOffice 3.x Draw (thanks to Marco Garbelini) , http://www.eaipatterns.com/download/EIP_Visio_stencil.zip; rel="nofollow">Microsoft Visio, or http://www.graffletopia.com/stencils/137; rel="nofollow">Omnigraffle.Messaging Systemshttp://www.eaipatterns.com/img/ChannelIcon.gif; data-image-src="http://www.eaipatterns.com/img/Channe lIcon.gif">Message ChannelHow does one application communicate with another using messaging?http://www.eaipatterns.com/img/MessageIcon.gif; data-image-src="http://www.eaipatterns.com/img/MessageIcon.gif;>MessageHow can two applications connected by a message channel exchange a piece of information?http://www.eaipatterns.com/img/PipesAndFiltersIcon.gif; data-image-src="http://www.eaipatterns.com/img/PipesAndFiltersIcon.gif;>Pipes and FiltersHow can we perform complex processing on a message while maintaining independence and flexibility?http://www.eaipatterns.com/img/ContentBasedRouterIcon.gif; data-image-src="http://www.eaipatterns.com/img/ContentBasedRouterIcon.gif;>Message RouterHow can you decouple individual p rocessing steps so that messages can be passed to different filters depending on a set of conditions?http://www.eaipatterns.com/img/MessageTranslatorIcon.gif; data-image-src="http://www.eaipatterns.com/img/MessageTranslatorIcon.gif;>Message TranslatorHow can systems using different data formats communicate with each other using messaging?http://www.eaipatterns.com/img/MessageEndpointIcon.gif; data-image-src="http://www.eaipatterns.co m/img/MessageEndpointIcon.gif">Message EndpointHow does an application connect to a messaging channel to send and receive messages?Messaging Channelshttp://www.eaipatterns.com/img/PointToPointIcon.gif; data-image-src="http://www.eaipatterns.com/img/PointToPointIcon.gif;>Point to Point ChannelHow ca n the caller be sure that exactly one receiver will receive the document or perform the call?http://www.eaipatterns.com/img/PublishSubscribeIcon.gif; data-image-src="http://www.eaipatterns.com/img/PublishSubscribeIcon.gif;>Publish Subscribe ChannelHow can the sender broadcast an event to all interested receivers?http://www.eaipatterns.com/img/DeadLetterChannelIcon.gif; data-image-src="http://www.eaipatterns.com/img/DeadLetterC hannelIcon.gif">Dead Letter ChannelWhat will the messaging system do with a message it cannot deliver?http://www.eaipatterns.com/img/GuaranteedMessagingIcon.gif; data-image-src="http://www.eaipatterns.com/img/GuaranteedMessagingIcon.gif;>Guaranteed DeliveryHow can the sender make sure that a message will be delivered, even if the messaging system fails?http://www.eaipatterns.com/img/MessageBusIcon.gif; data-image-src="http://www.eaipatterns.com/img/MessageBusIcon.gif;>Message BusWhat is an architecture that enables separate applications to work together, but in a de-coupled fashion such that applications can be easily added or removed without affecting the others?Message Constructionhttp://www.eaipatterns.com/img/EventMessageIcon.g if" data-image-src="http://www.eaipatterns.com/img/EventMessageIcon.gif;>Event MessageHow can messaging be used to transmit events from one application to another?http://www.eaipatterns.com/img/RequestReplyIcon.gif; data-image-src="http://www.eaipatterns.com/img/RequestReplyIcon.gif;>Request ReplyWhen an application sends a message, how can it get a response from the receiver?http://www.eaipatterns.com/img/CorrelationIdentifierIcon.gif; data-image-src="http://www.eaipatterns.com/img/CorrelationIdentifierIcon.gif;>Correlation IdentifierHow does a requestor that has received a reply know which request this is the reply for?http://www.eaipatterns.com/img/ReturnAddressIcon.gif;
svn commit: r989037 [2/3] - in /websites/production/camel/content: cache/main.pageCache camel-2180-release.html eip.html enterprise-integration-patterns.html spring-boot-example.html
Modified: websites/production/camel/content/eip.html == --- websites/production/camel/content/eip.html (original) +++ websites/production/camel/content/eip.html Tue May 24 13:18:43 2016 @@ -75,7 +75,7 @@ -Enterprise Integration PatternsCamel supports most of the http://www.eaipatterns.com/toc.html; rel="nofollow">Enterprise Integration Patterns from the excellent book by http://www.amazon.com/exec/obidos/search-handle-url/105-9796798-8100401?%5Fencoding=UTF8search-type=ssindex=booksfield-author=Gregor%20Hohpe; rel="nofollow">Gregor Hohpe and http://www.amazon.com/exec/obidos/search-handle-url/105-9796798-8100401?%5Fencoding=UTF8search-type=ssindex=booksfield-author=Bobby%20Woolf; rel="nofollow">Bobby Woolf.If you are new to Camel you might want to try the Getting Started in the User Guide before attempting to implement these patt erns.The EIP icons library is available as a Visio stencil file adapted to render the icons with the Camel color : sand. Download it here for your presentation, functional and technical analysis documents. The original EIP stencil is also available in OpenOffice 3.x Draw (thanks to Marco Garbelini) , http://www.eaipatterns.com/download/EIP_Visio_stencil.zip; rel="nofollow">Microsoft Visio, or http://www.graffletopia.com/stencils/137; rel="nofollow">Omnigraffle.Messaging Systemshttp://www.eaipatterns.com/img/ChannelIcon.gif; data-image-src="http://www.eaipatterns.com/img/ChannelIcon.gif;>Message ChannelHow does one application communicate with another using messaging?http://www.eaipatterns.com/img/MessageIcon.gif; data-image-src="http://www.eaipatterns.com/img/MessageIcon.gif;>MessageHow can two applications connected by a message channel exchange a piece of information?http://www.eaipatterns.com/img/PipesAndFiltersIcon.gif; data-image-src="http://w ww.eaipatterns.com/img/PipesAndFiltersIcon.gif">Pipes and FiltersHow can we perform complex processing on a message while maintaining independence and flexibility?http://www.eaipatterns.com/img/ContentBasedRouterIcon.gif; data-image-src="http://www.eaipatterns.com/img/ContentBasedRouterIcon.gif;>Message RouterHow can you decouple individual processing steps so that messages can be passed to different filters depending on a set of conditions?http://www.eaipatterns.com/img/MessageTranslatorIcon.gif; data-image-src="http://www.eaipatterns.com/img/MessageTranslatorIcon.gif;>Message TranslatorHow can systems using different data formats communicate with each other using messaging?http://www.eaipatterns.com/img/MessageEndpointIcon.gif; data-image-src="http://www.eaipatterns.com/img/MessageEndpointIcon.gif;>Message EndpointHow does an application connect to a messaging channel to send and receive messages?Messaging Channelshttp://www.eaipatterns.com/img/PointToPointIcon.gif; data-image-src="http://www.eaipatterns.com/img/PointToPointIcon.gif;>Point to Point ChannelHow can the caller be sure that exactly one receiver will receive the document or perform the call?http://www.eaipatterns.com/img/PublishSubscribeIcon.gif; data-image-src="http://www.eaipatterns.com/img/PublishSubscribeIcon.gif;>Publish Subscribe ChannelHow can the sender broadcast an event to all interested receivers?http://www.eaipatterns.com/img/DeadLetterChannelIcon.gif; data-image-src="http://www.eaipatterns.com/img/DeadLetterChannelIcon.gif;>De ad Letter ChannelWhat will the messaging system do with a message it cannot deliver?http://www.eaipatterns.com/img/GuaranteedMessagingIcon.gif; data-image-src="http://www.eaipatterns.com/img/GuaranteedMessagingIcon.gif;>Guaranteed DeliveryHow can the sender make sure that a message will be delivered, even if the messaging system fails?http://www.eaipatterns.com/img/Mes sageBusIcon.gif" data-image-src="http://www.eaipatterns.com/img/MessageBusIcon.gif;>Message BusWhat is an architecture that enables separate applications to work together, but in a de-coupled fashion such that applications can be easily added or removed without affecting the others?Message Constructionhttp://www.eaipatterns.com/img/EventMessageIcon.gif; data-image-src="http://www.eaipatterns.com/img/EventMessageIcon.gif;>Event MessageHow can messaging be used to transmit events from one application to another?http://www.eaipatterns.com/img/RequestReplyIcon.gif; data-image-src="http://www.eaipatterns.com/img/RequestReplyIcon.gif;>Request ReplyWhen an application sends a message, how can it get a response from the receiver?http://www.eaipatterns.com/img/CorrelationIdenti fierIcon.gif" data-image-src="http://www.eaipatterns.com/img/CorrelationIdentifierIcon.gif;>Correlation IdentifierHow does a requestor that has received a reply know which request this is the reply for?http://www.eaipatterns.com/img/ReturnAddressIcon.gif; data-image-src="http://www.eaipatterns.com/img/ReturnAddressIcon.gif;>Return AddressHow does a
svn commit: r989037 [1/3] - in /websites/production/camel/content: cache/main.pageCache camel-2180-release.html eip.html enterprise-integration-patterns.html spring-boot-example.html
Author: buildbot Date: Tue May 24 13:18:43 2016 New Revision: 989037 Log: Production update by buildbot for camel Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/camel-2180-release.html websites/production/camel/content/eip.html websites/production/camel/content/enterprise-integration-patterns.html websites/production/camel/content/spring-boot-example.html Modified: websites/production/camel/content/cache/main.pageCache == Binary files - no diff available. Modified: websites/production/camel/content/camel-2180-release.html == --- websites/production/camel/content/camel-2180-release.html (original) +++ websites/production/camel/content/camel-2180-release.html Tue May 24 13:18:43 2016 @@ -85,7 +85,7 @@ -Camel 2.18.0 release (currently in progress)http://camel.apache.org/download.data/camel-box-v1.0-150x200.png; data-image-src="http://camel.apache.org/download.data/camel-box-v1.0-150x200.png;>New and NoteworthyWelcome to the 2.18.0 release which approx XXX issues resolved (new features, improvements and bug fixes such as...)Added Hystrix EIP as EIP pattern that uses native Hystrix as the Circuit Breaker implementation.This requires havingcamel-hsytrixon the classpath.Improved theBean component to better match method parameter types when usingSimple language as parameter values.AddedBindyConverter that allows to implement custom data converters forBindyThe access in theRest DSL has been deprecated and no longer in use - its not part of swagger specification anymore.Camel-NATSnow uses JNATS client instead of the deprecated Java_nats one.During startup ofCamelContext the services that are used as part of routes are now deferred being started to the end of the startup process. Some IoC frameworks like Spring can otherwise causes a circular dependency issue if services are started too early. A side effect is that if service startup failures happen w hen being started later, they are now wrapped in the FailedToStartupRouteException to better pin point which route thas the problem.Improved the startup sequence ofSpring Java Config to be similar toSpring Boot that helps prevent Spring initialization errors about circular dependencies issues.Added PATCH toRest DSLAdded "starts with" and "ends with" operator to the Simplelanguage.AddedBeanIOSplitter toBeanIO that can be used with theSplitter EIP to split big payloads in streaming mode without reading the entire content into memory.Some of the AWScomponents allows to specify ARN in the endpoint configuration.The create operation inZookeeper now creates sub paths if missing.Added support for async mode forSERVLET component to leverage Asynchronous Servlet from the Servlet 3.0 spec.Beancomponent and Bean Languagevalidates method name must be a valid according to java identifier rules, and also if parameter syntax has an ending parenthesis.You can now use@RunWith(CamelSpringBootJUnit4ClassRunner.class) to test CamelSpring Bootapplications and use the Camel test annotations fromSpring Testing such as@MockEndpoints.To turn on logging exhausted message body with the message history you can configure this easily on the CamelContext level withsetLogExhaustedMessageBodyCamel-Infinispan now supports Aggregation Repository: InfinispanLocalAggregationRepository and InfinispanRemoteAggregationRepositoryTheSQL Componentand ElSqlnow supports outputType=StreamListto use an iterator for the output of the SQL query that allows to process the data in a streaming fashion such as with theSplitter EIP to process the data row by row, and load data from the database as needed.JPA now includes aJpaPollingConsumer implementation that better supportsContent Enricher usingpollEnrich to do a on-demand poll that returns either none, one or a list of entities as the result.CallingBeanwith method parameters defined usingSimple parameters, now avoids an intermediate conversion of the parameters to a String value. This ensures the passed in values when calling the bean method is using the parameter type as-is fromSimple.Camel CDI now supports importing Camel XML configuration filesCamel CDIdoes not deploy an empty Camel context bean anymore if not route builder beans nor Camel beans are deployedCamel CDIadds the@Named qualifier to Camel route management events so that it's possible to observe these events for a specific route with an explicit idCamel BeanIO now supports the possibility to use a custom BeanReaderErrorHandler implementation in his configurationCamel Kubernetes now supports Kubernetes ConfigMap featureTheTokenizer andXMLTokenizer language now supports using Simple expressions as the token / xml tag names so they can be dynamic values.AddedfilterDirectory andfilterFile
[1/4] camel git commit: CAMEL-9683: A new toService EIP that uses a client discovery to lookup alive services and pick a service ip/port to use when calling the service from Camel route. Allows to plu
Repository: camel Updated Branches: refs/heads/master f28b44edd -> 8447297a2 http://git-wip-us.apache.org/repos/asf/camel/blob/4b81b4ae/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/processor/RibbonProcessorFactory.java -- diff --git a/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/processor/RibbonProcessorFactory.java b/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/processor/RibbonProcessorFactory.java new file mode 100644 index 000..8b03a74 --- /dev/null +++ b/components/camel-ribbon/src/main/java/org/apache/camel/component/ribbon/processor/RibbonProcessorFactory.java @@ -0,0 +1,207 @@ +/** + * 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.ribbon.processor; + +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import com.netflix.loadbalancer.IRule; +import org.apache.camel.ExchangePattern; +import org.apache.camel.Processor; +import org.apache.camel.component.ribbon.RibbonConfiguration; +import org.apache.camel.model.ProcessorDefinition; +import org.apache.camel.model.PropertyDefinition; +import org.apache.camel.model.remote.RibbonConfigurationDefinition; +import org.apache.camel.model.remote.ServiceCallConfigurationDefinition; +import org.apache.camel.model.remote.ServiceCallDefinition; +import org.apache.camel.spi.ProcessorFactory; +import org.apache.camel.spi.RouteContext; +import org.apache.camel.spi.ServiceCallServerListStrategy; +import org.apache.camel.util.CamelContextHelper; +import org.apache.camel.util.IntrospectionSupport; + +/** + * {@link ProcessorFactory} that creates the Ribbon implementation of the ServiceCall EIP. + */ +public class RibbonProcessorFactory implements ProcessorFactory { + +@Override +public Processor createChildProcessor(RouteContext routeContext, ProcessorDefinition definition, boolean mandatory) throws Exception { +// not in use +return null; +} + +@Override +@SuppressWarnings("unchecked") +public Processor createProcessor(RouteContext routeContext, ProcessorDefinition definition) throws Exception { +if (definition instanceof ServiceCallDefinition) { +ServiceCallDefinition sc = (ServiceCallDefinition) definition; + +String name = sc.getName(); +String uri = sc.getUri(); +ExchangePattern mep = sc.getPattern(); + +RibbonConfigurationDefinition config = (RibbonConfigurationDefinition) sc.getServiceCallConfiguration(); +RibbonConfigurationDefinition configRef = null; +if (sc.getServiceCallConfigurationRef() != null) { +// lookup in registry first +configRef = CamelContextHelper.lookup(routeContext.getCamelContext(), sc.getServiceCallConfigurationRef(), RibbonConfigurationDefinition.class); +if (configRef == null) { +// and fallback as service configuration + routeContext.getCamelContext().getServiceCallConfiguration(sc.getServiceCallConfigurationRef(), RibbonConfigurationDefinition.class); +} +} + +// if no configuration explicit configured then use default +if (config == null && configRef == null) { +config = routeContext.getCamelContext().getServiceCallConfiguration(null, RibbonConfigurationDefinition.class); +} +if (config == null) { +// if no default then try to find if there configuration in the registry of the given type +Set set = routeContext.getCamelContext().getRegistry().findByType(RibbonConfigurationDefinition.class); +if (set.size() == 1) { +config = set.iterator().next(); +} +} + +if (config == null && configRef == null) { +throw new IllegalStateException("The ServiceCall: " + definition + " must be configured before it can be used."); +} + +// extract the properties from the configuration from the model +Map
[camel] Git Push Summary
Repository: camel Updated Branches: refs/heads/remoteServiceCall [deleted] 2801efd99
[4/4] camel git commit: Add missing components to release kit
Add missing components to release kit Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8447297a Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8447297a Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8447297a Branch: refs/heads/master Commit: 8447297a23203be0a39dcb971ef2c3c0f0f7909f Parents: 4b81b4a Author: Claus IbsenAuthored: Tue May 24 14:41:11 2016 +0200 Committer: Claus Ibsen Committed: Tue May 24 14:41:11 2016 +0200 -- apache-camel/pom.xml | 8 apache-camel/src/main/descriptors/common-bin.xml | 1 + parent/pom.xml | 5 + 3 files changed, 14 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/8447297a/apache-camel/pom.xml -- diff --git a/apache-camel/pom.xml b/apache-camel/pom.xml index fd86a54..8f2d51e 100644 --- a/apache-camel/pom.xml +++ b/apache-camel/pom.xml @@ -872,6 +872,14 @@ org.apache.camel + camel-tarfile + + + org.apache.camel + camel-telegram + + + org.apache.camel camel-test http://git-wip-us.apache.org/repos/asf/camel/blob/8447297a/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 ceac7f1..2858d54 100644 --- a/apache-camel/src/main/descriptors/common-bin.xml +++ b/apache-camel/src/main/descriptors/common-bin.xml @@ -228,6 +228,7 @@ org.apache.camel:camel-swagger org.apache.camel:camel-swagger-java org.apache.camel:camel-tagsoup +org.apache.camel:camel-tarfile org.apache.camel:camel-telegram org.apache.camel:camel-test org.apache.camel:camel-test-blueprint http://git-wip-us.apache.org/repos/asf/camel/blob/8447297a/parent/pom.xml -- diff --git a/parent/pom.xml b/parent/pom.xml index 6d911fe..b531621 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -1721,6 +1721,11 @@ org.apache.camel +camel-tarfile +${project.version} + + +org.apache.camel camel-telegram ${project.version}
[2/4] camel git commit: CAMEL-9683: A new toService EIP that uses a client discovery to lookup alive services and pick a service ip/port to use when calling the service from Camel route. Allows to plu
http://git-wip-us.apache.org/repos/asf/camel/blob/4b81b4ae/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/processor/KubernetesClientServiceCallProcessor.java -- diff --git a/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/processor/KubernetesClientServiceCallProcessor.java b/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/processor/KubernetesClientServiceCallProcessor.java new file mode 100644 index 000..f1af317 --- /dev/null +++ b/components/camel-kubernetes/src/main/java/org/apache/camel/component/kubernetes/processor/KubernetesClientServiceCallProcessor.java @@ -0,0 +1,251 @@ +/** + * 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.kubernetes.processor; + +import java.util.Collection; +import java.util.concurrent.RejectedExecutionException; + +import io.fabric8.kubernetes.client.AutoAdaptableKubernetesClient; +import io.fabric8.kubernetes.client.Config; +import io.fabric8.kubernetes.client.ConfigBuilder; +import org.apache.camel.AsyncCallback; +import org.apache.camel.AsyncProcessor; +import org.apache.camel.CamelContext; +import org.apache.camel.CamelContextAware; +import org.apache.camel.Exchange; +import org.apache.camel.ExchangePattern; +import org.apache.camel.Traceable; +import org.apache.camel.component.kubernetes.KubernetesConfiguration; +import org.apache.camel.component.kubernetes.KubernetesConstants; +import org.apache.camel.processor.SendDynamicProcessor; +import org.apache.camel.spi.IdAware; +import org.apache.camel.spi.ServiceCallLoadBalancer; +import org.apache.camel.spi.ServiceCallServerListStrategy; +import org.apache.camel.support.ServiceSupport; +import org.apache.camel.util.AsyncProcessorHelper; +import org.apache.camel.util.ObjectHelper; +import org.apache.camel.util.ServiceHelper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Kubernetes based implementation of the the ServiceCall EIP where the service lookup is client based. + */ +public class KubernetesClientServiceCallProcessor extends ServiceSupport implements AsyncProcessor, CamelContextAware, Traceable, IdAware { + +private static final Logger LOG = LoggerFactory.getLogger(KubernetesClientServiceCallProcessor.class); + +private CamelContext camelContext; +private String id; +private final String name; +private final String scheme; +private final String contextPath; +private final String namespace; +private final String uri; +private final ExchangePattern exchangePattern; +private final KubernetesConfiguration configuration; +private final KubernetesServiceCallExpression serviceCallExpression; +private ServiceCallServerListStrategy serverListStrategy; +private ServiceCallLoadBalancer loadBalancer; +private SendDynamicProcessor processor; + +public KubernetesClientServiceCallProcessor(String name, String namespace, String scheme, String uri, ExchangePattern exchangePattern, KubernetesConfiguration configuration) { +// setup from the provided name which can contain scheme and context-path information as well +String serviceName; +if (name.contains("/")) { +serviceName = ObjectHelper.before(name, "/"); +this.contextPath = ObjectHelper.after(name, "/"); +} else if (name.contains("?")) { +serviceName = ObjectHelper.before(name, "?"); +this.contextPath = ObjectHelper.after(name, "?"); +} else { +serviceName = name; +this.contextPath = null; +} +if (serviceName.contains(":")) { +this.scheme = ObjectHelper.before(serviceName, ":"); +this.name = ObjectHelper.after(serviceName, ":"); +} else { +this.scheme = scheme; +this.name = serviceName; +} + +// if no namespace configured then resolve from environment variables +if (namespace == null) { +this.namespace = System.getenv("KUBERNETES_NAMESPACE"); +} else { +this.namespace = namespace; +} +
[3/4] camel git commit: CAMEL-9683: A new toService EIP that uses a client discovery to lookup alive services and pick a service ip/port to use when calling the service from Camel route. Allows to plu
CAMEL-9683: A new toService EIP that uses a client discovery to lookup alive services and pick a service ip/port to use when calling the service from Camel route. Allows to plugin different providers. Added camel-ribbon as implementation as well. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/4b81b4ae Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4b81b4ae Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4b81b4ae Branch: refs/heads/master Commit: 4b81b4ae366928c3a2a07a0e103b95a19f3438d0 Parents: f28b44e Author: Claus IbsenAuthored: Tue May 24 13:18:39 2016 +0200 Committer: Claus Ibsen Committed: Tue May 24 14:38:54 2016 +0200 -- apache-camel/pom.xml| 4 + .../src/main/descriptors/common-bin.xml | 1 + .../java/org/apache/camel/CamelContext.java | 26 ++ .../apache/camel/impl/DefaultCamelContext.java | 34 ++ .../java/org/apache/camel/model/Constants.java | 1 + .../model/HystrixConfigurationDefinition.java | 3 + .../apache/camel/model/HystrixDefinition.java | 3 + .../apache/camel/model/ProcessorDefinition.java | 43 +++ .../KubernetesConfigurationDefinition.java | 364 +++ .../remote/RibbonConfigurationDefinition.java | 48 +++ .../ServiceCallConfigurationDefinition.java | 209 +++ .../model/remote/ServiceCallDefinition.java | 253 + .../apache/camel/model/remote/package-info.java | 23 ++ .../camel/spi/ServiceCallLoadBalancer.java | 36 ++ .../org/apache/camel/spi/ServiceCallServer.java | 36 ++ .../spi/ServiceCallServerListStrategy.java | 45 +++ .../support/ServiceCallExpressionSupport.java | 101 + .../org/apache/camel/model/remote/jaxb.index| 20 + .../blueprint/CamelContextFactoryBean.java | 4 + components/camel-kubernetes/pom.xml | 33 +- .../src/main/docs/kubernetes.adoc | 4 +- .../kubernetes/KubernetesConfiguration.java | 31 +- .../kubernetes/KubernetesConstants.java | 5 + .../kubernetes/KubernetesEndpoint.java | 21 +- .../consumer/KubernetesNamespacesConsumer.java | 4 +- .../consumer/KubernetesPodsConsumer.java| 4 +- ...ubernetesReplicationControllersConsumer.java | 4 +- .../consumer/KubernetesSecretsConsumer.java | 4 +- .../consumer/KubernetesServicesConsumer.java| 4 +- .../KubernetesClientServiceCallProcessor.java | 251 + .../KubernetesDnsServiceCallExpression.java | 81 + .../KubernetesDnsServiceCallProcessor.java | 155 ...bernetesEnvironmentServiceCallProcessor.java | 165 + .../processor/KubernetesProcessorFactory.java | 208 +++ .../kubernetes/processor/KubernetesServer.java | 41 +++ .../KubernetesServiceCallExpression.java| 40 ++ ...KubernetesServiceCallServerListStrategy.java | 106 ++ .../processor/RandomLoadBalancer.java | 40 ++ .../processor/RoundRobinBalancer.java | 44 +++ .../apache/camel/model/ServiceCallDefinition| 18 + .../processor/ServiceCallClientRouteTest.java | 62 .../ServiceCallEnvironmentRouteTest.java| 57 +++ .../SpringServiceCallClientRouteTest.java | 41 +++ .../SpringServiceCallEnvironmentRouteTest.java | 41 +++ .../src/test/resources/log4j.properties | 2 +- .../SpringServiceCallClientRouteTest.xml| 39 ++ .../SpringServiceCallEnvironmentRouteTest.xml | 38 ++ components/camel-ribbon/pom.xml | 89 + .../component/ribbon/RibbonConfiguration.java | 69 .../camel/component/ribbon/RibbonConstants.java | 25 ++ .../processor/RibbonProcessorFactory.java | 207 +++ .../ribbon/processor/RibbonServer.java | 33 ++ .../processor/RibbonServiceCallExpression.java | 40 ++ .../processor/RibbonServiceCallProcessor.java | 248 + ...bbonServiceCallStaticServerListStrategy.java | 98 + .../src/main/resources/META-INF/LICENSE.txt | 203 +++ .../src/main/resources/META-INF/NOTICE.txt | 11 + .../apache/camel/model/ServiceCallDefinition| 18 + .../ribbon/processor/RibbonServerListTest.java | 53 +++ .../RibbonServiceCallRegistryRouteTest.java | 57 +++ .../processor/RibbonServiceCallRouteTest.java | 65 .../RibbonServiceCallUpdateRouteTest.java | 90 + .../SpringRibbonServiceCallRouteTest.java | 46 +++ .../src/test/resources/log4j.properties | 37 ++ .../SpringRibbonServiceCallRouteTest.xml| 60 +++ .../camel/spring/CamelContextFactoryBean.java | 4 + .../spring/handler/CamelNamespaceHandler.java | 6 +- components/pom.xml | 1 + parent/pom.xml | 6 + 69 files changed, 4220
svn commit: r989033 - in /websites/production/camel/content: cache/main.pageCache servicecall-eip.html
Author: buildbot Date: Tue May 24 12:18:43 2016 New Revision: 989033 Log: Production update by buildbot for camel Added: websites/production/camel/content/servicecall-eip.html Modified: websites/production/camel/content/cache/main.pageCache Modified: websites/production/camel/content/cache/main.pageCache == Binary files - no diff available. Added: websites/production/camel/content/servicecall-eip.html == --- websites/production/camel/content/servicecall-eip.html (added) +++ websites/production/camel/content/servicecall-eip.html Tue May 24 12:18:43 2016 @@ -0,0 +1,216 @@ +http://www.w3.org/TR/html4/loose.dtd;> + + + + + + + + + + + + + .maincontent { overflow:hidden; } + + + + + + + + + + + + SyntaxHighlighter.defaults['toolbar'] = false; + SyntaxHighlighter.all(); + + + +Apache Camel: ServiceCall EIP + + + + + + + + + + + + + + + + + +http://camel.apache.org/;>Camel +http://www.apache.org;>Apache + + + + + + +Apache CamelDocumentationEnterprise Integration PatternsServiceCall EIP + + +Download | JavaDoc | Source | Forums | Support + + + + + + + +ServiceCall EIPAvailable as of Camel 2.18The serviceCall EIP allows to call remote services in a distributed system. The service to call is looked up in a service registry of some sorts such as Kubernetes, Consul, etcd, zookeeper.The EIP separates the configuration of the service registry from the calling of the service.Maven users will need to add the dependency for the service registry supported from the following:camel-kubernetescamel-ribbonEach implementation has their own set of configuration.SyntaxWhen calling a service you may just refer to the name of the service in the EIP as shown below: + +And in XML DSL: +http://camel.apache.org/schema/spring"> + <route> +<from uri="direct:start"/> +<serviceCall name="foo"/> +<to uri="mock:result"/> + </route> +</camelContext>]]> +Camel will then lookup a service with the name "foo" from the chosen Camel component that integrates with the service registry. The lookup returns a set of IP:PORT paris that refer to which active servers that host the remote service. Camel will then pick a random server to use and then build a Camel uri with the chosen IP and PORT number. By default Camel uses the HTTP component, so the example above will resolve into a Camel uri that is called by a dynamic to endpoint as shown: +http://IP:PORT") +Â +<toD uri="http:IP:port"/>]]> +You can also call the service using URI parameters such as beer=yes + +You can also provide a context-path such as shown: + +Service Name to Camel URI ExamplesSo as you can see above the service name is resolved as a Camel endpoint uri, and here is a few more examples (where - shows what the Camel uri is resolved as) +http://hostname:port +serviceCall("myService/foo") -> http://hostname:port/foo +serviceCall("http:myService/foo") -> http:hostname:port/foo +Â +<serviceCall name="myService"/> -> http://hostname:port +<serviceCall name="myService/foo"/> -> http://hostname:port/foo +<serviceCall name="http:myService/foo"/> -> http:hostname:port/foo]]> +If you want full control of the resolved URI you can provide an additional uri parameter where you specify the Camel uri as you want. In the uri you can use the service name which are then resolved to IP:PORT as shown: +
svn commit: r989029 [1/2] - in /websites/production/camel/content: book-architecture.html book-in-one-page.html cache/main.pageCache camel-2180-release.html component-list.html component.html componen
Author: buildbot Date: Tue May 24 11:19:43 2016 New Revision: 989029 Log: Production update by buildbot for camel Added: websites/production/camel/content/consul-component.html Modified: websites/production/camel/content/book-architecture.html websites/production/camel/content/book-in-one-page.html websites/production/camel/content/cache/main.pageCache websites/production/camel/content/camel-2180-release.html websites/production/camel/content/component-list.html websites/production/camel/content/component.html websites/production/camel/content/components.html websites/production/camel/content/transport.html websites/production/camel/content/uris.html Modified: websites/production/camel/content/book-architecture.html == --- websites/production/camel/content/book-architecture.html (original) +++ websites/production/camel/content/book-architecture.html Tue May 24 11:19:43 2016 @@ -192,7 +192,9 @@ Camel uses a Java based Uses the http://chemistry.apache.org/java/opencmis.html;>Apache Chemistry client API to interface with CMIS supporting CMSCometd / camel-cometd -Used to deliver messages using the http://docs.codehaus.org/display/JETTY/Cometd+(aka+Bayeux)" rel="nofollow">jetty cometd implementation of the http://svn.xantus.org/shortbus/trunk/bayeux/bayeux.html; rel="nofollow">bayeux protocolContext / camel-context +Used to deliver messages using the http://docs.codehaus.org/display/JETTY/Cometd+(aka+Bayeux)" rel="nofollow">jetty cometd implementation of the http://svn.xantus.org/shortbus/trunk/bayeux/bayeux.html; rel="nofollow">bayeux protocolConsul / camel-consul + +For interfacing with an https://www.consul.io/; rel="nofollow">Consul.Context / camel-context Used to refer to endpoints within a separate CamelContext to provide a simple black box composition approach so that routes can be combined into a CamelContext and then used as a black box component inside other routes in other CamelContextsControlBus / camel-core Modified: websites/production/camel/content/book-in-one-page.html == --- websites/production/camel/content/book-in-one-page.html (original) +++ websites/production/camel/content/book-in-one-page.html Tue May 24 11:19:43 2016 @@ -536,7 +536,9 @@ Camel uses a Java based Uses the http://chemistry.apache.org/java/opencmis.html;>Apache Chemistry client API to interface with CMIS supporting CMSCometd / camel-cometd -Used to deliver messages using the http://docs.codehaus.org/display/JETTY/Cometd+(aka+Bayeux)" rel="nofollow">jetty cometd implementation of the http://svn.xantus.org/shortbus/trunk/bayeux/bayeux.html; rel="nofollow">bayeux protocolContext / camel-context +Used to deliver messages using the http://docs.codehaus.org/display/JETTY/Cometd+(aka+Bayeux)" rel="nofollow">jetty cometd implementation of the http://svn.xantus.org/shortbus/trunk/bayeux/bayeux.html; rel="nofollow">bayeux protocolConsul / camel-consul + +For interfacing with an https://www.consul.io/; rel="nofollow">Consul.Context / camel-context Used to refer to endpoints within a separate CamelContext to provide a simple black box composition approach so that routes can be combined into a CamelContext and then used as a black box component inside other routes in other CamelContextsControlBus / camel-core @@ -3617,11 +3619,11 @@ The tutorial has been designed in two pa While not actual tutorials you might find working through the source of the various Examples useful. Tutorial on Spring Remoting with JMSThanksThis tutorial was kindly donated to Apache Camel by Martin Gilday.PrefaceThis tutorial aims to guide the reader through the stages of creating a project which uses Camel to facilitate the routing of messages from a JMS queue to a http://www.springramework.org; rel="nofollow">Spring service. The route works in a synchronous fashion returning a response to the client./**/ +/*]]>*/ Tutorial on Spring Remoting with JMSPrefacePrerequisitesDistributionAboutCreate the Camel Project Update the POM with Dependencies Writing the Server @@ -5736,11 +5738,11 @@ So we completed the last piece in the pi This example has
svn commit: r989029 [2/2] - in /websites/production/camel/content: book-architecture.html book-in-one-page.html cache/main.pageCache camel-2180-release.html component-list.html component.html componen
Added: websites/production/camel/content/consul-component.html == --- websites/production/camel/content/consul-component.html (added) +++ websites/production/camel/content/consul-component.html Tue May 24 11:19:43 2016 @@ -0,0 +1,197 @@ +http://www.w3.org/TR/html4/loose.dtd;> + + + + + + + + + + + + + .maincontent { overflow:hidden; } + + + + + + + + + + + + SyntaxHighlighter.defaults['toolbar'] = false; + SyntaxHighlighter.all(); + + + +Apache Camel: Consul Component + + + + + + + + + + + + + + + + + +http://camel.apache.org/;>Camel +http://www.apache.org;>Apache + + + + + + +Apache CamelDocumentationComponentsConsul Component + + +Download | JavaDoc | Source | Forums | Support + + + + + + + +https://www.consul.io/; rel="nofollow">Consulis a distributed, highly available, datacenter-aware, service discovery and configuration system.Maven users will need to add the following dependency to theirpom.xmlfor this component. + +URI format + +WhereapiEnpointrepresents the consul'shttps://www.consul.io/docs/agent/http.html; rel="nofollow">HTTP APIthe consul-component should operate on:Supported HTTP API are:https://www.consul.io/docs/agent/http/kv.html; rel="nofollow">kvhttps://www.consul.io/docs/agent/http/event.html; rel="nofollow">eventhttps://www.consul.io/docs/agent/http/agent.html; rel="nofollow">agentOptionsNameGroupDefaultJava TypeDescriptionurlcommonStringDefines the URIs the component should connect to.keycommonStringThe default key. Can be overridden by CamelConsulKeyactionproducerStringThe default action. Can be overridden by CamelConsulActionpingInstancecommontruebooleanConfigure if the AgentClient should attempt a ping before returning the Consul instancevalueAsStringcommonfalsebooleanDefault to transform values retrieved from Consul i.e. on KV endpoint to string.connectTimeoutMilliscommonLongConnect timeout for OkHttpClientreadTimeoutMilliscommonLongRead timeout for OkHttpClientwriteTimeoutMilliscommonLongWrite timeout for OkHttpClientsslContextParameterssecuritySSLContextParametersSSL configuration using an org.apache.camel.util.jsse.SSLContextParameters instanceuserNamesecurityStringSets the username to be used for basic authenticationpasswordsecurityStringSets the password to be used for basic authenticationaclTokensecurityStringSets the ACL token to be used with ConsulblockSecondsconsumer, watch10IntegerThe second to wait for a watch event default 10 secondsfirstIndexconsumer, watch0LongThe first index to watch forrecursiveconsumer, watchfalsebooleanRecursively watchHeadersNameJava TypeDescriptionCamelConsulActionStringThe action to performCamelConsulKeyStringThe Key on which the action should be appliedCamelConsulEventId< td colspan="1" rowspan="1" class="confluenceTd">StringThe event idCamelConsulEventNameStringThe event nameCamelConsulEventLTimeLongThe event ltimeCamelConsulNodeFilterStringThe node filterCamelConsulTagFilterStringThe tag filterCamelConsulSessionFilterStringThe session filterCamelConsulVersionIntegerThe data versionCamelConsulFlagsLongFlags associated with a valueCamelConsulCreateIndexLongThe internal index value that represents when the entry was createdCamelConsulLockIndexLongThe number of times this key has successfully been acquired in a lockCamelConsulModifyIndexLongThe last index that modified this keyCamelConsulOptionsObjectOptions associated to the requestCamelConsulResultBooleantrue if the response has a resultCamelConsulSessionStringThe session idCamelConsulValueAsStringBooleanTo transform values retrieved from Consul i.e. on KV endpoint to string.KV API example: + +Watch API example: +
svn commit: r989024 [2/4] - in /websites/production/camel/content: book-architecture.html book-component-appendix.html book-in-one-page.html cache/main.pageCache component-list.html component.html com
Modified: websites/production/camel/content/book-component-appendix.html == --- websites/production/camel/content/book-component-appendix.html (original) +++ websites/production/camel/content/book-component-appendix.html Tue May 24 10:19:41 2016 @@ -1017,11 +1017,11 @@ template.send(direct:alias-verify& ]]> See Also Configuring CamelComponentEndpointGetting StartedCrypto Crypto is also available as a Data Format CXF ComponentWhen using CXF as a consumer, the CXF Bean Component allows you to factor out how message payloads are received from their processing as a RESTful or SOAP web service. This has the potential of using a multitude of transports to cons ume web services. The bean component's configuration is also simpler and provides the fastest method to implement web services using Camel and CXF.When using CXF in streaming modes (see DataFormat option), then also read about Stream caching.The cxf: component provides integration with http://cxf.apache.org;>Apache CXF for connecting to JAX-WS services hosted in CXF./**/ +/*]]>*/ CXF Component URI formatOptions The descriptions of the dataformats @@ -8467,7 +8467,7 @@ ref:someName[?options] from(restlet:http://localhost:; + port + /securedOrders?restletMethod=postrestletRealm=#realm).process(new Processor() { public void process(Exchange exchange) throws Exception { exchange.getOut().setBody( -received [ + exchange.getIn().getBody() +received [ + exchange.getIn().getBody(String.class) + ] as an order id = + exchange.getIn().getHeader(id)); } @@ -8494,6 +8494,7 @@ final String id = 89531; MapString, Object headers = new HashMapString, Object(); headers.put(RestletConstants.RESTLET_LOGIN, admin); headers.put(RestletConstants.RESTLET_PASSWORD, foo); +headers.put(Exchange.CONTENT_TYPE, MediaType.APPLICATION_XML); headers.put(id, id); String response = template.requestBodyAndHeaders( @@ -9092,7 +9093,7 @@ protected RouteBuilder createRouteBuilde /dependency ]]> SMS limitationsSMS is neither reliable or secure. Users who require reliable and secure delivery may want to consider using the XMPP or SIP components instead, combined with a smartphone app supporting the chosen protocol.Reliability: although the SMPP standard offers a range of feedback mechanisms to indicate errors, non-delivery and confirmation of delivery it is not uncommon for mobile networks to hide or simulate these responses. For example, some networks automatically send a delivery confirmation for every message even if the destination number is invalid or not switched on. Some networks silently drop messages if they think they are spam. Spam detection rules in the network may be very crude, sometimes more than 100 messages per day from a single sender may be considered spam.Security: there is basic encryption for the last hop from the radio tower down to the recipi ent handset. SMS messages are not encrypted or authenticated in any other part of the network. Some operators allow staff in retail outlets or call centres to browse through the SMS message histories of their customers. Message sender identity can be easily forged. Regulators and even the mobile telephone industry itself has cautioned against the use of SMS in two-factor authentication schemes and other purposes where security is important.While the Camel component makes it as easy as possible to send messages to the SMS network, it can not offer an easy solution to these problems.Data coding, alphabet and international character setsData coding and alphabet can be specified on a per-message basis. Default values can be specified for the endpoint. It is important to understand the relationship between these options and the way the component act s when more than one value is set.Data coding is an 8 bit field in the SMPP wire format.Alphabet corresponds to bits 0-3 of the data coding field. For some types of message, where a message class is used (by setting bit 5 of the data coding field), the lower two bits of the data coding field are not interpreted as alphabet and only bits 2 and 3 impact the alphabet.Furthermore, current version of the JSMPP library only seems to support bits 2 and 3, assuming that bits 0 and 1 are used for message class. This is why the Alphabet class in JSMPP doesn't support the value 3 (binary 0011) which indicates ISO-8859-1.Although JSMPP provides a representation of the message class parameter, the Camel component doesn't
svn commit: r989024 [4/4] - in /websites/production/camel/content: book-architecture.html book-component-appendix.html book-in-one-page.html cache/main.pageCache component-list.html component.html com
Modified: websites/production/camel/content/component.html == --- websites/production/camel/content/component.html (original) +++ websites/production/camel/content/component.html Tue May 24 10:19:41 2016 @@ -621,7 +621,10 @@ flink:datastream[?options]]]> Generates a response using a http://www.stringtemplate.org/; rel="nofollow">String TemplateStub / camel-core -Allows you to stub out some physical middleware endpoint for easier testing or debuggingTest / camel-spring +Allows you to stub out some physical middleware endpoint for easier testing or debuggingTelegram / camel-telegram + +Allows to exchange data with the Telegram messaging networkTest / camel-spring Creates a Mock endpoint which expects to receive all the message bodies that could be polled from the given underlying endpointTimer / camel-core Modified: websites/production/camel/content/components.html == --- websites/production/camel/content/components.html (original) +++ websites/production/camel/content/components.html Tue May 24 10:19:41 2016 @@ -621,7 +621,10 @@ flink:datastream[?options]]]> Generates a response using a http://www.stringtemplate.org/; rel="nofollow">String TemplateStub / camel-core -Allows you to stub out some physical middleware endpoint for easier testing or debuggingTest / camel-spring +Allows you to stub out some physical middleware endpoint for easier testing or debuggingTelegram / camel-telegram + +Allows to exchange data with the Telegram messaging networkTest / camel-spring Creates a Mock endpoint which expects to receive all the message bodies that could be polled from the given underlying endpointTimer / camel-core Added: websites/production/camel/content/telegram.html == --- websites/production/camel/content/telegram.html (added) +++ websites/production/camel/content/telegram.html Tue May 24 10:19:41 2016 @@ -0,0 +1,209 @@ +http://www.w3.org/TR/html4/loose.dtd;> + + + + + + + + + + + + + .maincontent { overflow:hidden; } + + + + + + + + + + + + SyntaxHighlighter.defaults['toolbar'] = false; + SyntaxHighlighter.all(); + + + +Apache Camel: Telegram + + + + + + + + + + + + + + + + + +http://camel.apache.org/;>Camel +http://www.apache.org;>Apache + + + + + + +Apache CamelIndexTelegram + + +Download | JavaDoc | Source | Forums | Support + + + + + + + +Telegram ComponentAvailable as of Camel 2.18The Telegram component provides access to the https://core.telegram.org/bots/api; rel="nofollow">Telegram Bot API. It allows a Camel-based application to send and receive messages by acting as a Bot, participating in direct conversations with normal users, private and public groups or channels.A Telegram Bot must be created before using this component, following the instructions at the https://core.telegram.org/bots#3-how-do-i-create-a-bot; rel="nofollow">Telegram Bot developers home. When a new Bot is created, the BotFather provides an authorization token corresponding to the Bot. The authorization token is a mandatory parameter for the camel-telegram endpoint.NoteIn order to allow the Bot to receive all messages exchanged within a group or channel (not just the ones starting with a '/' character), ask the BotFather to disable the privacy mode, using the /setprivacy command.Maven users will need to add the following dependency to their pom.xml for this component: + +URI format + +OptionsThe Telegram component has no options.The Telegram component supports 24 endpoint options which are listed below:NameGroupDefaultDescriptiontypecommonRequired The endpoint type. Currently only the 'bots' type is supported. authorizationTokencommonRequired The authorization token for using the bot (ask the BotFather) eg. 654321531:HGF_dTra456323dHuOedsE343211fqr3t-H.bridgeErrorHandlerconsumerfalseAllows for bridging the consumer to the Camel routing Error Handler which mean any
svn commit: r989024 [1/4] - in /websites/production/camel/content: book-architecture.html book-component-appendix.html book-in-one-page.html cache/main.pageCache component-list.html component.html com
Author: buildbot Date: Tue May 24 10:19:41 2016 New Revision: 989024 Log: Production update by buildbot for camel Added: websites/production/camel/content/telegram.html Modified: websites/production/camel/content/book-architecture.html websites/production/camel/content/book-component-appendix.html websites/production/camel/content/book-in-one-page.html websites/production/camel/content/cache/main.pageCache websites/production/camel/content/component-list.html websites/production/camel/content/component.html websites/production/camel/content/components.html websites/production/camel/content/transport.html websites/production/camel/content/uris.html Modified: websites/production/camel/content/book-architecture.html == --- websites/production/camel/content/book-architecture.html (original) +++ websites/production/camel/content/book-architecture.html Tue May 24 10:19:41 2016 @@ -645,7 +645,10 @@ flink:datastream[?options]]]> Generates a response using a http://www.stringtemplate.org/; rel="nofollow">String TemplateStub / camel-core -Allows you to stub out some physical middleware endpoint for easier testing or debuggingTest / camel-spring +Allows you to stub out some physical middleware endpoint for easier testing or debuggingTelegram / camel-telegram + +Allows to exchange data with the Telegram messaging networkTest / camel-spring Creates a Mock endpoint which expects to receive all the message bodies that could be polled from the given underlying endpointTimer / camel-core
svn commit: r989024 [3/4] - in /websites/production/camel/content: book-architecture.html book-component-appendix.html book-in-one-page.html cache/main.pageCache component-list.html component.html com
Modified: websites/production/camel/content/book-in-one-page.html == --- websites/production/camel/content/book-in-one-page.html (original) +++ websites/production/camel/content/book-in-one-page.html Tue May 24 10:19:41 2016 @@ -989,7 +989,10 @@ flink:datastream[?options]]]> Generates a response using a http://www.stringtemplate.org/; rel="nofollow">String TemplateStub / camel-core -Allows you to stub out some physical middleware endpoint for easier testing or debuggingTest / camel-spring +Allows you to stub out some physical middleware endpoint for easier testing or debuggingTelegram / camel-telegram + +Allows to exchange data with the Telegram messaging networkTest / camel-spring Creates a Mock endpoint which expects to receive all the message bodies that could be polled from the given underlying endpointTimer / camel-core @@ -3614,11 +3617,11 @@ The tutorial has been designed in two pa While not actual tutorials you might find working through the source of the various Examples useful. Tutorial on Spring Remoting with JMSThanksThis tutorial was kindly donated to Apache Camel by Martin Gilday.PrefaceThis tutorial aims to guide the reader through the stages of creating a project which uses Camel to facilitate the routing of messages from a JMS queue to a http://www.springramework.org; rel="nofollow">Spring service. The route works in a synchronous fashion returning a response to the client./**/ +/*]]>*/ Tutorial on Spring Remoting with JMSPrefacePrerequisitesDistributionAboutCreate the Camel Project Update the POM with Dependencies Writing the Server @@ -5733,11 +5736,11 @@ So we completed the last piece in the pi This example has been removed from Camel 2.9 onwards. Apache Axis 1.4 is a very old and unsupported framework. We encourage users to use CXF instead of Axis. /**/ +/*]]>*/ Tutorial using Axis 1.4 with Apache Camel PrerequisitesDistributionIntroductionSetting up the project to run Axis Maven 2wsdlConfiguring AxisRunning the Example @@ -17134,11 +17137,11 @@ template.send(direct:alias-verify& ]]> See Also Configuring CamelComponentEndpointGetting StartedCrypto Crypto is also available as a Data Format CXF ComponentWhen using CXF as a consumer, the CXF Bean Component allows you to factor out how message payloads are received from their processing as a RESTful or SOAP web service. This has the potential of using a multitude of transports to consume web services. The bean component's configuration is also simpler and provides the fastest method to implement web services using Camel and CXF.When using CXF in streaming modes (see DataFormat option), then also read about Stream caching.The cxf: component provides integration with http://cxf.apache.org;>Apache CXF for connecting to JAX-WS services hosted in CXF./**/ +/*]]>*/ CXF Component URI formatOptions The descriptions of the dataformats @@ -25210,7 +25213,7 @@ protected RouteBuilder createRouteBuilde /dependency ]]> SMS limitationsSMS is neither reliable or secure. Users who require reliable and secure delivery may want to consider using the XMPP or SIP components instead, combined with a smartphone app supporting the chosen protocol.Reliability: although the SMPP standard offers a range of feedback mechanisms to indicate errors, non-delivery and confirmation of delivery it is not uncommon for mobile networks to hide or simulate these responses. For example, some networks automatically send a delivery confirmation for every message even if the destination number is invalid or not switched on. Some networks silently drop messages if they think they are spam. Spam detection rules in the network
camel git commit: CAMEL-9987: Add Asciidoc documentation
Repository: camel Updated Branches: refs/heads/master 8d9149d25 -> f28b44edd CAMEL-9987: Add Asciidoc documentation Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f28b44ed Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f28b44ed Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f28b44ed Branch: refs/heads/master Commit: f28b44edda67b8b06c368c7f454269b036245de2 Parents: 8d9149d Author: lburgazzoliAuthored: Tue May 24 11:57:30 2016 +0200 Committer: lburgazzoli Committed: Tue May 24 11:57:30 2016 +0200 -- components/camel-consul/src/main/docs/consul.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/f28b44ed/components/camel-consul/src/main/docs/consul.adoc -- diff --git a/components/camel-consul/src/main/docs/consul.adoc b/components/camel-consul/src/main/docs/consul.adoc index eec1c0d..011ffe1 100644 --- a/components/camel-consul/src/main/docs/consul.adoc +++ b/components/camel-consul/src/main/docs/consul.adoc @@ -1,6 +1,6 @@ [[Consul-ConsulComponent]] Consul Component - + *Available as of Camel 2.18*
[2/2] camel git commit: CAMEL-9987: Add Asciidoc documentation
CAMEL-9987: Add Asciidoc documentation Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/78d46fd8 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/78d46fd8 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/78d46fd8 Branch: refs/heads/master Commit: 78d46fd8ff027c03f4663ae8a42bf621cf740bfd Parents: cc1b73c Author: lburgazzoliAuthored: Tue May 24 11:47:36 2016 +0200 Committer: lburgazzoli Committed: Tue May 24 11:49:43 2016 +0200 -- .../camel-consul/src/main/docs/consul.adoc | 104 +++ 1 file changed, 104 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/78d46fd8/components/camel-consul/src/main/docs/consul.adoc -- diff --git a/components/camel-consul/src/main/docs/consul.adoc b/components/camel-consul/src/main/docs/consul.adoc new file mode 100644 index 000..776c26a --- /dev/null +++ b/components/camel-consul/src/main/docs/consul.adoc @@ -0,0 +1,104 @@ +[[Consul-ConsulComponent]] +Consul Component + + +*Available as of Camel 2.18* + +The *Consul* component is a component for integrating your application with Consul. + +Maven users will need to add the following dependency to their pom.xml +for this component: + +[source,java] +- + +org.apache.camel +camel-consul +${camel-version} + +- + +[[Consul-URIformat]] +URI format +^^ + +[source,java] +--- +consul://domain?[options] +--- + +You can append query options to the URI in the following format: + +--- +?option=value=value&... +--- + +[[Consul-Options]] +Options +^^^ + + + + +// component options: START +The Consul component has no options. +// component options: END + + + +// endpoint options: START +The Consul component supports 20 endpoint options which are listed below: + +{% raw %} +[width="100%",cols="2s,1,1m,1m,5",options="header"] +|=== +| Name | Group | Default | Java Type | Description +| apiEndpoint | common | | String | *Required* The API endpoint +| connectTimeoutMillis | common | | Long | Connect timeout for OkHttpClient +| key | common | | String | The default action. Can be overridden by CamelConsulKey +| pingInstance | common | true | boolean | Configure if the AgentClient should attempt a ping before returning the Consul instance +| readTimeoutMillis | common | | Long | Read timeout for OkHttpClient +| url | common | | String | The Consul agent URL +| writeTimeoutMillis | common | | Long | Write timeout for OkHttpClient +| 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/ERROR level and ignored. +| 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/ERROR level and ignored. +| action | producer | | String | The default action. Can be overridden by CamelConsulAction +| exchangePattern | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange +| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported). +| blockSeconds | watch | 10 | Integer | The second to wait for a watch event default 10 seconds +| firstIndex | watch | 0 | long | The first index for watch for default 0 +| recursive | watch | false | boolean | Recursively watch default false +| valueAsString | kv | false | boolean | Default to transform values retrieved from Consul i.e. on KV endpoint to string. +| aclToken | security | | String | Sets the ACL token to be used with Consul +| password | security | | String | Sets the password to be used for basic authentication +| sslContextParameters | security | | SSLContextParameters | SSL configuration using an org.apache.camel.util.jsse.SSLContextParameters instance. +| userName | security | | String | Sets the
[1/2] camel git commit: CAMEL-9888: Refactor endpoints
Repository: camel Updated Branches: refs/heads/master cc1b73c78 -> d518e543a CAMEL-9888: Refactor endpoints Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d518e543 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d518e543 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d518e543 Branch: refs/heads/master Commit: d518e543ac6ba6ac488e088a1c597cf47e7cbb64 Parents: 78d46fd Author: lburgazzoliAuthored: Tue May 24 11:49:20 2016 +0200 Committer: lburgazzoli Committed: Tue May 24 11:49:43 2016 +0200 -- .../camel-consul/src/main/docs/consul.adoc | 4 +- .../consul/AbstractConsulConsumer.java | 4 +- .../consul/AbstractConsulEndpoint.java | 94 .../consul/AbstractConsulProducer.java | 4 +- .../camel/component/consul/ConsulComponent.java | 56 +--- .../component/consul/ConsulConfiguration.java | 6 +- .../camel/component/consul/ConsulConstants.java | 7 +- .../camel/component/consul/ConsulEndpoint.java | 144 +++ .../component/consul/ConsulEndpointFactory.java | 25 .../consul/enpoint/ConsulAgentEndpoint.java | 43 -- .../consul/enpoint/ConsulAgentProducer.java | 4 +- .../consul/enpoint/ConsulEventConsumer.java | 17 ++- .../consul/enpoint/ConsulEventEndpoint.java | 44 -- .../consul/enpoint/ConsulEventProducer.java | 4 +- .../consul/enpoint/ConsulKeyValueConsumer.java | 9 +- .../consul/enpoint/ConsulKeyValueEndpoint.java | 43 -- .../consul/enpoint/ConsulKeyValueProducer.java | 4 +- 17 files changed, 218 insertions(+), 294 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/d518e543/components/camel-consul/src/main/docs/consul.adoc -- diff --git a/components/camel-consul/src/main/docs/consul.adoc b/components/camel-consul/src/main/docs/consul.adoc index 776c26a..76a1683 100644 --- a/components/camel-consul/src/main/docs/consul.adoc +++ b/components/camel-consul/src/main/docs/consul.adoc @@ -46,6 +46,7 @@ The Consul component has no options. + // endpoint options: START The Consul component supports 20 endpoint options which are listed below: @@ -55,7 +56,7 @@ The Consul component supports 20 endpoint options which are listed below: | Name | Group | Default | Java Type | Description | apiEndpoint | common | | String | *Required* The API endpoint | connectTimeoutMillis | common | | Long | Connect timeout for OkHttpClient -| key | common | | String | The default action. Can be overridden by CamelConsulKey +| key | common | | String | The default key. Can be overridden by CamelConsulKey | pingInstance | common | true | boolean | Configure if the AgentClient should attempt a ping before returning the Consul instance | readTimeoutMillis | common | | Long | Read timeout for OkHttpClient | url | common | | String | The Consul agent URL @@ -77,6 +78,7 @@ The Consul component supports 20 endpoint options which are listed below: {% endraw %} // endpoint options: END + [[Consul-Headers]] Headers ^^^ http://git-wip-us.apache.org/repos/asf/camel/blob/d518e543/components/camel-consul/src/main/java/org/apache/camel/component/consul/AbstractConsulConsumer.java -- diff --git a/components/camel-consul/src/main/java/org/apache/camel/component/consul/AbstractConsulConsumer.java b/components/camel-consul/src/main/java/org/apache/camel/component/consul/AbstractConsulConsumer.java index c3b6545..536566d 100644 --- a/components/camel-consul/src/main/java/org/apache/camel/component/consul/AbstractConsulConsumer.java +++ b/components/camel-consul/src/main/java/org/apache/camel/component/consul/AbstractConsulConsumer.java @@ -29,7 +29,7 @@ import org.apache.camel.util.ObjectHelper; * @author lburgazzoli */ public abstract class AbstractConsulConsumer extends DefaultConsumer { -protected final AbstractConsulEndpoint endpoint; +protected final ConsulEndpoint endpoint; protected final ConsulConfiguration configuration; protected final String key; protected final AtomicReference index; @@ -37,7 +37,7 @@ public abstract class AbstractConsulConsumer extends DefaultConsumer { private final Function clientSupplier; private Runnable watcher; -protected AbstractConsulConsumer(AbstractConsulEndpoint endpoint, ConsulConfiguration configuration, Processor processor, Function clientSupplier) { +protected AbstractConsulConsumer(ConsulEndpoint endpoint, ConsulConfiguration configuration, Processor processor, Function clientSupplier) { super(endpoint, processor);
svn commit: r989020 - in /websites/production/camel/content: cache/main.pageCache mime-multipart.html
Author: buildbot Date: Tue May 24 09:18:34 2016 New Revision: 989020 Log: Production update by buildbot for camel Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/mime-multipart.html Modified: websites/production/camel/content/cache/main.pageCache == Binary files - no diff available. Modified: websites/production/camel/content/mime-multipart.html == --- websites/production/camel/content/mime-multipart.html (original) +++ websites/production/camel/content/mime-multipart.html Tue May 24 09:18:34 2016 @@ -85,7 +85,7 @@ -Available as of Camel 2.17This data format that can convert a Camel message with attachments into a Camel message having a MIME-Multipart message as message body (and no attachments).The use case for this is to enable the user to send attachments over endpoints that do not directly support attachments, either as special protocol implementation (e.g. send a MIME-multipart over an HTTP endpoint) or as a kind of tunneling solution (e.g. because camel-jms does not support attachments but by marshalling the message with attachments into a MIME-Multipart, sending that to a JMS queue, receiving the message from the JMS queue and unmarshalling it again (into a message body with attachments).The marshal option of the mime-multipart data format will convert a message with attachments into a MIME-Multipart message. If the parameter "multipartWithoutAttachment" is set to true it will also marshal messages without att achments into a multipart message with a single part, if the parameter is set to false it will leave the message alone.MIME headers of the mulitpart as "MIME-Version" and "Content-Type" are set as camel headers to the message. If the parameter "headersInline" is set to true it will also create a MIME multipart message in any case. Furthermore the MIME headers of the multipart are written as part of the message body, not as camel headers.The unmarshal option of the mime-multipart data format will convert a MIME-Multipart message into a camel message with attachments and leaves other messages alone. MIME-Headers of the MIME-Multipart message have to be set as Camel headers. The unmarshalling will only take place if the "Content-Type" header is set to a "multipart" type. If the option "headersInline" is set to true, the body is always parsed as a MIME message. Messages that are actually not MIME messages with MIME headers in the message bodywill be parsed into empty messages.OptionsOptionDefaultDescriptionmultipartWithoutAttachmentfalseIf set to true the marshal operation will create a multipart (with a single part) if the message does not contain any attachments. If this is set to false it will leave messages without attachments alone.headersInlinefalseIf set to true the marshal operation will add the MIME headers of the Multipa rt as part of the message body and not as a camel header. In case of a unmarshal operations the MIME headers are assumed to be contained in the message body and the operation will always parse the message as MIME message.Note: Any message is a valid MIME message, so the unmarshal operation with this parameter set to true will never result in an error but will return an empty message (as anything outside the MIME boundary is considered to be a comment).Note: If the headersInline parameter is set to "true", the message will also always be rendered into a MIME multipart regardless whether it has an attachment or not.includeHeadersnullA regex that defines which Camel headers are also included as MIME headers into the MIME multipart. This will only work if headersInline is set to true.< br clear="none">Default is to include no Camel headers.binaryContentfalseIf set to true non-text content will be transferred in binary mode, if set to false (default) binary content will be transferred in base64 encoding. This is shorter but might not work for all transfer methods.multipartSubTypemixedThe subtype of the generated MIME multipart. Other options are related, alternative, digest, or parallel. The data type does not enforce any semantics for these subtypes (so e.g. the user has to make sure that the first body part of a multipart/digest message is proper message/rfc822 data). The default mixed is usually a good choice.Message Headers (marshal)NameTypeDescriptionMessage-IdStringThe marshal operation will set this parameter to the generated MIME message id if the "headersInline" parameter is set to false.MIME-VersionStringThe marshal operation will set this parameter to the applied MIME version (1.0) if the "headersInline" parameter is set to false.Content-TypeStringThe content of this header will be used as a content type for the message body part. If no content type is set,
[1/2] camel git commit: Added camel-servletlistener docs to Gitbook
Repository: camel Updated Branches: refs/heads/master 6f404e73c -> cc1b73c78 Added camel-servletlistener docs to Gitbook Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b51dc747 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b51dc747 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b51dc747 Branch: refs/heads/master Commit: b51dc747205e39965140003ae7483631e2892658 Parents: 6f404e7 Author: Andrea CosentinoAuthored: Tue May 24 10:30:22 2016 +0200 Committer: Andrea Cosentino Committed: Tue May 24 10:30:22 2016 +0200 -- .../src/main/docs/servletlistener.adoc | 355 +++ docs/user-manual/en/SUMMARY.md | 1 + 2 files changed, 356 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/b51dc747/components/camel-servletlistener/src/main/docs/servletlistener.adoc -- diff --git a/components/camel-servletlistener/src/main/docs/servletlistener.adoc b/components/camel-servletlistener/src/main/docs/servletlistener.adoc new file mode 100644 index 000..79040c6 --- /dev/null +++ b/components/camel-servletlistener/src/main/docs/servletlistener.adoc @@ -0,0 +1,355 @@ +[[ServletListenerComponent-ServletListenerComponent]] +ServletListener Component +~ + +*Available as of Camel 2.11* + +This component is used for bootstrapping Camel applications in web +applications. For example beforehand people would have to find their own +way of bootstrapping Camel, or rely on 3rd party frameworks such as +Spring to do it. + + +NOTE: *Sidebar* +This component supports Servlet 2.x onwards, which mean it works also in +older web containers; which is the goal of this component. +Though Servlet 2.x requires to use a web.xml file as configuration. +For Servlet 3.x containers you can use annotation driven configuration +to boostrap Camel using the @WebListener, and implement your own class, +where you boostrap Camel. Doing this still puts the challenge how to let +end users easily configure Camel, which you get for free with the old +school web.xml file. + +Maven users will need to add the following dependency to their `pom.xml` +for this component: + +[source,xml] + + +org.apache.camel +camel-servletlistener +x.x.x + + + + +[[ServletListenerComponent-Using]] +Using +^ + +You would need to chose one of the following implementations of the +abstract class +`org.apache.camel.component.servletlistener.CamelServletContextListener`. + +* `JndiCamelServletContextListener` which uses the `JndiRegistry` to +leverage JNDI for its registry. +* `SimpleCamelServletContextListener` which uses the `SimpleRegistry` to +leverage a `java.util.Map` as its registry. + +To use this you need to configure the +`org.apache.camel.component.servletlistener.CamelServletContextListener` +in the `WEB-INF/web.xml` file as shown below: + +[[ServletListenerComponent-Options]] +Options +^^^ + +The +`org.apache.camel.component.servletlistener.CamelServletContextListener` +supports the following options which can be configured as context-param +in the web.xml file. + +[width="100%",cols="10%,20%,70%",options="header",] +|=== +|Option |Type |Description + +|propertyPlaceholder.XXX | | To configure link:using-propertyplaceholder.html[property placeholders] +in Camel. You should prefix the option with "propertyPlaceholder.", for +example to configure the location, use propertyPlaceholder.location as +name. You can configure all the options from the +link:properties.html[Properties] component. + +|jmx.XXX | | To configure link:camel-jmx.html[JMX]. You should prefix the option with +"jmx.", for example to disable JMX, use jmx.disabled as name. You can +configure all the options from `org.apache.camel.spi.ManagementAgent`. +As well the options mentioned on the link:camel-jmx.html[JMX] page. + +|name |`String` |To configure the name of the link:camelcontext.html[CamelContext]. + +|messageHistory |`Boolean` |*Camel 2.12.2:* Whether to enable or disable +link:message-history.html[Message History] (enabled by default). + +|streamCache |`Boolean` |Whether to enable link:stream-caching.html[Stream caching]. + +|trace |`Boolean` |Whether to enable link:tracer.html[Tracer]. + +|delayer |`Long` |To set a delay value for link:delay-interceptor.html[Delay Interceptor]. + +|handleFault |`Boolean` |Whether to enable handle fault. + +|errorHandlerRef |`String` |Refers to a context scoped link:error-handler.html[Error Handler] to be +used. + +|autoStartup
[2/2] camel git commit: Added camel-shiro docs to Gitbook
Added camel-shiro docs to Gitbook Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/cc1b73c7 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/cc1b73c7 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/cc1b73c7 Branch: refs/heads/master Commit: cc1b73c784807582c37f85310ae608c29dbc3d8c Parents: b51dc74 Author: Andrea CosentinoAuthored: Tue May 24 10:48:24 2016 +0200 Committer: Andrea Cosentino Committed: Tue May 24 10:48:24 2016 +0200 -- .../src/main/docs/shiro-security.adoc | 316 +++ docs/user-manual/en/SUMMARY.md | 1 + 2 files changed, 317 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/cc1b73c7/components/camel-shiro/src/main/docs/shiro-security.adoc -- diff --git a/components/camel-shiro/src/main/docs/shiro-security.adoc b/components/camel-shiro/src/main/docs/shiro-security.adoc new file mode 100644 index 000..a0c0b86 --- /dev/null +++ b/components/camel-shiro/src/main/docs/shiro-security.adoc @@ -0,0 +1,316 @@ +[[ShiroSecurity-ShiroSecurityComponent]] +Shiro Security Component + + +*Available as of Camel 2.5* + +The *shiro-security* component in Camel is a security focused component, +based on the Apache Shiro security project. + +Apache Shiro is a powerful and flexible open-source security framework +that cleanly handles authentication, authorization, enterprise session +management and cryptography. The objective of the Apache Shiro project +is to provide the most robust and comprehensive application security +framework available while also being very easy to understand and +extremely simple to use. + +This camel shiro-security component allows authentication and +authorization support to be applied to different segments of a camel +route. + +Shiro security is applied on a route using a Camel Policy. A Policy in +Camel utilizes a strategy pattern for applying interceptors on Camel +Processors. It offering the ability to apply cross-cutting concerns (for +example. security, transactions etc) on sections/segments of a camel +route. + +Maven users will need to add the following dependency to their `pom.xml` +for this component: + +[source,xml] + + +org.apache.camel +camel-shiro +x.x.x + + + + +[[ShiroSecurity-ShiroSecurityBasics]] +Shiro Security Basics +^ + +To employ Shiro security on a camel route, a ShiroSecurityPolicy object +must be instantiated with security configuration details (including +users, passwords, roles etc). This object must then be applied to a +camel route. This ShiroSecurityPolicy Object may also be registered in +the Camel registry (JNDI or ApplicationContextRegistry) and then +utilized on other routes in the Camel Context. + +Configuration details are provided to the ShiroSecurityPolicy using an +Ini file (properties file) or an Ini object. The Ini file is a standard +Shiro configuration file containing user/role details as shown below + +[source,java] +-- +[users] +# user 'ringo' with password 'starr' and the 'sec-level1' role +ringo = starr, sec-level1 +george = harrison, sec-level2 +john = lennon, sec-level3 +paul = mccartney, sec-level3 + +[roles] +# 'sec-level3' role has all permissions, indicated by the +# wildcard '*' +sec-level3 = * + +# The 'sec-level2' role can do anything with access of permission +# readonly (*) to help +sec-level2 = zone1:* + +# The 'sec-level1' role can do anything with access of permission +# readonly +sec-level1 = zone1:readonly:* +-- + +[[ShiroSecurity-InstantiatingaShiroSecurityPolicyObject]] +Instantiating a ShiroSecurityPolicy Object +^^ + +A ShiroSecurityPolicy object is instantiated as follows + +[source,java] + +private final String iniResourcePath = "classpath:shiro.ini"; +private final byte[] passPhrase = { +(byte) 0x08, (byte) 0x09, (byte) 0x0A, (byte) 0x0B, +(byte) 0x0C, (byte) 0x0D, (byte) 0x0E, (byte) 0x0F, +(byte) 0x10, (byte) 0x11, (byte) 0x12, (byte) 0x13, +(byte) 0x14, (byte) 0x15, (byte) 0x16, (byte) 0x17}; +List permissionsList = new ArrayList(); +Permission permission = new WildcardPermission("zone1:readwrite:*"); +permissionsList.add(permission); + +final ShiroSecurityPolicy securityPolicy = +
svn commit: r989013 - in /websites/production/camel/content: book-architecture.html book-in-one-page.html cache/main.pageCache camel-2180-release.html component-list.html component.html components.htm
Author: buildbot Date: Tue May 24 08:22:11 2016 New Revision: 989013 Log: Production update by buildbot for camel Removed: websites/production/camel/content/hystrix.html Modified: websites/production/camel/content/book-architecture.html websites/production/camel/content/book-in-one-page.html websites/production/camel/content/cache/main.pageCache websites/production/camel/content/camel-2180-release.html websites/production/camel/content/component-list.html websites/production/camel/content/component.html websites/production/camel/content/components.html websites/production/camel/content/transport.html websites/production/camel/content/uris.html Modified: websites/production/camel/content/book-architecture.html == --- websites/production/camel/content/book-architecture.html (original) +++ websites/production/camel/content/book-architecture.html Tue May 24 08:22:11 2016 @@ -342,10 +342,7 @@ flink:datastream[?options]]]> For calling out to external HTTP servers using Apache HTTP Client 3.xHTTP4 / camel-http4 -For calling out to external HTTP servers using Apache HTTP Client 4.xHystrix / camel-hystrix - -Provides integration with Netflix https://github.com/Netflix/Hystrix; rel="nofollow">Hystrix library. Helps for creating resilient distributed systems by defending from cascading failures and slow responses.iBATIS / camel-ibatis +For calling out to external HTTP servers using Apache HTTP Client 4.xiBATIS / camel-ibatis Performs a query, poll, insert, update or delete in a relational database using http://ibatis.apache.org/;>Apache iBATISIgnite / camel-ignite Modified: websites/production/camel/content/book-in-one-page.html == --- websites/production/camel/content/book-in-one-page.html (original) +++ websites/production/camel/content/book-in-one-page.html Tue May 24 08:22:11 2016 @@ -686,10 +686,7 @@ flink:datastream[?options]]]> For calling out to external HTTP servers using Apache HTTP Client 3.xHTTP4 / camel-http4 -For calling out to external HTTP servers using Apache HTTP Client 4.xHystrix / camel-hystrix - -Provides integration with Netflix https://github.com/Netflix/Hystrix; rel="nofollow">Hystrix library. Helps for creating resilient distributed systems by defending from cascading failures and slow responses.iBATIS / camel-ibatis +For calling out to external HTTP servers using Apache HTTP Client 4.xiBATIS / camel-ibatis Performs a query, poll, insert, update or delete in a relational database using http://ibatis.apache.org/;>Apache iBATISIgnite / camel-ignite @@ -3617,11 +3614,11 @@ The tutorial has been designed in two pa While not actual tutorials you might find working through the source of the various Examples useful. Tutorial on Spring Remoting with JMSThanksThis tutorial was kindly donated to Apache Camel by Martin Gilday.PrefaceThis tutorial aims to guide the reader through the stages of creating a project which uses Camel to facilitate the routing of messages from a JMS queue to a http://www.springramework.org; rel="nofollow">Spring service. The route works in a synchronous fashion returning a response to the client./**/ +/*]]>*/ Tutorial on Spring Remoting with JMSPrefacePrerequisitesDistributionAboutCreate the Camel Project Update the POM with Dependencies Writing the Server @@ -5736,11 +5733,11 @@ So we completed the last piece in the pi This example has been removed from Camel 2.9 onwards. Apache Axis 1.4 is a very old and unsupported framework. We encourage users to use CXF instead of Axis. /**/ +/*]]>*/ Tutorial using Axis 1.4 with Apache Camel PrerequisitesDistributionIntroductionSetting up the project to run Axis Maven 2wsdlConfiguring AxisRunning the Example @@ -17137,11 +17134,11 @@ template.send(direct:alias-verify& ]]> See Also
camel git commit: Added camel-servlet docs to Gitbook
Repository: camel Updated Branches: refs/heads/master 5b5cf32bb -> 6f404e73c Added camel-servlet docs to Gitbook Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/6f404e73 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6f404e73 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6f404e73 Branch: refs/heads/master Commit: 6f404e73cae77996afe03a2128ae53f218b14169 Parents: 5b5cf32 Author: Andrea CosentinoAuthored: Tue May 24 10:06:12 2016 +0200 Committer: Andrea Cosentino Committed: Tue May 24 10:06:12 2016 +0200 -- .../camel-servlet/src/main/docs/servlet.adoc| 248 +++ docs/user-manual/en/SUMMARY.md | 1 + 2 files changed, 249 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/6f404e73/components/camel-servlet/src/main/docs/servlet.adoc -- diff --git a/components/camel-servlet/src/main/docs/servlet.adoc b/components/camel-servlet/src/main/docs/servlet.adoc new file mode 100644 index 000..42efe67 --- /dev/null +++ b/components/camel-servlet/src/main/docs/servlet.adoc @@ -0,0 +1,248 @@ +[[SERVLET-ServletComponent]] +Servlet Component +~ + +The *servlet:* component provides HTTP based +link:endpoint.html[endpoints] for consuming HTTP requests that arrive at +a HTTP endpoint that is bound to a published Servlet. + +Maven users will need to add the following dependency to their `pom.xml` +for this component: + +[source,xml] +--- + +org.apache.camel +camel-servlet +x.x.x +<\!-\- use the same version as your Camel core version \--> + +--- + + +INFO: *Stream*. +Servlet is stream based, which means the input it receives is submitted +to Camel as a stream. That means you will only be able to read the +content of the stream *once*. If you find a situation where the message +body appears to be empty or you need to access the data multiple times +(eg: doing multicasting, or redelivery error handling) you should use +link:stream-caching.html[Stream caching] or convert the message body to +a `String` which is safe to be read multiple times. + +[[SERVLET-URIformat]] +URI format +^^ + +[source,java] +- +servlet://relative_path[?options] +- + +You can append query options to the URI in the following format, +`?option=value=value&...` + +[[SERVLET-Options]] +Options +^^^ + +[width="100%",cols="10%,10%,80%",options="header",] +|=== +|Name |Default Value |Description + +|`httpBindingRef` |`null` |Reference to an `org.apache.camel.component.http.HttpBinding` in the +link:registry.html[Registry]. A `HttpBinding` implementation can be used +to customize how to write a response. + +|`httpBinding` |`null` |*Camel 2.16:* Reference to an +`org.apache.camel.component.http.HttpBinding` in the +link:registry.html[Registry]. A `HttpBinding` implementation can be used +to customize how to write a response. + +|`matchOnUriPrefix` |`false` |Whether or not the `CamelServlet` should try to find a target consumer +by matching the URI prefix, if no exact match is found. + +|`servletName` |`CamelServlet` |Specifies the servlet name that the servlet endpoint will bind to. This +name should match the name you define in `web.xml` file. + +|`httpMethodRestrict` |`null` |*Camel 2.11:* *Consumer only*: Used to only allow consuming if the +HttpMethod matches, such as GET/POST/PUT etc. From *Camel 2.15*onwards +multiple methods can be specified separated by comma. +|=== + +[[SERVLET-MessageHeaders]] +Message Headers +^^^ + +Camel will apply the same Message Headers as the link:http.html[HTTP] +component. + +Camel will also populate *all* `request.parameter` and +`request.headers`. For example, if a client request has the URL, +`http://myserver/myserver?orderid=123`, the exchange will contain a +header named `orderid` with the value 123. + +[[SERVLET-Usage]] +Usage +^ + +You can consume only from endpoints generated by the Servlet component. +Therefore, it should be used only as input into your Camel routes. To +issue HTTP requests against other HTTP endpoints, use the +link:http.html[HTTP Component] + +[[SERVLET-PuttingCamelJARsintheappserverbootclasspath]] +Putting Camel JARs in the app server boot classpath +^^^ + +If you put the Camel JARs such as `camel-core`, `camel-servlet`, etc. in +the boot classpath of your application server
camel git commit: CAMEL-9986: MIME-Multipart Data Format is inconsistent if trying to unmarshal non-MIME data
Repository: camel Updated Branches: refs/heads/camel-2.17.x df4004898 -> a863c8868 CAMEL-9986: MIME-Multipart Data Format is inconsistent if trying to unmarshal non-MIME data Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a863c886 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a863c886 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a863c886 Branch: refs/heads/camel-2.17.x Commit: a863c88688471ff42d1272fb9fa95ad98b4217a7 Parents: df40048 Author: Stephan SianoAuthored: Tue May 24 09:09:33 2016 +0200 Committer: Stephan Siano Committed: Tue May 24 09:15:56 2016 +0200 -- .../mime/multipart/MimeMultipartDataFormat.java | 21 ++-- .../multipart/MimeMultipartDataFormatTest.java | 36 +++- 2 files changed, 45 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/a863c886/components/camel-mail/src/main/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormat.java -- diff --git a/components/camel-mail/src/main/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormat.java b/components/camel-mail/src/main/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormat.java index 6504bc3..86e5f35 100644 --- a/components/camel-mail/src/main/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormat.java +++ b/components/camel-mail/src/main/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormat.java @@ -245,18 +245,17 @@ public class MimeMultipartDataFormat implements DataFormat { BodyPart bp = (BodyPart) content; camelMessage.setBody(bp.getInputStream()); contentType = bp.getContentType(); -} else { -// Last fallback: I don't see how this can happen, but we do this -// just to be safe -camelMessage.setBody(content); -} -if (contentType != null && !DEFAULT_CONTENT_TYPE.equals(contentType)) { -camelMessage.setHeader(CONTENT_TYPE, contentType); -ContentType ct = new ContentType(contentType); -String charset = ct.getParameter("charset"); -if (charset != null) { -camelMessage.setHeader(Exchange.CONTENT_ENCODING, MimeUtility.javaCharset(charset)); +if (contentType != null && !DEFAULT_CONTENT_TYPE.equals(contentType)) { +camelMessage.setHeader(CONTENT_TYPE, contentType); +ContentType ct = new ContentType(contentType); +String charset = ct.getParameter("charset"); +if (charset != null) { +camelMessage.setHeader(Exchange.CONTENT_ENCODING, MimeUtility.javaCharset(charset)); +} } +} else { +// If we find no body part, try to leave the message alone +LOG.info("no MIME part found"); } return camelMessage; } http://git-wip-us.apache.org/repos/asf/camel/blob/a863c886/components/camel-mail/src/test/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormatTest.java -- diff --git a/components/camel-mail/src/test/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormatTest.java b/components/camel-mail/src/test/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormatTest.java index db62669..7759c49 100644 --- a/components/camel-mail/src/test/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormatTest.java +++ b/components/camel-mail/src/test/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormatTest.java @@ -16,6 +16,7 @@ */ package org.apache.camel.dataformat.mime.multipart; +import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; @@ -299,6 +300,38 @@ public class MimeMultipartDataFormatTest extends CamelTestSupport { unmarshalAndCheckAttachmentName("@camel.apache.org"); } +@Test +public void unmarshalNonMimeBody() { +in.setBody("This is not a MIME-Multipart"); +Exchange out = template.send("direct:unmarshalonly", exchange); +assertNotNull(out.getOut()); +String bodyStr = out.getOut().getBody(String.class); +assertEquals("This is not a MIME-Multipart", bodyStr); +} + +@Test +public void unmarshalInlineHeadersNonMimeBody() { +in.setBody("This is not a MIME-Multipart"); +Exchange out = template.send("direct:unmarshalonlyinlineheaders", exchange); +assertNotNull(out.getOut()); +String bodyStr =
[2/2] camel git commit: Removed camel-hystrix from docs
Removed camel-hystrix from docs Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5b5cf32b Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5b5cf32b Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5b5cf32b Branch: refs/heads/master Commit: 5b5cf32bb0b85993c6b176e2fe807136af12e37d Parents: 0a9eb29 Author: Andrea CosentinoAuthored: Tue May 24 09:38:36 2016 +0200 Committer: Andrea Cosentino Committed: Tue May 24 09:38:51 2016 +0200 -- docs/user-manual/en/SUMMARY.md | 1 - 1 file changed, 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/5b5cf32b/docs/user-manual/en/SUMMARY.md -- diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md index 3c6d166..998a0a2 100644 --- a/docs/user-manual/en/SUMMARY.md +++ b/docs/user-manual/en/SUMMARY.md @@ -153,7 +153,6 @@ * [HL7](hl7.adoc) * [Http](http.adoc) * [Http4](http4.adoc) -* [Hystrix](hystrix.adoc) * [Ibatis](ibatis.adoc) * [Infinispan](infinispan.adoc) * [IRC](irc.adoc)
[1/2] camel git commit: Added camel-servicenow docs to Gitbook
Repository: camel Updated Branches: refs/heads/master 93f5952e4 -> 5b5cf32bb Added camel-servicenow docs to Gitbook Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/0a9eb291 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0a9eb291 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0a9eb291 Branch: refs/heads/master Commit: 0a9eb291517ed1252fb50680ac67b1ebcb99b98b Parents: 93f5952 Author: Andrea CosentinoAuthored: Tue May 24 09:37:29 2016 +0200 Committer: Andrea Cosentino Committed: Tue May 24 09:38:20 2016 +0200 -- .../src/main/docs/servicenow.adoc | 154 +++ docs/user-manual/en/SUMMARY.md | 1 + 2 files changed, 155 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/0a9eb291/components/camel-servicenow/src/main/docs/servicenow.adoc -- diff --git a/components/camel-servicenow/src/main/docs/servicenow.adoc b/components/camel-servicenow/src/main/docs/servicenow.adoc new file mode 100644 index 000..25d4839 --- /dev/null +++ b/components/camel-servicenow/src/main/docs/servicenow.adoc @@ -0,0 +1,154 @@ +[[ServiceNow-ServiceNowComponent]] +ServiceNow Component + + +*Available as of Camel 2.18* + +The ServiceNow component provides access to all of ServiceNow +https://developer.servicenow.com/app.do#!/rest_api_doc?v=fuji[REST +API]. + +Maven users will need to add the following dependency to their pom.xml +for this component: + +[source,java] +- + +org.apache.camel +camel-servicenow +${camel-version} + +- + +[[ServiceNow-URIformat]] +URI format +^^ + +[source,java] +--- +servicenow://instanceName?[options] +--- + +[[ServiceNow-Options]] +Options +^^^ + + +// component options: START +The ServiceNow component has no options. +// component options: END + + + +// endpoint options: START +The ServiceNow component supports 17 endpoint options which are listed below: + +{% raw %} +[width="100%",cols="2s,1,1m,1m,5",options="header"] +|=== +| Name | Group | Default | Java Type | Description +| instanceName | producer | | String | *Required* The ServiceNow instance name +| displayValue | producer | false | String | Return the display value (true) actual value (false) or both (all) for reference fields (default: false) +| excludeReferenceLink | producer | | Boolean | True to exclude Table API links for reference fields (default: false) +| inputDisplayValue | producer | | Boolean | True to set raw value of input fields (default: false) +| models | producer | | String | Defines the default model to use for a table +| password | producer | | String | *Required* ServiceNow account password MUST be provided +| resource | producer | | String | The default resource can be overridden by header CamelServiceNowResource +| suppressAutoSysField | producer | | Boolean | True to suppress auto generation of system fields (default: false) +| table | producer | | String | The default table can be overridden by header CamelServiceNowTable +| userName | producer | | String | *Required* ServiceNow user account name MUST be provided +| apiUrl | advanced | | String | The ServiceNow REST API url +| exchangePattern | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange +| mapper | advanced | | ObjectMapper | Sets Jackson's ObjectMapper to use for request/reply +| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported). +| oauthClientId | security | | String | OAuth2 ClientID +| oauthClientSecret | security | | String | OAuth2 ClientSecret +| oauthTokenUrl | security | | String | OAuth token Url +|=== +{% endraw %} +// endpoint options: END + + +[[ServiceNow-Headers]] +Headers +^^^ + +[width="100%",cols="10%,10%,80%",options="header",] +|=== +|Name |Type |Description + +|CamelServiceNowResource |String |The resource to access TABLE, AGGREGATE, IMPORT + +|CamelServiceNowTable |String |The table to access + +|CamelServiceNowAction |String |The action to perform RETRIEVE, CREATE, MODIFY, DELETE, UPDATE + +|CamelServiceNowModel |Class |The data model + +|CamelServiceNowSysId |String |ServiceNow sysy_id + +|CamelServiceNowQuery
[2/2] camel git commit: CAMEL-9983: camel-hystrix - Lets removed the component now that we have the EIP
CAMEL-9983: camel-hystrix - Lets removed the component now that we have the EIP Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/93f5952e Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/93f5952e Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/93f5952e Branch: refs/heads/master Commit: 93f5952e46eef547857f81a745c165c46c4aa266 Parents: f84963b Author: Claus IbsenAuthored: Tue May 24 09:33:37 2016 +0200 Committer: Claus Ibsen Committed: Tue May 24 09:34:36 2016 +0200 -- .../camel-hystrix/src/main/docs/hystrix.adoc| 302 --- .../component/hystrix/CamelHystrixCommand.java | 107 .../component/hystrix/HystrixComponent.java | 38 -- .../component/hystrix/HystrixConfiguration.java | 543 --- .../component/hystrix/HystrixConstants.java | 88 --- .../component/hystrix/HystrixEndpoint.java | 88 --- .../component/hystrix/HystrixProducer.java | 387 - .../hystrix/processor/HystrixConstants.java | 28 + .../hystrix/processor/HystrixProcessor.java | 1 - .../services/org/apache/camel/component/hystrix | 18 - .../component/hystrix/HystrixComponentBase.java | 37 -- .../hystrix/HystrixComponentCacheTest.java | 84 --- .../HystrixComponentCircuitBreakerTest.java | 74 --- .../hystrix/HystrixComponentFallbackTest.java | 98 .../HystrixComponentOverrideRunTest.java| 67 --- .../HystrixComponentRequestContextTest.java | 101 .../hystrix/HystrixComponentTimeOutTest.java| 98 .../camel/component/hystrix/TryCatchTest.java | 53 -- .../BlueprintHystrixRouteFallbackTest.java | 1 - .../processor/BlueprintHystrixRouteOkTest.java | 1 - .../processor/HystrixRouteFallbackTest.java | 1 - .../HystrixRouteFallbackViaNetworkTest.java | 1 - .../hystrix/processor/HystrixRouteOkTest.java | 1 - .../SpringHystrixRouteFallbackTest.java | 1 - .../processor/SpringHystrixRouteOkTest.java | 1 - 25 files changed, 28 insertions(+), 2191 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/93f5952e/components/camel-hystrix/src/main/docs/hystrix.adoc -- diff --git a/components/camel-hystrix/src/main/docs/hystrix.adoc b/components/camel-hystrix/src/main/docs/hystrix.adoc deleted file mode 100644 index f15a342..000 --- a/components/camel-hystrix/src/main/docs/hystrix.adoc +++ /dev/null @@ -1,302 +0,0 @@ -[[Hystrix-HystrixComponent]] -Hystrix Component -~ - -*Available as of Camel 2.18* - -The hystrix component provides integration with Netflix -https://github.com/Netflix/Hystrix[Hystrix]. Hystrix is a latency and -fault tolerance library designed to isolate points of access to remote -systems, services and 3rd party libraries, stop cascading failure and -enable resilience in complex distributed systems where failure is -inevitable. - -The current implementation wraps a Camel endpoint in HystrixCommand and -provides synchronous execution (using Hystrix thread pools), fallback to -a different Camel endpoint, request caching (with custom request context -and cache clearing), timeouts. It does not implement request collapsing -yet. - -Maven users will need to add the following dependency to their pom.xml -for this component: - -[source,xml] - - -org.apache.camel -camel-hystrix -x.x.x - - - -[[Hystrix-URIformat]] -URI format -^^ - -[source,java] -hystrix::groupKey[?options] - -[[Hystrix-URIOptions]] -URI Options -^^^ - -All URI options can be overriden through message headers. Most of the -default values are coming from Hystrix itself. - - -// component options: START -The Hystrix component has no options. -// component options: END - - - - -// endpoint options: START -The Hystrix component supports 38 endpoint options which are listed below: - -{% raw %} -[width="100%",cols="2s,1,1m,1m,5",options="header"] -|=== -| Name | Group | Default | Java Type | Description -| groupKey | producer | | String | *Required* Specifies the group key to use -| cacheKey | producer | | String | Specifies the cache key to use. Uses the simple language as the expression. But you can refer to an existing expression using lookup. -| commandKey | producer | CamelHystrixCommand | String | Used to identify a HystrixCommand instance for statistics circuit-breaker properties etc. By default this will be derived from
[1/2] camel git commit: CAMEL-9983: camel-hystrix - Lets removed the component now that we have the EIP
Repository: camel Updated Branches: refs/heads/master f84963b2b -> 93f5952e4 http://git-wip-us.apache.org/repos/asf/camel/blob/93f5952e/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/HystrixProducer.java -- diff --git a/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/HystrixProducer.java b/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/HystrixProducer.java deleted file mode 100644 index ba88c8c..000 --- a/components/camel-hystrix/src/main/java/org/apache/camel/component/hystrix/HystrixProducer.java +++ /dev/null @@ -1,387 +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.hystrix; - -import com.netflix.hystrix.HystrixCommand; -import com.netflix.hystrix.HystrixCommandGroupKey; -import com.netflix.hystrix.HystrixCommandKey; -import com.netflix.hystrix.HystrixCommandMetrics; -import com.netflix.hystrix.HystrixCommandProperties; -import com.netflix.hystrix.HystrixRequestCache; -import com.netflix.hystrix.HystrixThreadPoolKey; -import com.netflix.hystrix.HystrixThreadPoolMetrics; -import com.netflix.hystrix.HystrixThreadPoolProperties; -import com.netflix.hystrix.strategy.HystrixPlugins; -import com.netflix.hystrix.strategy.concurrency.HystrixRequestContext; -import org.apache.camel.Endpoint; -import org.apache.camel.Exchange; -import org.apache.camel.Expression; -import org.apache.camel.impl.DefaultProducer; -import org.apache.camel.impl.ProducerCache; -import org.apache.camel.util.CamelContextHelper; -import org.apache.camel.util.EndpointHelper; -import org.apache.camel.util.ServiceHelper; - -/** - * The Hystrix producer. - */ -public class HystrixProducer extends DefaultProducer { -private HystrixConfiguration configuration; -private HystrixRequestContext requestContext; -private ProducerCache producerCache; - -public HystrixProducer(HystrixEndpoint endpoint, HystrixConfiguration configuration) { -super(endpoint); -this.configuration = configuration; -} - -public void process(final Exchange exchange) throws Exception { -HystrixCommand.Setter setter = HystrixCommand.Setter.withGroupKey( - HystrixCommandGroupKey.Factory.asKey(exchange.getIn().getHeader(HystrixConstants.CAMEL_HYSTRIX_GROUP_KEY, configuration.getGroupKey(), String.class))); - -setCommandPropertiesDefaults(setter, exchange); -setThreadPoolPropertiesDefaults(setter, exchange); - -// lookup the endpoints to use, which can be overridden from headers -String run = exchange.getIn().getHeader(HystrixConstants.CAMEL_HYSTRIX_RUN_ENDPOINT, configuration.getRunEndpoint(), String.class); -String fallback = exchange.getIn().getHeader(HystrixConstants.CAMEL_HYSTRIX_FALLBACK_ENDPOINT, configuration.getFallbackEndpoint(), String.class); -Endpoint runEndpoint = exchange.getContext().getEndpoint(run); -Endpoint fallbackEndpoint = fallback != null ? exchange.getContext().getEndpoint(fallback) : null; - -if (log.isDebugEnabled()) { -log.debug("Run endpoint: {}", runEndpoint); -log.debug("Fallback endpoint: {}", fallbackEndpoint); -} - -CamelHystrixCommand camelHystrixCommand = new CamelHystrixCommand(setter, exchange, getCacheKey(exchange), producerCache, runEndpoint, fallbackEndpoint); - -checkRequestContextPresent(exchange); -clearCache(camelHystrixCommand.getCommandKey(), exchange); -camelHystrixCommand.execute(); - -if (configuration.isMetricsEnabled()) { -populateWithMetrics(exchange, camelHystrixCommand); -} -} - -private void setCommandPropertiesDefaults(HystrixCommand.Setter setter, Exchange exchange) { -HystrixCommandProperties.Setter commandDefaults = HystrixCommandProperties.Setter(); -setter.andCommandPropertiesDefaults(commandDefaults); - -if (exchange.getIn().getHeader(HystrixConstants.CAMEL_HYSTRIX_COMMAND_KEY, configuration.getCommandKey(), String.class) != null) { -setter.andCommandKey(HystrixCommandKey.Factory.asKey( -
svn commit: r989000 - in /websites/production/camel/content: cache/main.pageCache camel-2180-release.html
Author: buildbot Date: Tue May 24 07:19:57 2016 New Revision: 989000 Log: Production update by buildbot for camel Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/camel-2180-release.html Modified: websites/production/camel/content/cache/main.pageCache == Binary files - no diff available. Modified: websites/production/camel/content/camel-2180-release.html == --- websites/production/camel/content/camel-2180-release.html (original) +++ websites/production/camel/content/camel-2180-release.html Tue May 24 07:19:57 2016 @@ -85,7 +85,7 @@ -Camel 2.18.0 release (currently in progress)http://camel.apache.org/download.data/camel-box-v1.0-150x200.png; data-image-src="http://camel.apache.org/download.data/camel-box-v1.0-150x200.png;>New and NoteworthyWelcome to the 2.18.0 release which approx XXX issues resolved (new features, improvements and bug fixes such as...)Added Hystrix EIP as EIP pattern that uses native Hystrix as the Circuit Breaker implementation.This requires havingcamel-hsytrixon the classpath.Improved theBean component to better match method parameter types when usingSimple language as parameter values.AddedBindyConverter that allows to implement custom data converters forBindyThe access in theRest DSL has been deprecated and no longer in use - its not part of swagger specification anymore.Camel-NATSnow uses JNATS client instead of the deprecated Java_nats one.During startup ofCamelContext the services that are used as part of routes are now deferred being started to the end of the startup process. Some IoC frameworks like Spring can otherwise causes a circular dependency issue if services are started too early. A side effect is that if service startup failures happen w hen being started later, they are now wrapped in the FailedToStartupRouteException to better pin point which route thas the problem.Improved the startup sequence ofSpring Java Config to be similar toSpring Boot that helps prevent Spring initialization errors about circular dependencies issues.Added PATCH toRest DSLAdded "starts with" and "ends with" operator to the Simplelanguage.AddedBeanIOSplitter toBeanIO that can be used with theSplitter EIP to split big payloads in streaming mode without reading the entire content into memory.Some of the AWScomponents allows to specify ARN in the endpoint configuration.The create operation inZookeeper now creates sub paths if missing.Added support for async mode forSERVLET component to leverage Asynchronous Servlet from the Servlet 3.0 spec.Beancomponent and Bean Languagevalidates method name must be a valid according to java identifier rules, and also if parameter syntax has an ending parenthesis.You can now use@RunWith(CamelSpringBootJUnit4ClassRunner.class) to test CamelSpring Bootapplications and use the Camel test annotations fromSpring Testing such as@MockEndpoints.To turn on logging exhausted message body with the message history you can configure this easily on the CamelContext level withsetLogExhaustedMessageBodyCamel-Infinispan now supports Aggregation Repository: InfinispanLocalAggregationRepository and InfinispanRemoteAggregationRepositoryTheSQL Componentand ElSqlnow supports outputType=StreamListto use an iterator for the output of the SQL query that allows to process the data in a streaming fashion such as with theSplitter EIP to process the data row by row, and load data from the database as needed.JPA now includes aJpaPollingConsumer implementation that better supportsContent Enricher usingpollEnrich to do a on-demand poll that returns either none, one or a list of entities as the result.CallingBeanwith method parameters defined usingSimple parameters, now avoids an intermediate conversion of the parameters to a String value. This ensures the passed in values when calling the bean method is using the parameter type as-is fromSimple.Camel CDI now supports importing Camel XML configuration filesCamel CDIdoes not deploy an empty Camel context bean anymore if not route builder beans nor Camel beans are deployedCamel CDIadds the@Named qualifier to Camel route management events so that it's possible to observe these events for a specific route with an explicit idCamel BeanIO now supports the possibility to use a custom BeanReaderErrorHandler implementation in his configurationCamel Kubernetes now supports Kubernetes ConfigMap featureTheTokenizer andXMLTokenizer language now supports using Simple expressions as the token / xml tag names so they can be dynamic values.AddedfilterDirectory andfilterFile options toFile2 so filtering can be done usingSimple language or predicates.Optimize Camel to only enable AllowUseOriginalMessage if in use by error handler orOnCompletion. End user who
camel git commit: CAMEL-9986: MIME-Multipart Data Format is inconsistent if trying to unmarshal non-MIME data
Repository: camel Updated Branches: refs/heads/master ff99845fb -> f84963b2b CAMEL-9986: MIME-Multipart Data Format is inconsistent if trying to unmarshal non-MIME data Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f84963b2 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f84963b2 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f84963b2 Branch: refs/heads/master Commit: f84963b2ba5e7146b0e4e59df3dd4195640443ff Parents: ff99845 Author: Stephan SianoAuthored: Tue May 24 09:09:33 2016 +0200 Committer: Stephan Siano Committed: Tue May 24 09:12:27 2016 +0200 -- .../mime/multipart/MimeMultipartDataFormat.java | 21 ++-- .../multipart/MimeMultipartDataFormatTest.java | 36 +++- 2 files changed, 45 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/f84963b2/components/camel-mail/src/main/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormat.java -- diff --git a/components/camel-mail/src/main/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormat.java b/components/camel-mail/src/main/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormat.java index 6504bc3..86e5f35 100644 --- a/components/camel-mail/src/main/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormat.java +++ b/components/camel-mail/src/main/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormat.java @@ -245,18 +245,17 @@ public class MimeMultipartDataFormat implements DataFormat { BodyPart bp = (BodyPart) content; camelMessage.setBody(bp.getInputStream()); contentType = bp.getContentType(); -} else { -// Last fallback: I don't see how this can happen, but we do this -// just to be safe -camelMessage.setBody(content); -} -if (contentType != null && !DEFAULT_CONTENT_TYPE.equals(contentType)) { -camelMessage.setHeader(CONTENT_TYPE, contentType); -ContentType ct = new ContentType(contentType); -String charset = ct.getParameter("charset"); -if (charset != null) { -camelMessage.setHeader(Exchange.CONTENT_ENCODING, MimeUtility.javaCharset(charset)); +if (contentType != null && !DEFAULT_CONTENT_TYPE.equals(contentType)) { +camelMessage.setHeader(CONTENT_TYPE, contentType); +ContentType ct = new ContentType(contentType); +String charset = ct.getParameter("charset"); +if (charset != null) { +camelMessage.setHeader(Exchange.CONTENT_ENCODING, MimeUtility.javaCharset(charset)); +} } +} else { +// If we find no body part, try to leave the message alone +LOG.info("no MIME part found"); } return camelMessage; } http://git-wip-us.apache.org/repos/asf/camel/blob/f84963b2/components/camel-mail/src/test/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormatTest.java -- diff --git a/components/camel-mail/src/test/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormatTest.java b/components/camel-mail/src/test/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormatTest.java index db62669..7759c49 100644 --- a/components/camel-mail/src/test/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormatTest.java +++ b/components/camel-mail/src/test/java/org/apache/camel/dataformat/mime/multipart/MimeMultipartDataFormatTest.java @@ -16,6 +16,7 @@ */ package org.apache.camel.dataformat.mime.multipart; +import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; @@ -299,6 +300,38 @@ public class MimeMultipartDataFormatTest extends CamelTestSupport { unmarshalAndCheckAttachmentName("@camel.apache.org"); } +@Test +public void unmarshalNonMimeBody() { +in.setBody("This is not a MIME-Multipart"); +Exchange out = template.send("direct:unmarshalonly", exchange); +assertNotNull(out.getOut()); +String bodyStr = out.getOut().getBody(String.class); +assertEquals("This is not a MIME-Multipart", bodyStr); +} + +@Test +public void unmarshalInlineHeadersNonMimeBody() { +in.setBody("This is not a MIME-Multipart"); +Exchange out = template.send("direct:unmarshalonlyinlineheaders", exchange); +assertNotNull(out.getOut()); +String bodyStr =
[2/3] camel git commit: Fixed typo in Docs summary
Fixed typo in Docs summary Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/007620e5 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/007620e5 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/007620e5 Branch: refs/heads/master Commit: 007620e5d16e0d6d9285d7542d6aec06dc825807 Parents: 13a7ea9 Author: Andrea CosentinoAuthored: Tue May 24 09:01:46 2016 +0200 Committer: Andrea Cosentino Committed: Tue May 24 09:01:46 2016 +0200 -- docs/user-manual/en/SUMMARY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/007620e5/docs/user-manual/en/SUMMARY.md -- diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md index 1d7f425..6ed7fce 100644 --- a/docs/user-manual/en/SUMMARY.md +++ b/docs/user-manual/en/SUMMARY.md @@ -241,7 +241,7 @@ * [Yammer](yammer.adoc) * [ZooKeeper](zookeeper.adoc) -* [Expession Languages](languages.adoc) +* [Expression Languages](languages.adoc) * [Bean Language](bean-language.adoc) * [Constant](constant.adoc) * [EL](juel.adoc)
[1/3] camel git commit: Added camel-script docs to Gitbook
Repository: camel Updated Branches: refs/heads/master 72e3b27e5 -> ff99845fb Added camel-script docs to Gitbook Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/13a7ea9a Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/13a7ea9a Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/13a7ea9a Branch: refs/heads/master Commit: 13a7ea9a3134a26da61f2f3ac6d4642c839a6d4f Parents: 72e3b27 Author: Andrea CosentinoAuthored: Tue May 24 08:59:44 2016 +0200 Committer: Andrea Cosentino Committed: Tue May 24 08:59:58 2016 +0200 -- .../camel-script/src/main/docs/script.adoc | 102 +++ docs/user-manual/en/SUMMARY.md | 1 + 2 files changed, 103 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/13a7ea9a/components/camel-script/src/main/docs/script.adoc -- diff --git a/components/camel-script/src/main/docs/script.adoc b/components/camel-script/src/main/docs/script.adoc new file mode 100644 index 000..7d3a77a --- /dev/null +++ b/components/camel-script/src/main/docs/script.adoc @@ -0,0 +1,102 @@ +[[Script-Script]] +Script +~~ + +*Available as of Camel 2.16* + +Is used to execute a script which does not change the message (by +default). This is useful when you need to invoke some logic that are not +in Java code such as JavaScript, Groovy or any of the +other link:languages.html[Languages]. The message body is not changed +(by default) however the scripting context has access to the current +Exchange and can essentially change the message or headers directly. But +the return value from the script is discarded and not used. If the +return value should be used as a changed message body then +use link:message-translator.html[Message Translator] EIP instead. + +[[Script-UsingfromJavaDSL]] +Using from Java DSL +^^^ + +The route below will read the file contents and validate them against a +regular expression. + +[source,java] +--- +from("file://inbox") + .script().groovy("// some groovy code goes here") + .to("bean:MyServiceBean.processLine"); +--- + +[[Script-UsingfromSpringDSL]] +Using from Spring DSL +^ + +And from XML its easy as well + +[source,xml] +-- + + + + // some groovy code goes here + + + + + +-- + +Mind that you can use CDATA in XML if the groovy scrip uses < > etc + + + +[source,xml] +- + + + ++ + + + + +- + +[[Script-Usingexternalscriptfiles]] +Using external script files +^^^ + +You can refer to external script files instead of inlining the script. +For example to load a groovy script from the classpath you need to +prefix the value with *resource:* as shown: + +[source,xml] +--- + + + + resource:classpath:com/foo/myscript.groovy + + + + + +--- + +You can also refer to the script from the file system with file: instead +of classpath: such as file:/var/myscript.groovy + + + +[[Script-UsingThisPattern]] +Using This Pattern +++ + +If you would like to use this EIP Pattern then please read the +link:getting-started.html[Getting Started], you may also find the +link:architecture.html[Architecture] useful particularly the description +of link:endpoint.html[Endpoint] and link:uris.html[URIs]. Then you could +try out some of the link:examples.html[Examples] first before trying +this pattern out. http://git-wip-us.apache.org/repos/asf/camel/blob/13a7ea9a/docs/user-manual/en/SUMMARY.md -- diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md index d34ba40..1d7f425 100644 --- a/docs/user-manual/en/SUMMARY.md +++ b/docs/user-manual/en/SUMMARY.md @@ -231,6 +231,7 @@ * [Scp](scp.adoc) * [Schematron](schematron.adoc) * [SCR](camel-and-scr.adoc) +* [Script](script.adoc) * [SJMS](sjms.adoc) * [SJMS Batch](sjms-batch.adoc) * [Telegram](telegram.adoc)
[3/3] camel git commit: Added scripting-languages page in docs
Added scripting-languages page in docs Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ff99845f Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ff99845f Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ff99845f Branch: refs/heads/master Commit: ff99845fba4cce8a8cd6d43e64313bbd15653b23 Parents: 007620e Author: Andrea CosentinoAuthored: Tue May 24 09:09:50 2016 +0200 Committer: Andrea Cosentino Committed: Tue May 24 09:09:50 2016 +0200 -- docs/user-manual/en/SUMMARY.md | 1 + docs/user-manual/en/scripting-languages.adoc | 177 ++ 2 files changed, 178 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/ff99845f/docs/user-manual/en/SUMMARY.md -- diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md index 6ed7fce..253cb46 100644 --- a/docs/user-manual/en/SUMMARY.md +++ b/docs/user-manual/en/SUMMARY.md @@ -250,6 +250,7 @@ * [Ognl](ognl.adoc) * [Ruby](ruby.adoc) * [SQL](josql.adoc) +* [Scripting languages](scripting-languages.adoc) * Data Formats * [BeanIO](beanio.adoc) http://git-wip-us.apache.org/repos/asf/camel/blob/ff99845f/docs/user-manual/en/scripting-languages.adoc -- diff --git a/docs/user-manual/en/scripting-languages.adoc b/docs/user-manual/en/scripting-languages.adoc new file mode 100644 index 000..e62c1ad --- /dev/null +++ b/docs/user-manual/en/scripting-languages.adoc @@ -0,0 +1,177 @@ +[[ScriptingLanguages-ScriptingLanguages]] +Scripting Languages +~~~ + +Camel supports a number of scripting languages which can be used to +create an link:expression.html[Expression] or +link:predicate.html[Predicate] via the standard +http://jcp.org/en/jsr/detail?id=223[JSR 223] which is a standard part of +Java 6. + +The following scripting languages are integrated into the DSL: + +[width="100%",cols="50%,50%",options="header",] +|=== +|Language |DSL keyword + +|EL |`el` + +|Groovy |`groovy` + +|JavaScript |`javaScript` + +|JoSQL |`sql` + +|JXPath |`jxpath` + +|MVEL |`mvel` + +|OGNL |`ognl` + +|PHP |`php` + +|Python |`python` + +|Ruby |`ruby` + +|XPath |`xpath` + +|XQuery |`xquery` +|=== + +However any http://jcp.org/en/jsr/detail?id=223[JSR 223] scripting +language can be used using the generic DSL methods. + +[[ScriptingLanguages-ScriptContext]] +ScriptContext +^ + +The JSR-223 scripting languages ScriptContext is pre configured with the +following attributes all set at `ENGINE_SCOPE`: + +[width="100%",cols="30%,30%,40%",options="header",] +|=== +|Attribute |Type |Value + +|context |`org.apache.camel.CamelContext` |The Camel Context ( It cannot be used in groovy) + +|camelContext |`org.apache.camel.CamelContext` |The Camel Context + +|exchange |`org.apache.camel.Exchange` |The current Exchange + +|request |`org.apache.camel.Message` |The message (IN message) + +|response |`org.apache.camel.Message` |*Deprecated*: The OUT message. The OUT message if null by default. Use +IN message instead. + +|properties |`org.apache.camel.builder.script.PropertiesFunction` |*Camel 2.9:* Function with a `resolve` method to make it easier to use +Camels link:properties.html[Properties] component from scripts. See +further below for example. +|=== + +See link:scripting-languages.html[Scripting Languages] for the list of +languages with explicit DSL support. + +[[ScriptingLanguages-AdditionalargumentstoScriptingEngine]] +Additional arguments to ScriptingEngine +^^^ + +*Available as of Camel 2.8* + +You can provide additional arguments to the `ScriptingEngine` using a +header on the Camel message with the key `CamelScriptArguments`. +See this example: + +[[ScriptingLanguages-Usingpropertiesfunction]] +Using properties function +^ + +*Available as of Camel 2.9* + +If you need to use the link:properties.html[Properties] component from a +script to lookup property placeholders, then its a bit cumbersome to do +so. For example to set a header name myHeader with a value from a property +placeholder, which key is provided in a header named "foo". + +{% raw %} +[source,java] +-- +.setHeader("myHeader").groovy("context.resolvePropertyPlaceholders('{{' +
camel git commit: Added camel-scr docs to Gitbook
Repository: camel Updated Branches: refs/heads/master 79fbb6a3b -> 72e3b27e5 Added camel-scr docs to Gitbook Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/72e3b27e Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/72e3b27e Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/72e3b27e Branch: refs/heads/master Commit: 72e3b27e504cabb9fe76c5623fd7c0c530b1f5b8 Parents: 79fbb6a Author: Andrea CosentinoAuthored: Tue May 24 08:45:25 2016 +0200 Committer: Andrea Cosentino Committed: Tue May 24 08:45:25 2016 +0200 -- .../camel-scr/src/main/docs/camel-and-scr.adoc | 677 +++ docs/user-manual/en/SUMMARY.md | 1 + 2 files changed, 678 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/72e3b27e/components/camel-scr/src/main/docs/camel-and-scr.adoc -- diff --git a/components/camel-scr/src/main/docs/camel-and-scr.adoc b/components/camel-scr/src/main/docs/camel-and-scr.adoc new file mode 100644 index 000..577fd93 --- /dev/null +++ b/components/camel-scr/src/main/docs/camel-and-scr.adoc @@ -0,0 +1,677 @@ +[[CamelandSCR-WorkingwithCamelandSCR]] +Working with Camel and SCR +~~ + +SCR stands for Service Component Runtime and is an implementation of +OSGi Declarative Services specification. SCR enables any plain old Java +object to expose and use OSGi services with no boilerplate code. + +OSGi framework knows your object by looking at SCR descriptor files in +its bundle which are typically generated from Java annotations by a +plugin such as `org.apache.felix:maven-scr-plugin`. + +Running Camel in an SCR bundle is a great alternative for Spring DM and +Blueprint based solutions having significantly fewer lines of code +between you and the OSGi framework. Using SCR your bundle can remain +completely in Java world; there is no need to edit XML or properties +files. This offers you full control over everything and means your IDE +of choice knows exactly what is going on in your project. + +[[CamelandSCR-CamelSCRsupport]] +Camel SCR support +^ + +INFO: *Available as of Camel 2.15.0*. +Camel-scr bundle is not included in Apache Camel versions prior 2.15.0, +but the artifact itself can be used with any Camel version since 2.12.0. + +`org.apache.camel/camel-scr` bundle provides a base class, +`AbstractCamelRunner`, which manages a Camel context for you and a +helper class, `ScrHelper`, for using your SCR properties in unit tests. +Camel-scr feature for Apache Karaf defines all features and bundles +required for running Camel in SCR bundles. + +`AbstractCamelRunner` class ties CamelContext's lifecycle to Service +Component's lifecycle and handles configuration with help of Camel's +PropertiesComponent. All you have to do to make a Service Component out +of your java class is to extend it from `AbstractCamelRunner` and add +the following `org.apache.felix.scr.annotations` on class level: + +*Add required annotations* + +[source,java] +--- +@Component +@References({ +@Reference(name = "camelComponent",referenceInterface = ComponentResolver.class, +cardinality = ReferenceCardinality.MANDATORY_MULTIPLE, policy = ReferencePolicy.DYNAMIC, +policyOption = ReferencePolicyOption.GREEDY, bind = "gotCamelComponent", unbind = "lostCamelComponent") +}) +--- + + + +Then implement `getRouteBuilders()` method which returns the Camel +routes you want to run: + + + +*Implement getRouteBuilders()* + +[source,java] +-- +@Override +protected List getRouteBuilders() { +List routesBuilders = new ArrayList<>(); +routesBuilders.add(new YourRouteBuilderHere(registry)); +routesBuilders.add(new AnotherRouteBuilderHere(registry)); +return routesBuilders; +} +-- + +And finally provide the default configuration with: + +*Default configuration in annotations* + +[source,java] +- +@Properties({ + @Property(name = "camelContextId", value = "my-test"), + @Property(name = "active", value = "true"), + @Property(name = "...", value = "..."), + ... +}) +- + + + +That's all. And if you used `camel-archetype-scr` to generate a project +all this is already taken care of. + +Below is an example of a complete Service