Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id ECA1E200B62 for ; Fri, 12 Aug 2016 17:19:39 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id EB4B4160AB0; Fri, 12 Aug 2016 15:19:39 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 988D3160A85 for ; Fri, 12 Aug 2016 17:19:38 +0200 (CEST) Received: (qmail 11984 invoked by uid 500); 12 Aug 2016 15:19:37 -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 11975 invoked by uid 99); 12 Aug 2016 15:19:37 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Aug 2016 15:19:37 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 5C38C185892 for ; Fri, 12 Aug 2016 15:19:37 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.374 X-Spam-Level: X-Spam-Status: No, score=0.374 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id sVvDRFHkwmNh for ; Fri, 12 Aug 2016 15:19:31 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTP id E8C2E5F3F3 for ; Fri, 12 Aug 2016 15:19:30 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 03679E0054 for ; Fri, 12 Aug 2016 15:19:29 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id B7C5E3A02FD for ; Fri, 12 Aug 2016 15:19:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r995004 - in /websites/production/camel/content: binding.html cache/main.pageCache jcache.html Date: Fri, 12 Aug 2016 15:19:29 -0000 To: commits@camel.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160812151929.B7C5E3A02FD@svn01-us-west.apache.org> archived-at: Fri, 12 Aug 2016 15:19:40 -0000 Author: buildbot Date: Fri Aug 12 15:19:29 2016 New Revision: 995004 Log: Production update by buildbot for camel Modified: websites/production/camel/content/binding.html websites/production/camel/content/cache/main.pageCache websites/production/camel/content/jcache.html Modified: websites/production/camel/content/binding.html ============================================================================== --- websites/production/camel/content/binding.html (original) +++ websites/production/camel/content/binding.html Fri Aug 12 15:19:29 2016 @@ -84,58 +84,17 @@ -

Binding

- -

In Camel terms a binding is a way of wrapping an Endpoint in a contract; such as a Data Format, a Content Enricher or validation step. Bindings are completely optional and you can choose to use them on any camel endpoint.

- -

Bindings are inspired by the work of SwitchYard project adding service contracts to various technologies like Camel and many others. But rather than the SwitchYard approach of wrapping Camel in SCA, Camel Bindings provide a way of wrapping Camel endpoints with contracts inside the Camel framework itself; so you can use them easily inside any Camel route.

- -

Using Bindings

- -

A Binding is currently a bean which defines the contract (though we'll hopefully add bindings to the Camel DSL).

- -

There are a few approaches to defining a bound endpoint (i.e. an endpoint bound with a Binding).

- -

Using the binding URI

- -

You can prefix any endpoint URI with binding:nameOfBinding: where nameOfBinding is the name of the Binding bean in your registry.

-
- -
- -

Here we are using the "jaxb" binding which may, for example, use the JAXB Data Format to marshal and unmarshal messages.

- -

Using a BindingComponent

- -

There is a Component called BindingComponent which can be configured in your Registry by dependency injection which allows the creation of endpoints which are already bound to some binding.

- -

For example if you registered a new component called "jsonmq" in your registry using code like this

-
- -
- -

Then you could use the endpoint as if it were any other endpoint.

-
- -
-

which would be using the queueus "foo.myQueue" and "foo.anotherQueue" and would use the given Jackson Data Format to marshal on and off the queue.

- -

When to use Bindings

- -

If you only use an endpoint once in a single route; a binding may actually be more complex and more work than just using the 'raw' endpoint directly and using explicit marshalling and validation in the camel route as normal.

- -

However bindings can help when you are composing many routes together; or using a single route as a 'template' that is configured input and output endpoints; bindings then provide a nice way to wrap up a contract and endpoint together.

- -

Another good use case for bindings is when you are using many endpoints which use the same binding; rather than always having to mention a specific data format or validation rule, you can just use the BindingComponent to wrap the endpoints in the binding of your choice.

- -

So bindings are a composition tool really; only use them when they make sense - the extra complexity may not be worth it unless you have lots of routes or endpoints.

+

This would use the queues "foo.myQueue" and "foo.anotherQueue" and would use the given Jackson Data Format to marshal on and off the queue.

When to use Bindings

If you only use an endpoint once in a single route; a binding may actually be more complex and more work than just using the 'raw' endpoint directly and using explicit marshalling and validation in the camel route as normal.

However bindings can help when you are composing many routes together; or using a single route as a 'template' that is configured input and output endpoints; bindings then provide a nice way to wrap up a contract and endpoint together.

Another good use case for bindings is when you are using many endpoints which use the same binding; rather than always having to mention a specific data format or validation rule, you can just use the BindingComponent to wrap the endpoints in the binding of y our choice.

So bindings are a composition tool really; only use them when they make sense - the extra complexity may not be worth it unless you have lots of routes or endpoints.

URI format

-

You can append query options to the URI in the following format, ?option=value&option=#beanRef&...


Options

Name

Default Value

Description

cachingProvider

null

The fully qualified class name of the javax.cache.spi.CachingProvider

cacheConfiguration

null

A reference to a javax.cache.configuration.Configuration instance

cacheConfigurationProperties

null

A reference to a java.util.Properties for the javax.cache.spi.CachingProvider to create the javax.cache.CacheManager

configurationUri

null

An implementation specific URI for the javax.cache.CacheManager

cacheLoaderFactory

null

A reference to a javax.cache.configuration.Factory for javax.cache.integration.CacheLoader

cacheWriterFactory

null

A reference to a javax.cache.configuration.Factory for javax.cache.integration.CacheWriter

expiryPolicyFactory

null

A reference to a javax.cache.configuration.Factory for javax.cache.expiry.ExpiryPolicy

readThrough

false

A flag indicating if "read-through" mode is required

writeThrough

false

A flag indicating if "write-through" mode is required

storeByValuetrueA flag indicating if the cache will be store-by-value or store-by-reference

statisticsEnabled

fasle

A flag indicating if statistics gathering is enabled

managementEnabled

false

A flag indicating if management is enabled

filteredEvents

null

A comma separated list of event types to filter. If you use this option eventFilters one will be ignored.

eventFilters

null

A comma separated list of javax.cache.event.CacheEntryEventFilter references. If you use this option filteredEvents one will be ignored.

oldValueRequiredfalseA flag indicating if the old value is required for events, supported values are CREATED, UPDATED, REMOVED, EXPIRED
synchronousfalseA flag indicating if the event listener should block the thread causing the event
actionnullThe default action to apply, value in the header has the priority
createCacheIfNotExiststrueConfigure if the cache identified by cacheName need to be created if it does not exists

Header variables

Name

Type

Description

CamelJCacheAction

java.lang.String

The action to perform, supported values are PUT, PUTALL, PUTIFABSENT, GET, GETALL, GETANDREMOVE, GETANDREPLACE, GETANDPUT, REPLACE, REMOVE, REMOVEALL, INVOKE, CLEAR

CamelJCacheResult

java.lang.Object

The result of an action, i.e. Boolean for PUT, REMOVE, REPLACE

CamelJCacheEventType

java.lang.String

The type of event javax.cache.event.EventType

CamelJCacheKey

java.lang.Object

A key to apply an action

CamelJCacheKeysjava.util.Set<java-lang.Object>A set of keys to apply an action, used for GETALL, REMOVEALL, INVOKE
CamelJCacheOldValuejava.lang.ObjectOn consumer side, the header value contains the old value associated to a key. On producer side, the header must contains the expected old value to use CAS like operation
CamelJCacheEntryProcessorjavax.cache.processor.EntryProcessorThe entry processor to use for INVOKE action
CamelJCacheEntryArgsjava.util.collection<java.lang.Object>Additional arguments to pass to the javax.cache.processor.EntryProcessor

 

JCache based idempotent repository example:

 

+

You can append query options to the URI in the following format, ?option=value&option=#beanRef&...


Options

Name

Default Value

Description

cachingProvider

null

The name of the caching provider that could be

  • the fully qualified class name of the javax.cache.spi.CachingProvider
  • an alias among:
    • hazelcast (com.hazelcast.cache.HazelcastCachingProvid er)
    • ehcache (org.ehcache.jsr107.EhcacheCachingProvider)
    • caffeine (com.github.benmanes.caffeine.jcache.spi.CaffeineCachingProvider)
    • infinispan-embedded (org.infinispan.jcache.embedded.JCachingProvider)

cacheConfiguration

null

A reference to a javax.cache.configuration.Configuration instance

cacheConfigurationProperties

null

A reference to a java.util.Properties for the javax.cache.spi.CachingProvider to create the javax.cache.CacheManager

configurationUri

null

An implementation specific URI for the javax.cache.CacheManager

cacheLoaderFactory

null

A reference to a javax.cache.configuration.Factory for javax.cache.integration.CacheLoader

cacheWriterFactory

null

A reference to a javax.cache.configuration.Factory for javax.cache.integration.CacheWriter

expiryPolicyFactory

null

A reference to a javax.cache.configuration.Factory for javax.cache.expiry.ExpiryPolicy

readThrough

false

A flag indicating if "read-through" mode is required

writeThrough

false

A flag indicating if "write-through" mode is required

storeByValuetrueA flag indicating if the cache will be store-by-value or store-by-reference

statisticsEnabled

fasle

A flag indicating if statistics gathering is enabled

managementEnabled

false

A flag indicating if management is enabled

filteredEvents

null

A comma separated list of event types to filter. If you use this option eventFilters one will be ignored.

eventFilters

null

A comma separated list of javax.cache.event.CacheEntryEventFilter references. If you use this option filteredEvents one will be ignored.

oldValueRequiredfalseA flag indicating if the old value is required for events, supported values are CREATED, UPDATED, REMOVED, EXPIRED
synchronousfalseA flag indicating if the event listener should blo ck the thread causing the event
actionnullThe default action to apply, value in the header has the priority
createCacheIfNotExiststrueConfigure if the cache identified by cacheName need to be created if it does not exists
lookupProvidersfalseOSGi only: When set to true, camel-jcache tries to find the bundle providing the provider configured by the cachingProvider option and it succeeds is sets-up a special classloader to boostrap the cache
< /div>

Header variables

Name

Type

Description

CamelJCacheAction

java.lang.String

The action to perform, supported values are PUT, PUTALL, PUTIFABSENT, GET, GETALL, GETANDREMOVE, GETANDREPLACE, GETANDPUT, REPLACE, REMOVE, REMOVEALL, INVOKE, CLEAR

CamelJCacheResult

java.lang.Object

The result of an action, i.e. Boolean fo r PUT, REMOVE, REPLACE

CamelJCacheEventType

java.lang.String

The type of event javax.cache.event.EventType

CamelJCacheKey

java.lang.Object

A key to apply an action

CamelJCacheKeysjava.util.Set<java-lang.Object>A set of keys to apply an action, used for GETALL, REMOVEALL, INVOKE
CamelJCacheOldValuejava.lang.ObjectOn consumer side, the header value contains the old value associated to a key. On producer side, the header must contains the expected old value to use CAS like operation
CamelJCacheEntryProcessorjavax.cache.processor.EntryProcessorThe entry processor to use for INVOKE action
CamelJCacheEntryArgsjava.util.collection<java.lang.Object>Additional arguments to pass to the javax.cache.processor.EntryProcessor

 

JCache based idempotent repository example: