Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F3AACFDEF for ; Mon, 2 Sep 2013 11:21:05 +0000 (UTC) Received: (qmail 28490 invoked by uid 500); 2 Sep 2013 11:21:05 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 28412 invoked by uid 500); 2 Sep 2013 11:21:04 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 28405 invoked by uid 99); 2 Sep 2013 11:21:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Sep 2013 11:21:04 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Sep 2013 11:20:58 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id E5DEC238889B for ; Mon, 2 Sep 2013 11:20:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r877021 - in /websites/production/camel/content: blueprint-testing.html cache/main.pageCache camel-2120-release.html Date: Mon, 02 Sep 2013 11:20:35 -0000 To: commits@camel.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130902112035.E5DEC238889B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: buildbot Date: Mon Sep 2 11:20:35 2013 New Revision: 877021 Log: Production update by buildbot for camel Modified: websites/production/camel/content/blueprint-testing.html websites/production/camel/content/cache/main.pageCache websites/production/camel/content/camel-2120-release.html Modified: websites/production/camel/content/blueprint-testing.html ============================================================================== --- websites/production/camel/content/blueprint-testing.html (original) +++ websites/production/camel/content/blueprint-testing.html Mon Sep 2 11:20:35 2013 @@ -181,6 +181,64 @@ If you have multiple OSGi Blueprint XML <scope>test</scope> </dependency> ]]> + + + +

Adding services on startup

+

Available as of Camel 2.11.2/2.12.0

+ +

When using camel-test-blueprint you may do unit tests which requires using shared services which is not available during unit testing, but only in the real OSGi container, for example a shared DataSource.

+ +

To make it easier to register services on startup, such as a standalone DataSource or any other service, you can override the method addServicesOnStartup when your unit test class extends CamelBlueprintTestSupport.

+ +

In the example below we register a service org.apache.camel.test.blueprint.MyService using the name myService having a property beer=Carlsberg, as shown below:

+
+ +
+ +

The asService is a builder method that makes it easy to register a service with a single property. If you need more properties you can use the asService method that takes a Dictionary as argument. And if you do not need any properties, then just pass in null, eg:

+
+ +
+ +

This allows us to use the service by calling a method on it from a Camel Bean component in a route as shown:

+
+ +
+ +

Notice the bean endpoint uses the service name myService which was the name we registered the service as. You can also use the fully qualified class name instead, which is more common with OSGi.

+ +
+ +
+ +

And in the route we use the FQN name:

+
+
Modified: websites/production/camel/content/cache/main.pageCache ============================================================================== Binary files - no diff available. Modified: websites/production/camel/content/camel-2120-release.html ============================================================================== --- websites/production/camel/content/camel-2120-release.html (original) +++ websites/production/camel/content/camel-2120-release.html Mon Sep 2 11:20:35 2013 @@ -94,7 +94,7 @@

Welcome to the 2.12.0 release which approx XXX issues resolved (new features, improvements and bug fixes such as...)

-
  • Endpoint Annotations along with automatically created HTML documentation for the endpoint parameters; this makes it easier for component developers to add a few refactoring-safe annotations to their Endpoint or Consumer implementations and, (along with javadoc comments on the field or setter method), get nice user documentation on how to use the endpoint for free.
  • ComponentConfiguration API provides a handy API for tools developers to introspect on a Component to find all the possible parameters, their types and any extra annotations (like Bean Validation Annotations) to be able to create/edit endpoints or URI strings so that tools can generate nicer UIs for configuring endpoints than just letting folks edit Strings.
  • Endpoi ntCompleter API provides a hook so that command line tools (like Karaf's shell), IDEs and web tools can get (bash tab like) auto-completion on endpoint paths (such as file or directory names, message queue names, database table names) when creating or using new endpoints
  • Reduced stack-frames in use during routing, that also makes Camel's stack traces being logged much less verbose. This also allows people to easier debug the internals of Camel as less AsyncCallback callbacks are in use during routing.
  • Easy to use Message History out of the box. And included message history as "route stack-trace" when exceptions logged by Error Handler to make it easier for end users to spot where the exception o ccurred.
  • Spring Web Services now supports setting/receiving SOAP headers more easily using a header on the Camel Message.
  • Evaluating Groovy expressions is faster as we cache the compiled scripts.
  • Added base64 option to Shiro Security to allow transferring security token over JMS and other transports as base64 encoded representation.
  • Made it easier to use Shiro Security as the credentials can be provided in headers, when sending a message to a secured route.
  • Bindy now supports enums.
  • Added new BacklogDebugger to perform live debugging of messages during routing. The BacklogDebugger has JMX API allows tooling to control the debugger.
  • While using the Jackson library through the JSON Dataformat there's now a jsonView attribute you could make use of directly inside the DSL itself.
  • SMPP now supports optional parameters in all commands where they are possible.
  • JDBC now supports named parameters.
  • Added timeout support for Direct producers to wait for cons umer to become active.
  • Added stats action to ControlBus to easily get performance statics in a single XML message.
  • Added support for request timeout on Netty producer, and to configure logging level on Netty consumer to be less noisy for ChannelClosedException which can flood the logs when client disconnects abruptly.
  • Spring Batch component producer now returns the JobExecution instance as the output message. Users can use the JobExecution instance to perform some operations using the Spring Batch API directly.
  • Added support for NULL values in SQL with named parameters.
  • Optimized Jetty streaming responses in non-chunked mode; and as well using buffer sizes based on HttpServletResponse.getBufferSize() instead of fixed size of 4kb.
  • Added greedy option to scheduled polling consumer.
  • Added support for accessing the length field on Java arrays in Simple language.
  • Added support for using JAXB annotations with Camel's Jackson JSON component.
  • Added the ability for Bindy to skip content when parsing fixed-length records.
  • MongoDB now supports aggregation queries.
  • Netty allows to use shared Netty boss and worker thread pools.
  • The Camel Maven Archetypes for component and data format now packages as OSGi bundles out of the box.
  • Easier Stream caching configuration using StreamCachingStrategy. Also allows spool directory per CamelContext instead of shared per JVM. And insight at runtime using JMX management. As well allowing to plugin 3rd party implementations.
  • Improved Netty to be able to join an UDP multicast group.
  • Using Camel Spring is now setting up Camel routes later in the process allow Spring to complete all of its dependency injection, before Camel RouteBuilder instances is configured. This allows to safely use Spring dependency injection in these RouteBuilder classes.
  • Services in a CamelContext which can only be enlisted once (eg it similar to a static in a JVM) has simpler and fixed MBean names in JMX.
  • JDBC based aggregation repository for the Aggregate EIP now supports optimistic locking, allows clustered Camel applications to use a shared database for the aggregation repository.
  • Recipient List stores a property (Exchange.RECIPIENT_LIST_ENDPOINT) on the Exchange with the URIs of the Endpoint the message was sent to.
  • Added mask option to Camel JMX to hide sensitive information such as passwords.
  • Added outputType option supporting SelectList, and SelectOne to SQL Component to dictate the output message body type when doing SQL SELECT queries.
  • Polling Consumers such as File, and FTP now supports using custom scheduler. Providing a new Quartz2, and Spring based out of the box, that allows to use CRON based scheduler.
  • Polling Consumers such as File, and FTP now supports backoff, to let the consumer be less aggressive, when there has been no messages to poll, or errors keeps occurring for a while.
  • Added support for XML Encryption 1.1 algorithms in the XMLSecurity data format. It is now possible to specify stronger digest algorithms when using RSA OAEP Key Transport algorithms.
  • Netty consumer now unbinds/binds the acceptor when the route is suspended/resumed.
  • EIPs supporting AggregationStrategy such as Aggregate, Splitter, Content Enricher now supports using a POJO as the AggregationStrategy, which allows to implement the aggregate logic with no Camel API dependency. See more details at the Aggregate page.
  • camel-jpa upgraded to use native JPA API instead of Springs deprecated JpaTemplate
  • Improved validation of routes being misconfigured on startup, when using onException, onCompletion, transacted, etc. as they must be configured as top-level on the route (eg in the start), and not later (such as nested in a Splitter).
  • Added new @PropertyInject annotation to inject property placeholders to POJOs
  • New class org.apache.camel.util.toolbox.AggregationStrategies as a starting point to obtain commonly used Aggregation Strategies for Multicast, Splitter, Aggregator, et c. EIPs.
  • New FlexibleAggregationStrategy serving as a one-stop to perform typical aggregation strategy logic out-of-the-box: filtering results, storing them in properties, headers or bodies, as a list, casting results, etc.
  • Improved performance when doing Bean method calls using Simple OGNL calls
  • Improved Dozer Type Conversion to work better with OSGi Blueprint (though Dozer 5.5 may be required to work even better)
  • JMS now also enlists topic destinations as managed endpoints in JMX
  • Graceful Shutdown now allows to suppress logging after CamelContext has been sto pped, due to a timeout hit, and there may still be inflight Exchanges that may afterwards be rejected being executed and causing WARN logs; which now can be suppressed.
+
  • Endpoint Annotations along with automatically created HTML documentation for the endpoint parameters; this makes it easier for component developers to add a few refactoring-safe annotations to their Endpoint or Consumer implementations and, (along with javadoc comments on the field or setter method), get nice user documentation on how to use the endpoint for free.
  • ComponentConfiguration API provides a handy API for tools developers to introspect on a Component to find all the possible parameters, their types and any extra annotations (like Bean Validation Annotations) to be able to create/edit endpoints or URI strings so that tools can generate nicer UIs for configuring endpoints than just letting folks edit Strings.
  • Endpoi ntCompleter API provides a hook so that command line tools (like Karaf's shell), IDEs and web tools can get (bash tab like) auto-completion on endpoint paths (such as file or directory names, message queue names, database table names) when creating or using new endpoints
  • Reduced stack-frames in use during routing, that also makes Camel's stack traces being logged much less verbose. This also allows people to easier debug the internals of Camel as less AsyncCallback callbacks are in use during routing.
  • Easy to use Message History out of the box. And included message history as "route stack-trace" when exceptions logged by Error Handler to make it easier for end users to spot where the exception o ccurred.
  • Spring Web Services now supports setting/receiving SOAP headers more easily using a header on the Camel Message.
  • Evaluating Groovy expressions is faster as we cache the compiled scripts.
  • Added base64 option to Shiro Security to allow transferring security token over JMS and other transports as base64 encoded representation.
  • Made it easier to use Shiro Security as the credentials can be provided in headers, when sending a message to a secured route.
  • Bindy now supports enums.
  • Added new BacklogDebugger to perform live debugging of messages during routing. The BacklogDebugger has JMX API allows tooling to control the debugger.
  • While using the Jackson library through the JSON Dataformat there's now a jsonView attribute you could make use of directly inside the DSL itself.
  • SMPP now supports optional parameters in all commands where they are possible.
  • JDBC now supports named parameters.
  • Added timeout support for Direct producers to wait for cons umer to become active.
  • Added stats action to ControlBus to easily get performance statics in a single XML message.
  • Added support for request timeout on Netty producer, and to configure logging level on Netty consumer to be less noisy for ChannelClosedException which can flood the logs when client disconnects abruptly.
  • Spring Batch component producer now returns the JobExecution instance as the output message. Users can use the JobExecution instance to perform some operations using the Spring Batch API directly.
  • Added support for NULL values in SQL with named parameters.
  • Optimized Jetty streaming responses in non-chunked mode; and as well using buffer sizes based on HttpServletResponse.getBufferSize() instead of fixed size of 4kb.
  • Added greedy option to scheduled polling consumer.
  • Added support for accessing the length field on Java arrays in Simple language.
  • Added support for using JAXB annotations with Camel's Jackson JSON component.
  • Added the ability for Bindy to skip content when parsing fixed-length records.
  • MongoDB now supports aggregation queries.
  • Netty allows to use shared Netty boss and worker thread pools.
  • The Camel Maven Archetypes for component and data format now packages as OSGi bundles out of the box.
  • Easier Stream caching configuration using StreamCachingStrategy. Also allows spool directory per CamelContext instead of shared per JVM. And insight at runtime using JMX management. As well allowing to plugin 3rd party implementations.
  • Improved Netty to be able to join an UDP multicast group.
  • Using Camel Spring is now setting up Camel routes later in the process allow Spring to complete all of its dependency injection, before Camel RouteBuilder instances is configured. This allows to safely use Spring dependency injection in these RouteBuilder classes.
  • Services in a CamelContext which can only be enlisted once (eg it similar to a static in a JVM) has simpler and fixed MBean names in JMX.
  • JDBC based aggregation repository for the Aggregate EIP now supports optimistic locking, allows clustered Camel applications to use a shared database for the aggregation repository.
  • Recipient List stores a property (Exchange.RECIPIENT_LIST_ENDPOINT) on the Exchange with the URIs of the Endpoint the message was sent to.
  • Added mask option to Camel JMX to hide sensitive information such as passwords.
  • Added outputType option supporting SelectList, and SelectOne to SQL Component to dictate the output message body type when doing SQL SELECT queries.
  • Polling Consumers such as File, and FTP now supports using custom scheduler. Providing a new Quartz2, and Spring based out of the box, that allows to use CRON based scheduler.
  • Polling Consumers such as File, and FTP now supports backoff, to let the consumer be less aggressive, when there has been no messages to poll, or errors keeps occurring for a while.
  • Added support for XML Encryption 1.1 algorithms in the XMLSecurity data format. It is now possible to specify stronger digest algorithms when using RSA OAEP Key Transport algorithms.
  • Netty consumer now unbinds/binds the acceptor when the route is suspended/resumed.
  • EIPs supporting AggregationStrategy such as Aggregate, Splitter, Content Enricher now supports using a POJO as the AggregationStrategy, which allows to implement the aggregate logic with no Camel API dependency. See more details at the Aggregate page.
  • camel-jpa upgraded to use native JPA API instead of Springs deprecated JpaTemplate
  • Improved validation of routes being misconfigured on startup, when using onException, onCompletion, transacted, etc. as they must be configured as top-level on the route (eg in the start), and not later (such as nested in a Splitter).
  • Added new @PropertyInject annotation to inject property placeholders to POJOs
  • New class org.apache.camel.util.toolbox.AggregationStrategies as a starting point to obtain commonly used Aggregation Strategies for Multicast, Splitter, Aggregator, et c. EIPs.
  • New FlexibleAggregationStrategy serving as a one-stop to perform typical aggregation strategy logic out-of-the-box: filtering results, storing them in properties, headers or bodies, as a list, casting results, etc.
  • Improved performance when doing Bean method calls using Simple OGNL calls
  • Improved Dozer Type Conversion to work better with OSGi Blueprint (though Dozer 5.5 may be required to work even better)
  • JMS now also enlists topic destinations as managed endpoints in JMX
  • Graceful Shutdown now allows to suppress logging after CamelContext has been sto pped, due to a timeout hit, and there may still be inflight Exchanges that may afterwards be rejected being executed and causing WARN logs; which now can be suppressed.
  • Made it easy to add custom services on startup when testing with Blueprint Testing.

Fixed Issues