otavio021 commited on
Commit
2f8ca06
·
verified ·
1 Parent(s): 7e14e17

Upload folder using huggingface_hub

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. camel-activemq.md +276 -0
  2. camel-activemq6.md +276 -0
  3. camel-amqp.md +337 -0
  4. camel-arangodb.md +93 -0
  5. camel-as2.md +89 -0
  6. camel-asterisk.md +72 -0
  7. camel-atmosphere-websocket.md +119 -0
  8. camel-atom.md +116 -0
  9. camel-avro.md +212 -0
  10. camel-aws-bedrock-agent-runtime.md +136 -0
  11. camel-aws-bedrock-agent.md +160 -0
  12. camel-aws-bedrock.md +830 -0
  13. camel-aws-cloudtrail.md +143 -0
  14. camel-aws-config.md +117 -0
  15. camel-aws-secrets-manager.md +393 -0
  16. camel-aws2-athena.md +408 -0
  17. camel-aws2-cw.md +163 -0
  18. camel-aws2-ddb.md +263 -0
  19. camel-aws2-ddbstream.md +181 -0
  20. camel-aws2-ec2.md +232 -0
  21. camel-aws2-ecs.md +168 -0
  22. camel-aws2-eks.md +168 -0
  23. camel-aws2-eventbridge.md +365 -0
  24. camel-aws2-iam.md +228 -0
  25. camel-aws2-kinesis-firehose.md +192 -0
  26. camel-aws2-kinesis.md +242 -0
  27. camel-aws2-kms.md +193 -0
  28. camel-aws2-lambda.md +225 -0
  29. camel-aws2-mq.md +216 -0
  30. camel-aws2-msk.md +199 -0
  31. camel-aws2-redshift-data.md +184 -0
  32. camel-aws2-s3.md +644 -0
  33. camel-aws2-ses.md +162 -0
  34. camel-aws2-sns.md +253 -0
  35. camel-aws2-sqs.md +389 -0
  36. camel-aws2-step-functions.md +202 -0
  37. camel-aws2-sts.md +182 -0
  38. camel-aws2-timestream.md +270 -0
  39. camel-aws2-translate.md +171 -0
  40. camel-azure-cosmosdb.md +791 -0
  41. camel-azure-eventhubs.md +271 -0
  42. camel-azure-files.md +430 -0
  43. camel-azure-key-vault.md +298 -0
  44. camel-azure-servicebus.md +246 -0
  45. camel-azure-storage-blob.md +806 -0
  46. camel-azure-storage-datalake.md +557 -0
  47. camel-azure-storage-queue.md +424 -0
  48. camel-bean-validator.md +218 -0
  49. camel-bean.md +124 -0
  50. camel-bonita.md +60 -0
camel-activemq.md ADDED
@@ -0,0 +1,276 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Activemq
2
+
3
+ **Since Camel 1.0**
4
+
5
+ **Both producer and consumer are supported**
6
+
7
+ The ActiveMQ component is an extension to the JMS component and has been
8
+ pre-configured for using Apache ActiveMQ 5.x (not Artemis). Users of
9
+ Apache ActiveMQ Artemis should use the JMS component.
10
+
11
+ The camel-activemq component is best intended for ActiveMQ 5.x classic
12
+ brokers. If you use ActiveMQ 6.x brokers, then use the camel-activemq6
13
+ component instead.
14
+
15
+ **More documentation**
16
+
17
+ See the JMS component for more documentation and examples
18
+
19
+ Maven users will need to add the following dependency to their `pom.xml`
20
+ for this component:
21
+
22
+ <dependency>
23
+ <groupId>org.apache.camel</groupId>
24
+ <artifactId>camel-activemq</artifactId>
25
+ <version>x.x.x</version>
26
+ <!-- use the same version as your Camel core version -->
27
+ </dependency>
28
+
29
+ # URI format
30
+
31
+ activemq:[queue:|topic:]destinationName[?options]
32
+
33
+ Where `destinationName` is a JMS queue or topic name. By default, the
34
+ `destinationName` is interpreted as a queue name. For example, to
35
+ connect to the queue, `foo` use:
36
+
37
+ activemq:foo
38
+
39
+ # Examples
40
+
41
+ You’ll need to provide a connectionFactory to the ActiveMQ Component, to
42
+ have the following examples working.
43
+
44
+ ## Producer Example
45
+
46
+ from("timer:mytimer?period=5000")
47
+ .setBody(constant("HELLO from Camel!"))
48
+ .to("activemq:queue:HELLO.WORLD");
49
+
50
+ ## Consumer Example
51
+
52
+ from("activemq:queue:HELLO.WORLD")
53
+ .log("Received a message - ${body}");
54
+
55
+ ## Component Configurations
56
+
57
+
58
+ |Name|Description|Default|Type|
59
+ |---|---|---|---|
60
+ |brokerURL|Sets the broker URL to use to connect to ActiveMQ. If none configured then localhost:61616 is used by default (however can be overridden by configuration from environment variables)||string|
61
+ |clientId|Sets the JMS client ID to use. Note that this value, if specified, must be unique and can only be used by a single JMS connection instance. It is typically only required for durable topic subscriptions with JMS 1.1.||string|
62
+ |connectionFactory|The connection factory to be use. A connection factory must be configured either on the component or endpoint.||object|
63
+ |disableReplyTo|Specifies whether Camel ignores the JMSReplyTo header in messages. If true, Camel does not send a reply back to the destination specified in the JMSReplyTo header. You can use this option if you want Camel to consume from a route and you do not want Camel to automatically send back a reply message because another component in your code handles the reply message. You can also use this option if you want to use Camel as a proxy between different message brokers and you want to route message from one system to another.|false|boolean|
64
+ |durableSubscriptionName|The durable subscriber name for specifying durable topic subscriptions. The clientId option must be configured as well.||string|
65
+ |embedded|Use an embedded in-memory (non-persistent) ActiveMQ broker for development and testing purposes. You must have activemq-broker JAR on the classpath.|false|boolean|
66
+ |jmsMessageType|Allows you to force the use of a specific jakarta.jms.Message implementation for sending JMS messages. Possible values are: Bytes, Map, Object, Stream, Text. By default, Camel would determine which JMS message type to use from the In body type. This option allows you to specify it.||object|
67
+ |replyTo|Provides an explicit ReplyTo destination (overrides any incoming value of Message.getJMSReplyTo() in consumer).||string|
68
+ |testConnectionOnStartup|Specifies whether to test the connection on startup. This ensures that when Camel starts that all the JMS consumers have a valid connection to the JMS broker. If a connection cannot be granted then Camel throws an exception on startup. This ensures that Camel is not started with failed connections. The JMS producers is tested as well.|false|boolean|
69
+ |usePooledConnection|Enables or disables whether a PooledConnectionFactory will be used so that when messages are sent to ActiveMQ from outside a message consuming thread, pooling will be used rather than the default with the Spring JmsTemplate which will create a new connection, session, producer for each message then close them all down again. The default value is true.|true|boolean|
70
+ |useSingleConnection|Enables or disables whether a Spring SingleConnectionFactory will be used so that when messages are sent to ActiveMQ from outside a message consuming thread, pooling will be used rather than the default with the Spring JmsTemplate which will create a new connection, session, producer for each message then close them all down again. The default value is false and a pooled connection is used by default.|false|boolean|
71
+ |acknowledgementModeName|The JMS acknowledgement name, which is one of: SESSION\_TRANSACTED, CLIENT\_ACKNOWLEDGE, AUTO\_ACKNOWLEDGE, DUPS\_OK\_ACKNOWLEDGE|AUTO\_ACKNOWLEDGE|string|
72
+ |artemisConsumerPriority|Consumer priorities allow you to ensure that high priority consumers receive messages while they are active. Normally, active consumers connected to a queue receive messages from it in a round-robin fashion. When consumer priorities are in use, messages are delivered round-robin if multiple active consumers exist with the same high priority. Messages will only going to lower priority consumers when the high priority consumers do not have credit available to consume the message, or those high priority consumers have declined to accept the message (for instance because it does not meet the criteria of any selectors associated with the consumer).||integer|
73
+ |asyncConsumer|Whether the JmsConsumer processes the Exchange asynchronously. If enabled then the JmsConsumer may pickup the next message from the JMS queue, while the previous message is being processed asynchronously (by the Asynchronous Routing Engine). This means that messages may be processed not 100% strictly in order. If disabled (as default) then the Exchange is fully processed before the JmsConsumer will pickup the next message from the JMS queue. Note if transacted has been enabled, then asyncConsumer=true does not run asynchronously, as transaction must be executed synchronously (Camel 3.0 may support async transactions).|false|boolean|
74
+ |autoStartup|Specifies whether the consumer container should auto-startup.|true|boolean|
75
+ |cacheLevel|Sets the cache level by ID for the underlying JMS resources. See cacheLevelName option for more details.||integer|
76
+ |cacheLevelName|Sets the cache level by name for the underlying JMS resources. Possible values are: CACHE\_AUTO, CACHE\_CONNECTION, CACHE\_CONSUMER, CACHE\_NONE, and CACHE\_SESSION. The default setting is CACHE\_AUTO. See the Spring documentation and Transactions Cache Levels for more information.|CACHE\_AUTO|string|
77
+ |concurrentConsumers|Specifies the default number of concurrent consumers when consuming from JMS (not for request/reply over JMS). See also the maxMessagesPerTask option to control dynamic scaling up/down of threads. When doing request/reply over JMS then the option replyToConcurrentConsumers is used to control number of concurrent consumers on the reply message listener.|1|integer|
78
+ |maxConcurrentConsumers|Specifies the maximum number of concurrent consumers when consuming from JMS (not for request/reply over JMS). See also the maxMessagesPerTask option to control dynamic scaling up/down of threads. When doing request/reply over JMS then the option replyToMaxConcurrentConsumers is used to control number of concurrent consumers on the reply message listener.||integer|
79
+ |replyToDeliveryPersistent|Specifies whether to use persistent delivery by default for replies.|true|boolean|
80
+ |selector|Sets the JMS selector to use||string|
81
+ |subscriptionDurable|Set whether to make the subscription durable. The durable subscription name to be used can be specified through the subscriptionName property. Default is false. Set this to true to register a durable subscription, typically in combination with a subscriptionName value (unless your message listener class name is good enough as subscription name). Only makes sense when listening to a topic (pub-sub domain), therefore this method switches the pubSubDomain flag as well.|false|boolean|
82
+ |subscriptionName|Set the name of a subscription to create. To be applied in case of a topic (pub-sub domain) with a shared or durable subscription. The subscription name needs to be unique within this client's JMS client id. Default is the class name of the specified message listener. Note: Only 1 concurrent consumer (which is the default of this message listener container) is allowed for each subscription, except for a shared subscription (which requires JMS 2.0).||string|
83
+ |subscriptionShared|Set whether to make the subscription shared. The shared subscription name to be used can be specified through the subscriptionName property. Default is false. Set this to true to register a shared subscription, typically in combination with a subscriptionName value (unless your message listener class name is good enough as subscription name). Note that shared subscriptions may also be durable, so this flag can (and often will) be combined with subscriptionDurable as well. Only makes sense when listening to a topic (pub-sub domain), therefore this method switches the pubSubDomain flag as well. Requires a JMS 2.0 compatible message broker.|false|boolean|
84
+ |acceptMessagesWhileStopping|Specifies whether the consumer accept messages while it is stopping. You may consider enabling this option, if you start and stop JMS routes at runtime, while there are still messages enqueued on the queue. If this option is false, and you stop the JMS route, then messages may be rejected, and the JMS broker would have to attempt redeliveries, which yet again may be rejected, and eventually the message may be moved at a dead letter queue on the JMS broker. To avoid this its recommended to enable this option.|false|boolean|
85
+ |allowReplyManagerQuickStop|Whether the DefaultMessageListenerContainer used in the reply managers for request-reply messaging allow the DefaultMessageListenerContainer.runningAllowed flag to quick stop in case JmsConfiguration#isAcceptMessagesWhileStopping is enabled, and org.apache.camel.CamelContext is currently being stopped. This quick stop ability is enabled by default in the regular JMS consumers but to enable for reply managers you must enable this flag.|false|boolean|
86
+ |consumerType|The consumer type to use, which can be one of: Simple, Default, or Custom. The consumer type determines which Spring JMS listener to use. Default will use org.springframework.jms.listener.DefaultMessageListenerContainer, Simple will use org.springframework.jms.listener.SimpleMessageListenerContainer. When Custom is specified, the MessageListenerContainerFactory defined by the messageListenerContainerFactory option will determine what org.springframework.jms.listener.AbstractMessageListenerContainer to use.|Default|object|
87
+ |defaultTaskExecutorType|Specifies what default TaskExecutor type to use in the DefaultMessageListenerContainer, for both consumer endpoints and the ReplyTo consumer of producer endpoints. Possible values: SimpleAsync (uses Spring's SimpleAsyncTaskExecutor) or ThreadPool (uses Spring's ThreadPoolTaskExecutor with optimal values - cached thread-pool-like). If not set, it defaults to the previous behaviour, which uses a cached thread pool for consumer endpoints and SimpleAsync for reply consumers. The use of ThreadPool is recommended to reduce thread trash in elastic configurations with dynamically increasing and decreasing concurrent consumers.||object|
88
+ |eagerLoadingOfProperties|Enables eager loading of JMS properties and payload as soon as a message is loaded which generally is inefficient as the JMS properties may not be required but sometimes can catch early any issues with the underlying JMS provider and the use of JMS properties. See also the option eagerPoisonBody.|false|boolean|
89
+ |eagerPoisonBody|If eagerLoadingOfProperties is enabled and the JMS message payload (JMS body or JMS properties) is poison (cannot be read/mapped), then set this text as the message body instead so the message can be processed (the cause of the poison are already stored as exception on the Exchange). This can be turned off by setting eagerPoisonBody=false. See also the option eagerLoadingOfProperties.|Poison JMS message due to ${exception.message}|string|
90
+ |exposeListenerSession|Specifies whether the listener session should be exposed when consuming messages.|false|boolean|
91
+ |replyToConsumerType|The consumer type of the reply consumer (when doing request/reply), which can be one of: Simple, Default, or Custom. The consumer type determines which Spring JMS listener to use. Default will use org.springframework.jms.listener.DefaultMessageListenerContainer, Simple will use org.springframework.jms.listener.SimpleMessageListenerContainer. When Custom is specified, the MessageListenerContainerFactory defined by the messageListenerContainerFactory option will determine what org.springframework.jms.listener.AbstractMessageListenerContainer to use.|Default|object|
92
+ |replyToSameDestinationAllowed|Whether a JMS consumer is allowed to send a reply message to the same destination that the consumer is using to consume from. This prevents an endless loop by consuming and sending back the same message to itself.|false|boolean|
93
+ |taskExecutor|Allows you to specify a custom task executor for consuming messages.||object|
94
+ |deliveryDelay|Sets delivery delay to use for send calls for JMS. This option requires JMS 2.0 compliant broker.|-1|integer|
95
+ |deliveryMode|Specifies the delivery mode to be used. Possible values are those defined by jakarta.jms.DeliveryMode. NON\_PERSISTENT = 1 and PERSISTENT = 2.||integer|
96
+ |deliveryPersistent|Specifies whether persistent delivery is used by default.|true|boolean|
97
+ |explicitQosEnabled|Set if the deliveryMode, priority or timeToLive qualities of service should be used when sending messages. This option is based on Spring's JmsTemplate. The deliveryMode, priority and timeToLive options are applied to the current endpoint. This contrasts with the preserveMessageQos option, which operates at message granularity, reading QoS properties exclusively from the Camel In message headers.|false|boolean|
98
+ |formatDateHeadersToIso8601|Sets whether JMS date properties should be formatted according to the ISO 8601 standard.|false|boolean|
99
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
100
+ |preserveMessageQos|Set to true, if you want to send message using the QoS settings specified on the message, instead of the QoS settings on the JMS endpoint. The following three headers are considered JMSPriority, JMSDeliveryMode, and JMSExpiration. You can provide all or only some of them. If not provided, Camel will fall back to use the values from the endpoint instead. So, when using this option, the headers override the values from the endpoint. The explicitQosEnabled option, by contrast, will only use options set on the endpoint, and not values from the message header.|false|boolean|
101
+ |priority|Values greater than 1 specify the message priority when sending (where 1 is the lowest priority and 9 is the highest). The explicitQosEnabled option must also be enabled in order for this option to have any effect.|4|integer|
102
+ |replyToConcurrentConsumers|Specifies the default number of concurrent consumers when doing request/reply over JMS. See also the maxMessagesPerTask option to control dynamic scaling up/down of threads.|1|integer|
103
+ |replyToMaxConcurrentConsumers|Specifies the maximum number of concurrent consumers when using request/reply over JMS. See also the maxMessagesPerTask option to control dynamic scaling up/down of threads.||integer|
104
+ |replyToOnTimeoutMaxConcurrentConsumers|Specifies the maximum number of concurrent consumers for continue routing when timeout occurred when using request/reply over JMS.|1|integer|
105
+ |replyToOverride|Provides an explicit ReplyTo destination in the JMS message, which overrides the setting of replyTo. It is useful if you want to forward the message to a remote Queue and receive the reply message from the ReplyTo destination.||string|
106
+ |replyToType|Allows for explicitly specifying which kind of strategy to use for replyTo queues when doing request/reply over JMS. Possible values are: Temporary, Shared, or Exclusive. By default Camel will use temporary queues. However if replyTo has been configured, then Shared is used by default. This option allows you to use exclusive queues instead of shared ones. See Camel JMS documentation for more details, and especially the notes about the implications if running in a clustered environment, and the fact that Shared reply queues has lower performance than its alternatives Temporary and Exclusive.||object|
107
+ |requestTimeout|The timeout for waiting for a reply when using the InOut Exchange Pattern (in milliseconds). The default is 20 seconds. You can include the header CamelJmsRequestTimeout to override this endpoint configured timeout value, and thus have per message individual timeout values. See also the requestTimeoutCheckerInterval option.|20000|duration|
108
+ |timeToLive|When sending messages, specifies the time-to-live of the message (in milliseconds).|-1|integer|
109
+ |allowAdditionalHeaders|This option is used to allow additional headers which may have values that are invalid according to JMS specification. For example, some message systems, such as WMQ, do this with header names using prefix JMS\_IBM\_MQMD\_ containing values with byte array or other invalid types. You can specify multiple header names separated by comma, and use as suffix for wildcard matching.||string|
110
+ |allowNullBody|Whether to allow sending messages with no body. If this option is false and the message body is null, then an JMSException is thrown.|true|boolean|
111
+ |alwaysCopyMessage|If true, Camel will always make a JMS message copy of the message when it is passed to the producer for sending. Copying the message is needed in some situations, such as when a replyToDestinationSelectorName is set (incidentally, Camel will set the alwaysCopyMessage option to true, if a replyToDestinationSelectorName is set)|false|boolean|
112
+ |correlationProperty|When using InOut exchange pattern use this JMS property instead of JMSCorrelationID JMS property to correlate messages. If set messages will be correlated solely on the value of this property JMSCorrelationID property will be ignored and not set by Camel.||string|
113
+ |disableTimeToLive|Use this option to force disabling time to live. For example when you do request/reply over JMS, then Camel will by default use the requestTimeout value as time to live on the message being sent. The problem is that the sender and receiver systems have to have their clocks synchronized, so they are in sync. This is not always so easy to archive. So you can use disableTimeToLive=true to not set a time to live value on the sent message. Then the message will not expire on the receiver system. See below in section About time to live for more details.|false|boolean|
114
+ |forceSendOriginalMessage|When using mapJmsMessage=false Camel will create a new JMS message to send to a new JMS destination if you touch the headers (get or set) during the route. Set this option to true to force Camel to send the original JMS message that was received.|false|boolean|
115
+ |includeSentJMSMessageID|Only applicable when sending to JMS destination using InOnly (eg fire and forget). Enabling this option will enrich the Camel Exchange with the actual JMSMessageID that was used by the JMS client when the message was sent to the JMS destination.|false|boolean|
116
+ |replyToCacheLevelName|Sets the cache level by name for the reply consumer when doing request/reply over JMS. This option only applies when using fixed reply queues (not temporary). Camel will by default use: CACHE\_CONSUMER for exclusive or shared w/ replyToSelectorName. And CACHE\_SESSION for shared without replyToSelectorName. Some JMS brokers such as IBM WebSphere may require to set the replyToCacheLevelName=CACHE\_NONE to work. Note: If using temporary queues then CACHE\_NONE is not allowed, and you must use a higher value such as CACHE\_CONSUMER or CACHE\_SESSION.||string|
117
+ |replyToDestinationSelectorName|Sets the JMS Selector using the fixed name to be used so you can filter out your own replies from the others when using a shared queue (that is, if you are not using a temporary reply queue).||string|
118
+ |streamMessageTypeEnabled|Sets whether StreamMessage type is enabled or not. Message payloads of streaming kind such as files, InputStream, etc will either by sent as BytesMessage or StreamMessage. This option controls which kind will be used. By default BytesMessage is used which enforces the entire message payload to be read into memory. By enabling this option the message payload is read into memory in chunks and each chunk is then written to the StreamMessage until no more data.|false|boolean|
119
+ |allowAutoWiredConnectionFactory|Whether to auto-discover ConnectionFactory from the registry, if no connection factory has been configured. If only one instance of ConnectionFactory is found then it will be used. This is enabled by default.|true|boolean|
120
+ |allowAutoWiredDestinationResolver|Whether to auto-discover DestinationResolver from the registry, if no destination resolver has been configured. If only one instance of DestinationResolver is found then it will be used. This is enabled by default.|true|boolean|
121
+ |allowSerializedHeaders|Controls whether or not to include serialized headers. Applies only when transferExchange is true. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level.|false|boolean|
122
+ |artemisStreamingEnabled|Whether optimizing for Apache Artemis streaming mode. This can reduce memory overhead when using Artemis with JMS StreamMessage types. This option must only be enabled if Apache Artemis is being used.|false|boolean|
123
+ |asyncStartListener|Whether to startup the JmsConsumer message listener asynchronously, when starting a route. For example if a JmsConsumer cannot get a connection to a remote JMS broker, then it may block while retrying and/or fail-over. This will cause Camel to block while starting routes. By setting this option to true, you will let routes startup, while the JmsConsumer connects to the JMS broker using a dedicated thread in asynchronous mode. If this option is used, then beware that if the connection could not be established, then an exception is logged at WARN level, and the consumer will not be able to receive messages; You can then restart the route to retry.|false|boolean|
124
+ |asyncStopListener|Whether to stop the JmsConsumer message listener asynchronously, when stopping a route.|false|boolean|
125
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
126
+ |configuration|To use a shared JMS configuration||object|
127
+ |destinationResolver|A pluggable org.springframework.jms.support.destination.DestinationResolver that allows you to use your own resolver (for example, to lookup the real destination in a JNDI registry).||object|
128
+ |errorHandler|Specifies a org.springframework.util.ErrorHandler to be invoked in case of any uncaught exceptions thrown while processing a Message. By default these exceptions will be logged at the WARN level, if no errorHandler has been configured. You can configure logging level and whether stack traces should be logged using errorHandlerLoggingLevel and errorHandlerLogStackTrace options. This makes it much easier to configure, than having to code a custom errorHandler.||object|
129
+ |exceptionListener|Specifies the JMS Exception Listener that is to be notified of any underlying JMS exceptions.||object|
130
+ |idleConsumerLimit|Specify the limit for the number of consumers that are allowed to be idle at any given time.|1|integer|
131
+ |idleTaskExecutionLimit|Specifies the limit for idle executions of a receive task, not having received any message within its execution. If this limit is reached, the task will shut down and leave receiving to other executing tasks (in the case of dynamic scheduling; see the maxConcurrentConsumers setting). There is additional doc available from Spring.|1|integer|
132
+ |includeAllJMSXProperties|Whether to include all JMSX prefixed properties when mapping from JMS to Camel Message. Setting this to true will include properties such as JMSXAppID, and JMSXUserID etc. Note: If you are using a custom headerFilterStrategy then this option does not apply.|false|boolean|
133
+ |includeCorrelationIDAsBytes|Whether the JMS consumer should include JMSCorrelationIDAsBytes as a header on the Camel Message.|true|boolean|
134
+ |jmsKeyFormatStrategy|Pluggable strategy for encoding and decoding JMS keys so they can be compliant with the JMS specification. Camel provides two implementations out of the box: default and passthrough. The default strategy will safely marshal dots and hyphens (. and -). The passthrough strategy leaves the key as is. Can be used for JMS brokers which do not care whether JMS header keys contain illegal characters. You can provide your own implementation of the org.apache.camel.component.jms.JmsKeyFormatStrategy and refer to it using the # notation.||object|
135
+ |mapJmsMessage|Specifies whether Camel should auto map the received JMS message to a suited payload type, such as jakarta.jms.TextMessage to a String etc.|true|boolean|
136
+ |maxMessagesPerTask|The number of messages per task. -1 is unlimited. If you use a range for concurrent consumers (eg min max), then this option can be used to set a value to eg 100 to control how fast the consumers will shrink when less work is required.|-1|integer|
137
+ |messageConverter|To use a custom Spring org.springframework.jms.support.converter.MessageConverter so you can be in control how to map to/from a jakarta.jms.Message.||object|
138
+ |messageCreatedStrategy|To use the given MessageCreatedStrategy which are invoked when Camel creates new instances of jakarta.jms.Message objects when Camel is sending a JMS message.||object|
139
+ |messageIdEnabled|When sending, specifies whether message IDs should be added. This is just an hint to the JMS broker. If the JMS provider accepts this hint, these messages must have the message ID set to null; if the provider ignores the hint, the message ID must be set to its normal unique value.|true|boolean|
140
+ |messageListenerContainerFactory|Registry ID of the MessageListenerContainerFactory used to determine what org.springframework.jms.listener.AbstractMessageListenerContainer to use to consume messages. Setting this will automatically set consumerType to Custom.||object|
141
+ |messageTimestampEnabled|Specifies whether timestamps should be enabled by default on sending messages. This is just an hint to the JMS broker. If the JMS provider accepts this hint, these messages must have the timestamp set to zero; if the provider ignores the hint the timestamp must be set to its normal value.|true|boolean|
142
+ |pubSubNoLocal|Specifies whether to inhibit the delivery of messages published by its own connection.|false|boolean|
143
+ |queueBrowseStrategy|To use a custom QueueBrowseStrategy when browsing queues||object|
144
+ |receiveTimeout|The timeout for receiving messages (in milliseconds).|1000|duration|
145
+ |recoveryInterval|Specifies the interval between recovery attempts, i.e. when a connection is being refreshed, in milliseconds. The default is 5000 ms, that is, 5 seconds.|5000|duration|
146
+ |requestTimeoutCheckerInterval|Configures how often Camel should check for timed out Exchanges when doing request/reply over JMS. By default Camel checks once per second. But if you must react faster when a timeout occurs, then you can lower this interval, to check more frequently. The timeout is determined by the option requestTimeout.|1000|duration|
147
+ |serviceLocationEnabled|Whether to detect the network address location of the JMS broker on startup. This information is gathered via reflection on the ConnectionFactory, and is vendor specific. This option can be used to turn this off.|true|boolean|
148
+ |synchronous|Sets whether synchronous processing should be strictly used|false|boolean|
149
+ |temporaryQueueResolver|A pluggable TemporaryQueueResolver that allows you to use your own resolver for creating temporary queues (some messaging systems has special requirements for creating temporary queues).||object|
150
+ |transferException|If enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the consumer side, then the caused Exception will be send back in response as a jakarta.jms.ObjectMessage. If the client is Camel, the returned Exception is rethrown. This allows you to use Camel JMS as a bridge in your routing - for example, using persistent queues to enable robust routing. Notice that if you also have transferExchange enabled, this option takes precedence. The caught exception is required to be serializable. The original Exception on the consumer side can be wrapped in an outer exception such as org.apache.camel.RuntimeCamelException when returned to the producer. Use this with caution as the data is using Java Object serialization and requires the received to be able to deserialize the data at Class level, which forces a strong coupling between the producers and consumer!|false|boolean|
151
+ |transferExchange|You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an Exchange and not a regular payload. Use this with caution as the data is using Java Object serialization and requires the receiver to be able to deserialize the data at Class level, which forces a strong coupling between the producers and consumers having to use compatible Camel versions!|false|boolean|
152
+ |trustAllPackages|Define if all Java packages are trusted or not (for Java object JMS message types). Notice its not recommended practice to send Java serialized objects over network. Setting this to true can expose security risks, so use this with care.|false|boolean|
153
+ |useMessageIDAsCorrelationID|Specifies whether JMSMessageID should always be used as JMSCorrelationID for InOut messages.|false|boolean|
154
+ |waitForProvisionCorrelationToBeUpdatedCounter|Number of times to wait for provisional correlation id to be updated to the actual correlation id when doing request/reply over JMS and when the option useMessageIDAsCorrelationID is enabled.|50|integer|
155
+ |waitForProvisionCorrelationToBeUpdatedThreadSleepingTime|Interval in millis to sleep each time while waiting for provisional correlation id to be updated.|100|duration|
156
+ |waitForTemporaryReplyToToBeUpdatedCounter|Number of times to wait for temporary replyTo queue to be created and ready when doing request/reply over JMS.|200|integer|
157
+ |waitForTemporaryReplyToToBeUpdatedThreadSleepingTime|Interval in millis to sleep each time while waiting for temporary replyTo queue to be ready.|100|duration|
158
+ |headerFilterStrategy|To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message.||object|
159
+ |errorHandlerLoggingLevel|Allows to configure the default errorHandler logging level for logging uncaught exceptions.|WARN|object|
160
+ |errorHandlerLogStackTrace|Allows to control whether stack-traces should be logged or not, by the default errorHandler.|true|boolean|
161
+ |password|Password to use with the ConnectionFactory. You can also configure username/password directly on the ConnectionFactory.||string|
162
+ |username|Username to use with the ConnectionFactory. You can also configure username/password directly on the ConnectionFactory.||string|
163
+ |transacted|Specifies whether to use transacted mode|false|boolean|
164
+ |transactedInOut|Specifies whether InOut operations (request reply) default to using transacted mode If this flag is set to true, then Spring JmsTemplate will have sessionTransacted set to true, and the acknowledgeMode as transacted on the JmsTemplate used for InOut operations. Note from Spring JMS: that within a JTA transaction, the parameters passed to createQueue, createTopic methods are not taken into account. Depending on the Java EE transaction context, the container makes its own decisions on these values. Analogously, these parameters are not taken into account within a locally managed transaction either, since Spring JMS operates on an existing JMS Session in this case. Setting this flag to true will use a short local JMS transaction when running outside of a managed transaction, and a synchronized local JMS transaction in case of a managed transaction (other than an XA transaction) being present. This has the effect of a local JMS transaction being managed alongside the main transaction (which might be a native JDBC transaction), with the JMS transaction committing right after the main transaction.|false|boolean|
165
+ |lazyCreateTransactionManager|If true, Camel will create a JmsTransactionManager, if there is no transactionManager injected when option transacted=true.|true|boolean|
166
+ |transactionManager|The Spring transaction manager to use.||object|
167
+ |transactionName|The name of the transaction to use.||string|
168
+ |transactionTimeout|The timeout value of the transaction (in seconds), if using transacted mode.|-1|integer|
169
+
170
+ ## Endpoint Configurations
171
+
172
+
173
+ |Name|Description|Default|Type|
174
+ |---|---|---|---|
175
+ |destinationType|The kind of destination to use|queue|string|
176
+ |destinationName|Name of the queue or topic to use as destination||string|
177
+ |clientId|Sets the JMS client ID to use. Note that this value, if specified, must be unique and can only be used by a single JMS connection instance. It is typically only required for durable topic subscriptions with JMS 1.1.||string|
178
+ |connectionFactory|The connection factory to be use. A connection factory must be configured either on the component or endpoint.||object|
179
+ |disableReplyTo|Specifies whether Camel ignores the JMSReplyTo header in messages. If true, Camel does not send a reply back to the destination specified in the JMSReplyTo header. You can use this option if you want Camel to consume from a route and you do not want Camel to automatically send back a reply message because another component in your code handles the reply message. You can also use this option if you want to use Camel as a proxy between different message brokers and you want to route message from one system to another.|false|boolean|
180
+ |durableSubscriptionName|The durable subscriber name for specifying durable topic subscriptions. The clientId option must be configured as well.||string|
181
+ |jmsMessageType|Allows you to force the use of a specific jakarta.jms.Message implementation for sending JMS messages. Possible values are: Bytes, Map, Object, Stream, Text. By default, Camel would determine which JMS message type to use from the In body type. This option allows you to specify it.||object|
182
+ |replyTo|Provides an explicit ReplyTo destination (overrides any incoming value of Message.getJMSReplyTo() in consumer).||string|
183
+ |testConnectionOnStartup|Specifies whether to test the connection on startup. This ensures that when Camel starts that all the JMS consumers have a valid connection to the JMS broker. If a connection cannot be granted then Camel throws an exception on startup. This ensures that Camel is not started with failed connections. The JMS producers is tested as well.|false|boolean|
184
+ |acknowledgementModeName|The JMS acknowledgement name, which is one of: SESSION\_TRANSACTED, CLIENT\_ACKNOWLEDGE, AUTO\_ACKNOWLEDGE, DUPS\_OK\_ACKNOWLEDGE|AUTO\_ACKNOWLEDGE|string|
185
+ |artemisConsumerPriority|Consumer priorities allow you to ensure that high priority consumers receive messages while they are active. Normally, active consumers connected to a queue receive messages from it in a round-robin fashion. When consumer priorities are in use, messages are delivered round-robin if multiple active consumers exist with the same high priority. Messages will only going to lower priority consumers when the high priority consumers do not have credit available to consume the message, or those high priority consumers have declined to accept the message (for instance because it does not meet the criteria of any selectors associated with the consumer).||integer|
186
+ |asyncConsumer|Whether the JmsConsumer processes the Exchange asynchronously. If enabled then the JmsConsumer may pickup the next message from the JMS queue, while the previous message is being processed asynchronously (by the Asynchronous Routing Engine). This means that messages may be processed not 100% strictly in order. If disabled (as default) then the Exchange is fully processed before the JmsConsumer will pickup the next message from the JMS queue. Note if transacted has been enabled, then asyncConsumer=true does not run asynchronously, as transaction must be executed synchronously (Camel 3.0 may support async transactions).|false|boolean|
187
+ |autoStartup|Specifies whether the consumer container should auto-startup.|true|boolean|
188
+ |cacheLevel|Sets the cache level by ID for the underlying JMS resources. See cacheLevelName option for more details.||integer|
189
+ |cacheLevelName|Sets the cache level by name for the underlying JMS resources. Possible values are: CACHE\_AUTO, CACHE\_CONNECTION, CACHE\_CONSUMER, CACHE\_NONE, and CACHE\_SESSION. The default setting is CACHE\_AUTO. See the Spring documentation and Transactions Cache Levels for more information.|CACHE\_AUTO|string|
190
+ |concurrentConsumers|Specifies the default number of concurrent consumers when consuming from JMS (not for request/reply over JMS). See also the maxMessagesPerTask option to control dynamic scaling up/down of threads. When doing request/reply over JMS then the option replyToConcurrentConsumers is used to control number of concurrent consumers on the reply message listener.|1|integer|
191
+ |maxConcurrentConsumers|Specifies the maximum number of concurrent consumers when consuming from JMS (not for request/reply over JMS). See also the maxMessagesPerTask option to control dynamic scaling up/down of threads. When doing request/reply over JMS then the option replyToMaxConcurrentConsumers is used to control number of concurrent consumers on the reply message listener.||integer|
192
+ |replyToDeliveryPersistent|Specifies whether to use persistent delivery by default for replies.|true|boolean|
193
+ |selector|Sets the JMS selector to use||string|
194
+ |subscriptionDurable|Set whether to make the subscription durable. The durable subscription name to be used can be specified through the subscriptionName property. Default is false. Set this to true to register a durable subscription, typically in combination with a subscriptionName value (unless your message listener class name is good enough as subscription name). Only makes sense when listening to a topic (pub-sub domain), therefore this method switches the pubSubDomain flag as well.|false|boolean|
195
+ |subscriptionName|Set the name of a subscription to create. To be applied in case of a topic (pub-sub domain) with a shared or durable subscription. The subscription name needs to be unique within this client's JMS client id. Default is the class name of the specified message listener. Note: Only 1 concurrent consumer (which is the default of this message listener container) is allowed for each subscription, except for a shared subscription (which requires JMS 2.0).||string|
196
+ |subscriptionShared|Set whether to make the subscription shared. The shared subscription name to be used can be specified through the subscriptionName property. Default is false. Set this to true to register a shared subscription, typically in combination with a subscriptionName value (unless your message listener class name is good enough as subscription name). Note that shared subscriptions may also be durable, so this flag can (and often will) be combined with subscriptionDurable as well. Only makes sense when listening to a topic (pub-sub domain), therefore this method switches the pubSubDomain flag as well. Requires a JMS 2.0 compatible message broker.|false|boolean|
197
+ |acceptMessagesWhileStopping|Specifies whether the consumer accept messages while it is stopping. You may consider enabling this option, if you start and stop JMS routes at runtime, while there are still messages enqueued on the queue. If this option is false, and you stop the JMS route, then messages may be rejected, and the JMS broker would have to attempt redeliveries, which yet again may be rejected, and eventually the message may be moved at a dead letter queue on the JMS broker. To avoid this its recommended to enable this option.|false|boolean|
198
+ |allowReplyManagerQuickStop|Whether the DefaultMessageListenerContainer used in the reply managers for request-reply messaging allow the DefaultMessageListenerContainer.runningAllowed flag to quick stop in case JmsConfiguration#isAcceptMessagesWhileStopping is enabled, and org.apache.camel.CamelContext is currently being stopped. This quick stop ability is enabled by default in the regular JMS consumers but to enable for reply managers you must enable this flag.|false|boolean|
199
+ |consumerType|The consumer type to use, which can be one of: Simple, Default, or Custom. The consumer type determines which Spring JMS listener to use. Default will use org.springframework.jms.listener.DefaultMessageListenerContainer, Simple will use org.springframework.jms.listener.SimpleMessageListenerContainer. When Custom is specified, the MessageListenerContainerFactory defined by the messageListenerContainerFactory option will determine what org.springframework.jms.listener.AbstractMessageListenerContainer to use.|Default|object|
200
+ |defaultTaskExecutorType|Specifies what default TaskExecutor type to use in the DefaultMessageListenerContainer, for both consumer endpoints and the ReplyTo consumer of producer endpoints. Possible values: SimpleAsync (uses Spring's SimpleAsyncTaskExecutor) or ThreadPool (uses Spring's ThreadPoolTaskExecutor with optimal values - cached thread-pool-like). If not set, it defaults to the previous behaviour, which uses a cached thread pool for consumer endpoints and SimpleAsync for reply consumers. The use of ThreadPool is recommended to reduce thread trash in elastic configurations with dynamically increasing and decreasing concurrent consumers.||object|
201
+ |destinationOptions|Destination Options are a way to provide extended configuration options to a JMS consumer without having to extend the JMS API. The options are encoded using URL query syntax in the destination name that the consumer is created on. See more details at https://activemq.apache.org/destination-options.||object|
202
+ |eagerLoadingOfProperties|Enables eager loading of JMS properties and payload as soon as a message is loaded which generally is inefficient as the JMS properties may not be required but sometimes can catch early any issues with the underlying JMS provider and the use of JMS properties. See also the option eagerPoisonBody.|false|boolean|
203
+ |eagerPoisonBody|If eagerLoadingOfProperties is enabled and the JMS message payload (JMS body or JMS properties) is poison (cannot be read/mapped), then set this text as the message body instead so the message can be processed (the cause of the poison are already stored as exception on the Exchange). This can be turned off by setting eagerPoisonBody=false. See also the option eagerLoadingOfProperties.|Poison JMS message due to ${exception.message}|string|
204
+ |exceptionHandler|To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.||object|
205
+ |exchangePattern|Sets the exchange pattern when the consumer creates an exchange.||object|
206
+ |exposeListenerSession|Specifies whether the listener session should be exposed when consuming messages.|false|boolean|
207
+ |replyToConsumerType|The consumer type of the reply consumer (when doing request/reply), which can be one of: Simple, Default, or Custom. The consumer type determines which Spring JMS listener to use. Default will use org.springframework.jms.listener.DefaultMessageListenerContainer, Simple will use org.springframework.jms.listener.SimpleMessageListenerContainer. When Custom is specified, the MessageListenerContainerFactory defined by the messageListenerContainerFactory option will determine what org.springframework.jms.listener.AbstractMessageListenerContainer to use.|Default|object|
208
+ |replyToSameDestinationAllowed|Whether a JMS consumer is allowed to send a reply message to the same destination that the consumer is using to consume from. This prevents an endless loop by consuming and sending back the same message to itself.|false|boolean|
209
+ |taskExecutor|Allows you to specify a custom task executor for consuming messages.||object|
210
+ |deliveryDelay|Sets delivery delay to use for send calls for JMS. This option requires JMS 2.0 compliant broker.|-1|integer|
211
+ |deliveryMode|Specifies the delivery mode to be used. Possible values are those defined by jakarta.jms.DeliveryMode. NON\_PERSISTENT = 1 and PERSISTENT = 2.||integer|
212
+ |deliveryPersistent|Specifies whether persistent delivery is used by default.|true|boolean|
213
+ |explicitQosEnabled|Set if the deliveryMode, priority or timeToLive qualities of service should be used when sending messages. This option is based on Spring's JmsTemplate. The deliveryMode, priority and timeToLive options are applied to the current endpoint. This contrasts with the preserveMessageQos option, which operates at message granularity, reading QoS properties exclusively from the Camel In message headers.|false|boolean|
214
+ |formatDateHeadersToIso8601|Sets whether JMS date properties should be formatted according to the ISO 8601 standard.|false|boolean|
215
+ |preserveMessageQos|Set to true, if you want to send message using the QoS settings specified on the message, instead of the QoS settings on the JMS endpoint. The following three headers are considered JMSPriority, JMSDeliveryMode, and JMSExpiration. You can provide all or only some of them. If not provided, Camel will fall back to use the values from the endpoint instead. So, when using this option, the headers override the values from the endpoint. The explicitQosEnabled option, by contrast, will only use options set on the endpoint, and not values from the message header.|false|boolean|
216
+ |priority|Values greater than 1 specify the message priority when sending (where 1 is the lowest priority and 9 is the highest). The explicitQosEnabled option must also be enabled in order for this option to have any effect.|4|integer|
217
+ |replyToConcurrentConsumers|Specifies the default number of concurrent consumers when doing request/reply over JMS. See also the maxMessagesPerTask option to control dynamic scaling up/down of threads.|1|integer|
218
+ |replyToMaxConcurrentConsumers|Specifies the maximum number of concurrent consumers when using request/reply over JMS. See also the maxMessagesPerTask option to control dynamic scaling up/down of threads.||integer|
219
+ |replyToOnTimeoutMaxConcurrentConsumers|Specifies the maximum number of concurrent consumers for continue routing when timeout occurred when using request/reply over JMS.|1|integer|
220
+ |replyToOverride|Provides an explicit ReplyTo destination in the JMS message, which overrides the setting of replyTo. It is useful if you want to forward the message to a remote Queue and receive the reply message from the ReplyTo destination.||string|
221
+ |replyToType|Allows for explicitly specifying which kind of strategy to use for replyTo queues when doing request/reply over JMS. Possible values are: Temporary, Shared, or Exclusive. By default Camel will use temporary queues. However if replyTo has been configured, then Shared is used by default. This option allows you to use exclusive queues instead of shared ones. See Camel JMS documentation for more details, and especially the notes about the implications if running in a clustered environment, and the fact that Shared reply queues has lower performance than its alternatives Temporary and Exclusive.||object|
222
+ |requestTimeout|The timeout for waiting for a reply when using the InOut Exchange Pattern (in milliseconds). The default is 20 seconds. You can include the header CamelJmsRequestTimeout to override this endpoint configured timeout value, and thus have per message individual timeout values. See also the requestTimeoutCheckerInterval option.|20000|duration|
223
+ |timeToLive|When sending messages, specifies the time-to-live of the message (in milliseconds).|-1|integer|
224
+ |allowAdditionalHeaders|This option is used to allow additional headers which may have values that are invalid according to JMS specification. For example, some message systems, such as WMQ, do this with header names using prefix JMS\_IBM\_MQMD\_ containing values with byte array or other invalid types. You can specify multiple header names separated by comma, and use as suffix for wildcard matching.||string|
225
+ |allowNullBody|Whether to allow sending messages with no body. If this option is false and the message body is null, then an JMSException is thrown.|true|boolean|
226
+ |alwaysCopyMessage|If true, Camel will always make a JMS message copy of the message when it is passed to the producer for sending. Copying the message is needed in some situations, such as when a replyToDestinationSelectorName is set (incidentally, Camel will set the alwaysCopyMessage option to true, if a replyToDestinationSelectorName is set)|false|boolean|
227
+ |correlationProperty|When using InOut exchange pattern use this JMS property instead of JMSCorrelationID JMS property to correlate messages. If set messages will be correlated solely on the value of this property JMSCorrelationID property will be ignored and not set by Camel.||string|
228
+ |disableTimeToLive|Use this option to force disabling time to live. For example when you do request/reply over JMS, then Camel will by default use the requestTimeout value as time to live on the message being sent. The problem is that the sender and receiver systems have to have their clocks synchronized, so they are in sync. This is not always so easy to archive. So you can use disableTimeToLive=true to not set a time to live value on the sent message. Then the message will not expire on the receiver system. See below in section About time to live for more details.|false|boolean|
229
+ |forceSendOriginalMessage|When using mapJmsMessage=false Camel will create a new JMS message to send to a new JMS destination if you touch the headers (get or set) during the route. Set this option to true to force Camel to send the original JMS message that was received.|false|boolean|
230
+ |includeSentJMSMessageID|Only applicable when sending to JMS destination using InOnly (eg fire and forget). Enabling this option will enrich the Camel Exchange with the actual JMSMessageID that was used by the JMS client when the message was sent to the JMS destination.|false|boolean|
231
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
232
+ |replyToCacheLevelName|Sets the cache level by name for the reply consumer when doing request/reply over JMS. This option only applies when using fixed reply queues (not temporary). Camel will by default use: CACHE\_CONSUMER for exclusive or shared w/ replyToSelectorName. And CACHE\_SESSION for shared without replyToSelectorName. Some JMS brokers such as IBM WebSphere may require to set the replyToCacheLevelName=CACHE\_NONE to work. Note: If using temporary queues then CACHE\_NONE is not allowed, and you must use a higher value such as CACHE\_CONSUMER or CACHE\_SESSION.||string|
233
+ |replyToDestinationSelectorName|Sets the JMS Selector using the fixed name to be used so you can filter out your own replies from the others when using a shared queue (that is, if you are not using a temporary reply queue).||string|
234
+ |streamMessageTypeEnabled|Sets whether StreamMessage type is enabled or not. Message payloads of streaming kind such as files, InputStream, etc will either by sent as BytesMessage or StreamMessage. This option controls which kind will be used. By default BytesMessage is used which enforces the entire message payload to be read into memory. By enabling this option the message payload is read into memory in chunks and each chunk is then written to the StreamMessage until no more data.|false|boolean|
235
+ |allowSerializedHeaders|Controls whether or not to include serialized headers. Applies only when transferExchange is true. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level.|false|boolean|
236
+ |artemisStreamingEnabled|Whether optimizing for Apache Artemis streaming mode. This can reduce memory overhead when using Artemis with JMS StreamMessage types. This option must only be enabled if Apache Artemis is being used.|false|boolean|
237
+ |asyncStartListener|Whether to startup the JmsConsumer message listener asynchronously, when starting a route. For example if a JmsConsumer cannot get a connection to a remote JMS broker, then it may block while retrying and/or fail-over. This will cause Camel to block while starting routes. By setting this option to true, you will let routes startup, while the JmsConsumer connects to the JMS broker using a dedicated thread in asynchronous mode. If this option is used, then beware that if the connection could not be established, then an exception is logged at WARN level, and the consumer will not be able to receive messages; You can then restart the route to retry.|false|boolean|
238
+ |asyncStopListener|Whether to stop the JmsConsumer message listener asynchronously, when stopping a route.|false|boolean|
239
+ |destinationResolver|A pluggable org.springframework.jms.support.destination.DestinationResolver that allows you to use your own resolver (for example, to lookup the real destination in a JNDI registry).||object|
240
+ |errorHandler|Specifies a org.springframework.util.ErrorHandler to be invoked in case of any uncaught exceptions thrown while processing a Message. By default these exceptions will be logged at the WARN level, if no errorHandler has been configured. You can configure logging level and whether stack traces should be logged using errorHandlerLoggingLevel and errorHandlerLogStackTrace options. This makes it much easier to configure, than having to code a custom errorHandler.||object|
241
+ |exceptionListener|Specifies the JMS Exception Listener that is to be notified of any underlying JMS exceptions.||object|
242
+ |headerFilterStrategy|To use a custom HeaderFilterStrategy to filter header to and from Camel message.||object|
243
+ |idleConsumerLimit|Specify the limit for the number of consumers that are allowed to be idle at any given time.|1|integer|
244
+ |idleTaskExecutionLimit|Specifies the limit for idle executions of a receive task, not having received any message within its execution. If this limit is reached, the task will shut down and leave receiving to other executing tasks (in the case of dynamic scheduling; see the maxConcurrentConsumers setting). There is additional doc available from Spring.|1|integer|
245
+ |includeAllJMSXProperties|Whether to include all JMSX prefixed properties when mapping from JMS to Camel Message. Setting this to true will include properties such as JMSXAppID, and JMSXUserID etc. Note: If you are using a custom headerFilterStrategy then this option does not apply.|false|boolean|
246
+ |jmsKeyFormatStrategy|Pluggable strategy for encoding and decoding JMS keys so they can be compliant with the JMS specification. Camel provides two implementations out of the box: default and passthrough. The default strategy will safely marshal dots and hyphens (. and -). The passthrough strategy leaves the key as is. Can be used for JMS brokers which do not care whether JMS header keys contain illegal characters. You can provide your own implementation of the org.apache.camel.component.jms.JmsKeyFormatStrategy and refer to it using the # notation.||object|
247
+ |mapJmsMessage|Specifies whether Camel should auto map the received JMS message to a suited payload type, such as jakarta.jms.TextMessage to a String etc.|true|boolean|
248
+ |maxMessagesPerTask|The number of messages per task. -1 is unlimited. If you use a range for concurrent consumers (eg min max), then this option can be used to set a value to eg 100 to control how fast the consumers will shrink when less work is required.|-1|integer|
249
+ |messageConverter|To use a custom Spring org.springframework.jms.support.converter.MessageConverter so you can be in control how to map to/from a jakarta.jms.Message.||object|
250
+ |messageCreatedStrategy|To use the given MessageCreatedStrategy which are invoked when Camel creates new instances of jakarta.jms.Message objects when Camel is sending a JMS message.||object|
251
+ |messageIdEnabled|When sending, specifies whether message IDs should be added. This is just an hint to the JMS broker. If the JMS provider accepts this hint, these messages must have the message ID set to null; if the provider ignores the hint, the message ID must be set to its normal unique value.|true|boolean|
252
+ |messageListenerContainerFactory|Registry ID of the MessageListenerContainerFactory used to determine what org.springframework.jms.listener.AbstractMessageListenerContainer to use to consume messages. Setting this will automatically set consumerType to Custom.||object|
253
+ |messageTimestampEnabled|Specifies whether timestamps should be enabled by default on sending messages. This is just an hint to the JMS broker. If the JMS provider accepts this hint, these messages must have the timestamp set to zero; if the provider ignores the hint the timestamp must be set to its normal value.|true|boolean|
254
+ |pubSubNoLocal|Specifies whether to inhibit the delivery of messages published by its own connection.|false|boolean|
255
+ |receiveTimeout|The timeout for receiving messages (in milliseconds).|1000|duration|
256
+ |recoveryInterval|Specifies the interval between recovery attempts, i.e. when a connection is being refreshed, in milliseconds. The default is 5000 ms, that is, 5 seconds.|5000|duration|
257
+ |requestTimeoutCheckerInterval|Configures how often Camel should check for timed out Exchanges when doing request/reply over JMS. By default Camel checks once per second. But if you must react faster when a timeout occurs, then you can lower this interval, to check more frequently. The timeout is determined by the option requestTimeout.|1000|duration|
258
+ |synchronous|Sets whether synchronous processing should be strictly used|false|boolean|
259
+ |temporaryQueueResolver|A pluggable TemporaryQueueResolver that allows you to use your own resolver for creating temporary queues (some messaging systems has special requirements for creating temporary queues).||object|
260
+ |transferException|If enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the consumer side, then the caused Exception will be send back in response as a jakarta.jms.ObjectMessage. If the client is Camel, the returned Exception is rethrown. This allows you to use Camel JMS as a bridge in your routing - for example, using persistent queues to enable robust routing. Notice that if you also have transferExchange enabled, this option takes precedence. The caught exception is required to be serializable. The original Exception on the consumer side can be wrapped in an outer exception such as org.apache.camel.RuntimeCamelException when returned to the producer. Use this with caution as the data is using Java Object serialization and requires the received to be able to deserialize the data at Class level, which forces a strong coupling between the producers and consumer!|false|boolean|
261
+ |transferExchange|You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an Exchange and not a regular payload. Use this with caution as the data is using Java Object serialization and requires the receiver to be able to deserialize the data at Class level, which forces a strong coupling between the producers and consumers having to use compatible Camel versions!|false|boolean|
262
+ |useMessageIDAsCorrelationID|Specifies whether JMSMessageID should always be used as JMSCorrelationID for InOut messages.|false|boolean|
263
+ |waitForProvisionCorrelationToBeUpdatedCounter|Number of times to wait for provisional correlation id to be updated to the actual correlation id when doing request/reply over JMS and when the option useMessageIDAsCorrelationID is enabled.|50|integer|
264
+ |waitForProvisionCorrelationToBeUpdatedThreadSleepingTime|Interval in millis to sleep each time while waiting for provisional correlation id to be updated.|100|duration|
265
+ |waitForTemporaryReplyToToBeUpdatedCounter|Number of times to wait for temporary replyTo queue to be created and ready when doing request/reply over JMS.|200|integer|
266
+ |waitForTemporaryReplyToToBeUpdatedThreadSleepingTime|Interval in millis to sleep each time while waiting for temporary replyTo queue to be ready.|100|duration|
267
+ |errorHandlerLoggingLevel|Allows to configure the default errorHandler logging level for logging uncaught exceptions.|WARN|object|
268
+ |errorHandlerLogStackTrace|Allows to control whether stack-traces should be logged or not, by the default errorHandler.|true|boolean|
269
+ |password|Password to use with the ConnectionFactory. You can also configure username/password directly on the ConnectionFactory.||string|
270
+ |username|Username to use with the ConnectionFactory. You can also configure username/password directly on the ConnectionFactory.||string|
271
+ |transacted|Specifies whether to use transacted mode|false|boolean|
272
+ |transactedInOut|Specifies whether InOut operations (request reply) default to using transacted mode If this flag is set to true, then Spring JmsTemplate will have sessionTransacted set to true, and the acknowledgeMode as transacted on the JmsTemplate used for InOut operations. Note from Spring JMS: that within a JTA transaction, the parameters passed to createQueue, createTopic methods are not taken into account. Depending on the Java EE transaction context, the container makes its own decisions on these values. Analogously, these parameters are not taken into account within a locally managed transaction either, since Spring JMS operates on an existing JMS Session in this case. Setting this flag to true will use a short local JMS transaction when running outside of a managed transaction, and a synchronized local JMS transaction in case of a managed transaction (other than an XA transaction) being present. This has the effect of a local JMS transaction being managed alongside the main transaction (which might be a native JDBC transaction), with the JMS transaction committing right after the main transaction.|false|boolean|
273
+ |lazyCreateTransactionManager|If true, Camel will create a JmsTransactionManager, if there is no transactionManager injected when option transacted=true.|true|boolean|
274
+ |transactionManager|The Spring transaction manager to use.||object|
275
+ |transactionName|The name of the transaction to use.||string|
276
+ |transactionTimeout|The timeout value of the transaction (in seconds), if using transacted mode.|-1|integer|
camel-activemq6.md ADDED
@@ -0,0 +1,276 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Activemq6
2
+
3
+ **Since Camel 4.7**
4
+
5
+ **Both producer and consumer are supported**
6
+
7
+ The ActiveMQ component is an extension to the JMS component and has been
8
+ pre-configured for using Apache ActiveMQ 6.x (not Artemis). Users of
9
+ Apache ActiveMQ Artemis should use the JMS component.
10
+
11
+ The camel-activemq component is best intended for ActiveMQ 6.x brokers.
12
+ If you use ActiveMQ 5.x brokers, then use the camel-activemq 5.x
13
+ component instead.
14
+
15
+ **More documentation**
16
+
17
+ See the JMS component for more documentation and examples
18
+
19
+ Maven users will need to add the following dependency to their `pom.xml`
20
+ for this component:
21
+
22
+ <dependency>
23
+ <groupId>org.apache.camel</groupId>
24
+ <artifactId>camel-activemq</artifactId>
25
+ <version>x.x.x</version>
26
+ <!-- use the same version as your Camel core version -->
27
+ </dependency>
28
+
29
+ # URI format
30
+
31
+ activemq:[queue:|topic:]destinationName[?options]
32
+
33
+ Where `destinationName` is a JMS queue or topic name. By default, the
34
+ `destinationName` is interpreted as a queue name. For example, to
35
+ connect to the queue, `foo` use:
36
+
37
+ activemq:foo
38
+
39
+ # Examples
40
+
41
+ You’ll need to provide a connectionFactory to the ActiveMQ Component, to
42
+ have the following examples working.
43
+
44
+ ## Producer Example
45
+
46
+ from("timer:mytimer?period=5000")
47
+ .setBody(constant("HELLO from Camel!"))
48
+ .to("activemq:queue:HELLO.WORLD");
49
+
50
+ ## Consumer Example
51
+
52
+ from("activemq:queue:HELLO.WORLD")
53
+ .log("Received a message - ${body}");
54
+
55
+ ## Component Configurations
56
+
57
+
58
+ |Name|Description|Default|Type|
59
+ |---|---|---|---|
60
+ |brokerURL|Sets the broker URL to use to connect to ActiveMQ. If none configured then localhost:61616 is used by default (however can be overridden by configuration from environment variables)||string|
61
+ |clientId|Sets the JMS client ID to use. Note that this value, if specified, must be unique and can only be used by a single JMS connection instance. It is typically only required for durable topic subscriptions with JMS 1.1.||string|
62
+ |connectionFactory|The connection factory to be use. A connection factory must be configured either on the component or endpoint.||object|
63
+ |disableReplyTo|Specifies whether Camel ignores the JMSReplyTo header in messages. If true, Camel does not send a reply back to the destination specified in the JMSReplyTo header. You can use this option if you want Camel to consume from a route and you do not want Camel to automatically send back a reply message because another component in your code handles the reply message. You can also use this option if you want to use Camel as a proxy between different message brokers and you want to route message from one system to another.|false|boolean|
64
+ |durableSubscriptionName|The durable subscriber name for specifying durable topic subscriptions. The clientId option must be configured as well.||string|
65
+ |embedded|Use an embedded in-memory (non-persistent) ActiveMQ broker for development and testing purposes. You must have activemq-broker JAR on the classpath.|false|boolean|
66
+ |jmsMessageType|Allows you to force the use of a specific jakarta.jms.Message implementation for sending JMS messages. Possible values are: Bytes, Map, Object, Stream, Text. By default, Camel would determine which JMS message type to use from the In body type. This option allows you to specify it.||object|
67
+ |replyTo|Provides an explicit ReplyTo destination (overrides any incoming value of Message.getJMSReplyTo() in consumer).||string|
68
+ |testConnectionOnStartup|Specifies whether to test the connection on startup. This ensures that when Camel starts that all the JMS consumers have a valid connection to the JMS broker. If a connection cannot be granted then Camel throws an exception on startup. This ensures that Camel is not started with failed connections. The JMS producers is tested as well.|false|boolean|
69
+ |usePooledConnection|Enables or disables whether a PooledConnectionFactory will be used so that when messages are sent to ActiveMQ from outside a message consuming thread, pooling will be used rather than the default with the Spring JmsTemplate which will create a new connection, session, producer for each message then close them all down again. The default value is true.|true|boolean|
70
+ |useSingleConnection|Enables or disables whether a Spring SingleConnectionFactory will be used so that when messages are sent to ActiveMQ from outside a message consuming thread, pooling will be used rather than the default with the Spring JmsTemplate which will create a new connection, session, producer for each message then close them all down again. The default value is false and a pooled connection is used by default.|false|boolean|
71
+ |acknowledgementModeName|The JMS acknowledgement name, which is one of: SESSION\_TRANSACTED, CLIENT\_ACKNOWLEDGE, AUTO\_ACKNOWLEDGE, DUPS\_OK\_ACKNOWLEDGE|AUTO\_ACKNOWLEDGE|string|
72
+ |artemisConsumerPriority|Consumer priorities allow you to ensure that high priority consumers receive messages while they are active. Normally, active consumers connected to a queue receive messages from it in a round-robin fashion. When consumer priorities are in use, messages are delivered round-robin if multiple active consumers exist with the same high priority. Messages will only going to lower priority consumers when the high priority consumers do not have credit available to consume the message, or those high priority consumers have declined to accept the message (for instance because it does not meet the criteria of any selectors associated with the consumer).||integer|
73
+ |asyncConsumer|Whether the JmsConsumer processes the Exchange asynchronously. If enabled then the JmsConsumer may pickup the next message from the JMS queue, while the previous message is being processed asynchronously (by the Asynchronous Routing Engine). This means that messages may be processed not 100% strictly in order. If disabled (as default) then the Exchange is fully processed before the JmsConsumer will pickup the next message from the JMS queue. Note if transacted has been enabled, then asyncConsumer=true does not run asynchronously, as transaction must be executed synchronously (Camel 3.0 may support async transactions).|false|boolean|
74
+ |autoStartup|Specifies whether the consumer container should auto-startup.|true|boolean|
75
+ |cacheLevel|Sets the cache level by ID for the underlying JMS resources. See cacheLevelName option for more details.||integer|
76
+ |cacheLevelName|Sets the cache level by name for the underlying JMS resources. Possible values are: CACHE\_AUTO, CACHE\_CONNECTION, CACHE\_CONSUMER, CACHE\_NONE, and CACHE\_SESSION. The default setting is CACHE\_AUTO. See the Spring documentation and Transactions Cache Levels for more information.|CACHE\_AUTO|string|
77
+ |concurrentConsumers|Specifies the default number of concurrent consumers when consuming from JMS (not for request/reply over JMS). See also the maxMessagesPerTask option to control dynamic scaling up/down of threads. When doing request/reply over JMS then the option replyToConcurrentConsumers is used to control number of concurrent consumers on the reply message listener.|1|integer|
78
+ |maxConcurrentConsumers|Specifies the maximum number of concurrent consumers when consuming from JMS (not for request/reply over JMS). See also the maxMessagesPerTask option to control dynamic scaling up/down of threads. When doing request/reply over JMS then the option replyToMaxConcurrentConsumers is used to control number of concurrent consumers on the reply message listener.||integer|
79
+ |replyToDeliveryPersistent|Specifies whether to use persistent delivery by default for replies.|true|boolean|
80
+ |selector|Sets the JMS selector to use||string|
81
+ |subscriptionDurable|Set whether to make the subscription durable. The durable subscription name to be used can be specified through the subscriptionName property. Default is false. Set this to true to register a durable subscription, typically in combination with a subscriptionName value (unless your message listener class name is good enough as subscription name). Only makes sense when listening to a topic (pub-sub domain), therefore this method switches the pubSubDomain flag as well.|false|boolean|
82
+ |subscriptionName|Set the name of a subscription to create. To be applied in case of a topic (pub-sub domain) with a shared or durable subscription. The subscription name needs to be unique within this client's JMS client id. Default is the class name of the specified message listener. Note: Only 1 concurrent consumer (which is the default of this message listener container) is allowed for each subscription, except for a shared subscription (which requires JMS 2.0).||string|
83
+ |subscriptionShared|Set whether to make the subscription shared. The shared subscription name to be used can be specified through the subscriptionName property. Default is false. Set this to true to register a shared subscription, typically in combination with a subscriptionName value (unless your message listener class name is good enough as subscription name). Note that shared subscriptions may also be durable, so this flag can (and often will) be combined with subscriptionDurable as well. Only makes sense when listening to a topic (pub-sub domain), therefore this method switches the pubSubDomain flag as well. Requires a JMS 2.0 compatible message broker.|false|boolean|
84
+ |acceptMessagesWhileStopping|Specifies whether the consumer accept messages while it is stopping. You may consider enabling this option, if you start and stop JMS routes at runtime, while there are still messages enqueued on the queue. If this option is false, and you stop the JMS route, then messages may be rejected, and the JMS broker would have to attempt redeliveries, which yet again may be rejected, and eventually the message may be moved at a dead letter queue on the JMS broker. To avoid this its recommended to enable this option.|false|boolean|
85
+ |allowReplyManagerQuickStop|Whether the DefaultMessageListenerContainer used in the reply managers for request-reply messaging allow the DefaultMessageListenerContainer.runningAllowed flag to quick stop in case JmsConfiguration#isAcceptMessagesWhileStopping is enabled, and org.apache.camel.CamelContext is currently being stopped. This quick stop ability is enabled by default in the regular JMS consumers but to enable for reply managers you must enable this flag.|false|boolean|
86
+ |consumerType|The consumer type to use, which can be one of: Simple, Default, or Custom. The consumer type determines which Spring JMS listener to use. Default will use org.springframework.jms.listener.DefaultMessageListenerContainer, Simple will use org.springframework.jms.listener.SimpleMessageListenerContainer. When Custom is specified, the MessageListenerContainerFactory defined by the messageListenerContainerFactory option will determine what org.springframework.jms.listener.AbstractMessageListenerContainer to use.|Default|object|
87
+ |defaultTaskExecutorType|Specifies what default TaskExecutor type to use in the DefaultMessageListenerContainer, for both consumer endpoints and the ReplyTo consumer of producer endpoints. Possible values: SimpleAsync (uses Spring's SimpleAsyncTaskExecutor) or ThreadPool (uses Spring's ThreadPoolTaskExecutor with optimal values - cached thread-pool-like). If not set, it defaults to the previous behaviour, which uses a cached thread pool for consumer endpoints and SimpleAsync for reply consumers. The use of ThreadPool is recommended to reduce thread trash in elastic configurations with dynamically increasing and decreasing concurrent consumers.||object|
88
+ |eagerLoadingOfProperties|Enables eager loading of JMS properties and payload as soon as a message is loaded which generally is inefficient as the JMS properties may not be required but sometimes can catch early any issues with the underlying JMS provider and the use of JMS properties. See also the option eagerPoisonBody.|false|boolean|
89
+ |eagerPoisonBody|If eagerLoadingOfProperties is enabled and the JMS message payload (JMS body or JMS properties) is poison (cannot be read/mapped), then set this text as the message body instead so the message can be processed (the cause of the poison are already stored as exception on the Exchange). This can be turned off by setting eagerPoisonBody=false. See also the option eagerLoadingOfProperties.|Poison JMS message due to ${exception.message}|string|
90
+ |exposeListenerSession|Specifies whether the listener session should be exposed when consuming messages.|false|boolean|
91
+ |replyToConsumerType|The consumer type of the reply consumer (when doing request/reply), which can be one of: Simple, Default, or Custom. The consumer type determines which Spring JMS listener to use. Default will use org.springframework.jms.listener.DefaultMessageListenerContainer, Simple will use org.springframework.jms.listener.SimpleMessageListenerContainer. When Custom is specified, the MessageListenerContainerFactory defined by the messageListenerContainerFactory option will determine what org.springframework.jms.listener.AbstractMessageListenerContainer to use.|Default|object|
92
+ |replyToSameDestinationAllowed|Whether a JMS consumer is allowed to send a reply message to the same destination that the consumer is using to consume from. This prevents an endless loop by consuming and sending back the same message to itself.|false|boolean|
93
+ |taskExecutor|Allows you to specify a custom task executor for consuming messages.||object|
94
+ |deliveryDelay|Sets delivery delay to use for send calls for JMS. This option requires JMS 2.0 compliant broker.|-1|integer|
95
+ |deliveryMode|Specifies the delivery mode to be used. Possible values are those defined by jakarta.jms.DeliveryMode. NON\_PERSISTENT = 1 and PERSISTENT = 2.||integer|
96
+ |deliveryPersistent|Specifies whether persistent delivery is used by default.|true|boolean|
97
+ |explicitQosEnabled|Set if the deliveryMode, priority or timeToLive qualities of service should be used when sending messages. This option is based on Spring's JmsTemplate. The deliveryMode, priority and timeToLive options are applied to the current endpoint. This contrasts with the preserveMessageQos option, which operates at message granularity, reading QoS properties exclusively from the Camel In message headers.|false|boolean|
98
+ |formatDateHeadersToIso8601|Sets whether JMS date properties should be formatted according to the ISO 8601 standard.|false|boolean|
99
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
100
+ |preserveMessageQos|Set to true, if you want to send message using the QoS settings specified on the message, instead of the QoS settings on the JMS endpoint. The following three headers are considered JMSPriority, JMSDeliveryMode, and JMSExpiration. You can provide all or only some of them. If not provided, Camel will fall back to use the values from the endpoint instead. So, when using this option, the headers override the values from the endpoint. The explicitQosEnabled option, by contrast, will only use options set on the endpoint, and not values from the message header.|false|boolean|
101
+ |priority|Values greater than 1 specify the message priority when sending (where 1 is the lowest priority and 9 is the highest). The explicitQosEnabled option must also be enabled in order for this option to have any effect.|4|integer|
102
+ |replyToConcurrentConsumers|Specifies the default number of concurrent consumers when doing request/reply over JMS. See also the maxMessagesPerTask option to control dynamic scaling up/down of threads.|1|integer|
103
+ |replyToMaxConcurrentConsumers|Specifies the maximum number of concurrent consumers when using request/reply over JMS. See also the maxMessagesPerTask option to control dynamic scaling up/down of threads.||integer|
104
+ |replyToOnTimeoutMaxConcurrentConsumers|Specifies the maximum number of concurrent consumers for continue routing when timeout occurred when using request/reply over JMS.|1|integer|
105
+ |replyToOverride|Provides an explicit ReplyTo destination in the JMS message, which overrides the setting of replyTo. It is useful if you want to forward the message to a remote Queue and receive the reply message from the ReplyTo destination.||string|
106
+ |replyToType|Allows for explicitly specifying which kind of strategy to use for replyTo queues when doing request/reply over JMS. Possible values are: Temporary, Shared, or Exclusive. By default Camel will use temporary queues. However if replyTo has been configured, then Shared is used by default. This option allows you to use exclusive queues instead of shared ones. See Camel JMS documentation for more details, and especially the notes about the implications if running in a clustered environment, and the fact that Shared reply queues has lower performance than its alternatives Temporary and Exclusive.||object|
107
+ |requestTimeout|The timeout for waiting for a reply when using the InOut Exchange Pattern (in milliseconds). The default is 20 seconds. You can include the header CamelJmsRequestTimeout to override this endpoint configured timeout value, and thus have per message individual timeout values. See also the requestTimeoutCheckerInterval option.|20000|duration|
108
+ |timeToLive|When sending messages, specifies the time-to-live of the message (in milliseconds).|-1|integer|
109
+ |allowAdditionalHeaders|This option is used to allow additional headers which may have values that are invalid according to JMS specification. For example, some message systems, such as WMQ, do this with header names using prefix JMS\_IBM\_MQMD\_ containing values with byte array or other invalid types. You can specify multiple header names separated by comma, and use as suffix for wildcard matching.||string|
110
+ |allowNullBody|Whether to allow sending messages with no body. If this option is false and the message body is null, then an JMSException is thrown.|true|boolean|
111
+ |alwaysCopyMessage|If true, Camel will always make a JMS message copy of the message when it is passed to the producer for sending. Copying the message is needed in some situations, such as when a replyToDestinationSelectorName is set (incidentally, Camel will set the alwaysCopyMessage option to true, if a replyToDestinationSelectorName is set)|false|boolean|
112
+ |correlationProperty|When using InOut exchange pattern use this JMS property instead of JMSCorrelationID JMS property to correlate messages. If set messages will be correlated solely on the value of this property JMSCorrelationID property will be ignored and not set by Camel.||string|
113
+ |disableTimeToLive|Use this option to force disabling time to live. For example when you do request/reply over JMS, then Camel will by default use the requestTimeout value as time to live on the message being sent. The problem is that the sender and receiver systems have to have their clocks synchronized, so they are in sync. This is not always so easy to archive. So you can use disableTimeToLive=true to not set a time to live value on the sent message. Then the message will not expire on the receiver system. See below in section About time to live for more details.|false|boolean|
114
+ |forceSendOriginalMessage|When using mapJmsMessage=false Camel will create a new JMS message to send to a new JMS destination if you touch the headers (get or set) during the route. Set this option to true to force Camel to send the original JMS message that was received.|false|boolean|
115
+ |includeSentJMSMessageID|Only applicable when sending to JMS destination using InOnly (eg fire and forget). Enabling this option will enrich the Camel Exchange with the actual JMSMessageID that was used by the JMS client when the message was sent to the JMS destination.|false|boolean|
116
+ |replyToCacheLevelName|Sets the cache level by name for the reply consumer when doing request/reply over JMS. This option only applies when using fixed reply queues (not temporary). Camel will by default use: CACHE\_CONSUMER for exclusive or shared w/ replyToSelectorName. And CACHE\_SESSION for shared without replyToSelectorName. Some JMS brokers such as IBM WebSphere may require to set the replyToCacheLevelName=CACHE\_NONE to work. Note: If using temporary queues then CACHE\_NONE is not allowed, and you must use a higher value such as CACHE\_CONSUMER or CACHE\_SESSION.||string|
117
+ |replyToDestinationSelectorName|Sets the JMS Selector using the fixed name to be used so you can filter out your own replies from the others when using a shared queue (that is, if you are not using a temporary reply queue).||string|
118
+ |streamMessageTypeEnabled|Sets whether StreamMessage type is enabled or not. Message payloads of streaming kind such as files, InputStream, etc will either by sent as BytesMessage or StreamMessage. This option controls which kind will be used. By default BytesMessage is used which enforces the entire message payload to be read into memory. By enabling this option the message payload is read into memory in chunks and each chunk is then written to the StreamMessage until no more data.|false|boolean|
119
+ |allowAutoWiredConnectionFactory|Whether to auto-discover ConnectionFactory from the registry, if no connection factory has been configured. If only one instance of ConnectionFactory is found then it will be used. This is enabled by default.|true|boolean|
120
+ |allowAutoWiredDestinationResolver|Whether to auto-discover DestinationResolver from the registry, if no destination resolver has been configured. If only one instance of DestinationResolver is found then it will be used. This is enabled by default.|true|boolean|
121
+ |allowSerializedHeaders|Controls whether or not to include serialized headers. Applies only when transferExchange is true. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level.|false|boolean|
122
+ |artemisStreamingEnabled|Whether optimizing for Apache Artemis streaming mode. This can reduce memory overhead when using Artemis with JMS StreamMessage types. This option must only be enabled if Apache Artemis is being used.|false|boolean|
123
+ |asyncStartListener|Whether to startup the JmsConsumer message listener asynchronously, when starting a route. For example if a JmsConsumer cannot get a connection to a remote JMS broker, then it may block while retrying and/or fail-over. This will cause Camel to block while starting routes. By setting this option to true, you will let routes startup, while the JmsConsumer connects to the JMS broker using a dedicated thread in asynchronous mode. If this option is used, then beware that if the connection could not be established, then an exception is logged at WARN level, and the consumer will not be able to receive messages; You can then restart the route to retry.|false|boolean|
124
+ |asyncStopListener|Whether to stop the JmsConsumer message listener asynchronously, when stopping a route.|false|boolean|
125
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
126
+ |configuration|To use a shared JMS configuration||object|
127
+ |destinationResolver|A pluggable org.springframework.jms.support.destination.DestinationResolver that allows you to use your own resolver (for example, to lookup the real destination in a JNDI registry).||object|
128
+ |errorHandler|Specifies a org.springframework.util.ErrorHandler to be invoked in case of any uncaught exceptions thrown while processing a Message. By default these exceptions will be logged at the WARN level, if no errorHandler has been configured. You can configure logging level and whether stack traces should be logged using errorHandlerLoggingLevel and errorHandlerLogStackTrace options. This makes it much easier to configure, than having to code a custom errorHandler.||object|
129
+ |exceptionListener|Specifies the JMS Exception Listener that is to be notified of any underlying JMS exceptions.||object|
130
+ |idleConsumerLimit|Specify the limit for the number of consumers that are allowed to be idle at any given time.|1|integer|
131
+ |idleTaskExecutionLimit|Specifies the limit for idle executions of a receive task, not having received any message within its execution. If this limit is reached, the task will shut down and leave receiving to other executing tasks (in the case of dynamic scheduling; see the maxConcurrentConsumers setting). There is additional doc available from Spring.|1|integer|
132
+ |includeAllJMSXProperties|Whether to include all JMSX prefixed properties when mapping from JMS to Camel Message. Setting this to true will include properties such as JMSXAppID, and JMSXUserID etc. Note: If you are using a custom headerFilterStrategy then this option does not apply.|false|boolean|
133
+ |includeCorrelationIDAsBytes|Whether the JMS consumer should include JMSCorrelationIDAsBytes as a header on the Camel Message.|true|boolean|
134
+ |jmsKeyFormatStrategy|Pluggable strategy for encoding and decoding JMS keys so they can be compliant with the JMS specification. Camel provides two implementations out of the box: default and passthrough. The default strategy will safely marshal dots and hyphens (. and -). The passthrough strategy leaves the key as is. Can be used for JMS brokers which do not care whether JMS header keys contain illegal characters. You can provide your own implementation of the org.apache.camel.component.jms.JmsKeyFormatStrategy and refer to it using the # notation.||object|
135
+ |mapJmsMessage|Specifies whether Camel should auto map the received JMS message to a suited payload type, such as jakarta.jms.TextMessage to a String etc.|true|boolean|
136
+ |maxMessagesPerTask|The number of messages per task. -1 is unlimited. If you use a range for concurrent consumers (eg min max), then this option can be used to set a value to eg 100 to control how fast the consumers will shrink when less work is required.|-1|integer|
137
+ |messageConverter|To use a custom Spring org.springframework.jms.support.converter.MessageConverter so you can be in control how to map to/from a jakarta.jms.Message.||object|
138
+ |messageCreatedStrategy|To use the given MessageCreatedStrategy which are invoked when Camel creates new instances of jakarta.jms.Message objects when Camel is sending a JMS message.||object|
139
+ |messageIdEnabled|When sending, specifies whether message IDs should be added. This is just an hint to the JMS broker. If the JMS provider accepts this hint, these messages must have the message ID set to null; if the provider ignores the hint, the message ID must be set to its normal unique value.|true|boolean|
140
+ |messageListenerContainerFactory|Registry ID of the MessageListenerContainerFactory used to determine what org.springframework.jms.listener.AbstractMessageListenerContainer to use to consume messages. Setting this will automatically set consumerType to Custom.||object|
141
+ |messageTimestampEnabled|Specifies whether timestamps should be enabled by default on sending messages. This is just an hint to the JMS broker. If the JMS provider accepts this hint, these messages must have the timestamp set to zero; if the provider ignores the hint the timestamp must be set to its normal value.|true|boolean|
142
+ |pubSubNoLocal|Specifies whether to inhibit the delivery of messages published by its own connection.|false|boolean|
143
+ |queueBrowseStrategy|To use a custom QueueBrowseStrategy when browsing queues||object|
144
+ |receiveTimeout|The timeout for receiving messages (in milliseconds).|1000|duration|
145
+ |recoveryInterval|Specifies the interval between recovery attempts, i.e. when a connection is being refreshed, in milliseconds. The default is 5000 ms, that is, 5 seconds.|5000|duration|
146
+ |requestTimeoutCheckerInterval|Configures how often Camel should check for timed out Exchanges when doing request/reply over JMS. By default Camel checks once per second. But if you must react faster when a timeout occurs, then you can lower this interval, to check more frequently. The timeout is determined by the option requestTimeout.|1000|duration|
147
+ |serviceLocationEnabled|Whether to detect the network address location of the JMS broker on startup. This information is gathered via reflection on the ConnectionFactory, and is vendor specific. This option can be used to turn this off.|true|boolean|
148
+ |synchronous|Sets whether synchronous processing should be strictly used|false|boolean|
149
+ |temporaryQueueResolver|A pluggable TemporaryQueueResolver that allows you to use your own resolver for creating temporary queues (some messaging systems has special requirements for creating temporary queues).||object|
150
+ |transferException|If enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the consumer side, then the caused Exception will be send back in response as a jakarta.jms.ObjectMessage. If the client is Camel, the returned Exception is rethrown. This allows you to use Camel JMS as a bridge in your routing - for example, using persistent queues to enable robust routing. Notice that if you also have transferExchange enabled, this option takes precedence. The caught exception is required to be serializable. The original Exception on the consumer side can be wrapped in an outer exception such as org.apache.camel.RuntimeCamelException when returned to the producer. Use this with caution as the data is using Java Object serialization and requires the received to be able to deserialize the data at Class level, which forces a strong coupling between the producers and consumer!|false|boolean|
151
+ |transferExchange|You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an Exchange and not a regular payload. Use this with caution as the data is using Java Object serialization and requires the receiver to be able to deserialize the data at Class level, which forces a strong coupling between the producers and consumers having to use compatible Camel versions!|false|boolean|
152
+ |trustAllPackages|Define if all Java packages are trusted or not (for Java object JMS message types). Notice its not recommended practice to send Java serialized objects over network. Setting this to true can expose security risks, so use this with care.|false|boolean|
153
+ |useMessageIDAsCorrelationID|Specifies whether JMSMessageID should always be used as JMSCorrelationID for InOut messages.|false|boolean|
154
+ |waitForProvisionCorrelationToBeUpdatedCounter|Number of times to wait for provisional correlation id to be updated to the actual correlation id when doing request/reply over JMS and when the option useMessageIDAsCorrelationID is enabled.|50|integer|
155
+ |waitForProvisionCorrelationToBeUpdatedThreadSleepingTime|Interval in millis to sleep each time while waiting for provisional correlation id to be updated.|100|duration|
156
+ |waitForTemporaryReplyToToBeUpdatedCounter|Number of times to wait for temporary replyTo queue to be created and ready when doing request/reply over JMS.|200|integer|
157
+ |waitForTemporaryReplyToToBeUpdatedThreadSleepingTime|Interval in millis to sleep each time while waiting for temporary replyTo queue to be ready.|100|duration|
158
+ |headerFilterStrategy|To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message.||object|
159
+ |errorHandlerLoggingLevel|Allows to configure the default errorHandler logging level for logging uncaught exceptions.|WARN|object|
160
+ |errorHandlerLogStackTrace|Allows to control whether stack-traces should be logged or not, by the default errorHandler.|true|boolean|
161
+ |password|Password to use with the ConnectionFactory. You can also configure username/password directly on the ConnectionFactory.||string|
162
+ |username|Username to use with the ConnectionFactory. You can also configure username/password directly on the ConnectionFactory.||string|
163
+ |transacted|Specifies whether to use transacted mode|false|boolean|
164
+ |transactedInOut|Specifies whether InOut operations (request reply) default to using transacted mode If this flag is set to true, then Spring JmsTemplate will have sessionTransacted set to true, and the acknowledgeMode as transacted on the JmsTemplate used for InOut operations. Note from Spring JMS: that within a JTA transaction, the parameters passed to createQueue, createTopic methods are not taken into account. Depending on the Java EE transaction context, the container makes its own decisions on these values. Analogously, these parameters are not taken into account within a locally managed transaction either, since Spring JMS operates on an existing JMS Session in this case. Setting this flag to true will use a short local JMS transaction when running outside of a managed transaction, and a synchronized local JMS transaction in case of a managed transaction (other than an XA transaction) being present. This has the effect of a local JMS transaction being managed alongside the main transaction (which might be a native JDBC transaction), with the JMS transaction committing right after the main transaction.|false|boolean|
165
+ |lazyCreateTransactionManager|If true, Camel will create a JmsTransactionManager, if there is no transactionManager injected when option transacted=true.|true|boolean|
166
+ |transactionManager|The Spring transaction manager to use.||object|
167
+ |transactionName|The name of the transaction to use.||string|
168
+ |transactionTimeout|The timeout value of the transaction (in seconds), if using transacted mode.|-1|integer|
169
+
170
+ ## Endpoint Configurations
171
+
172
+
173
+ |Name|Description|Default|Type|
174
+ |---|---|---|---|
175
+ |destinationType|The kind of destination to use|queue|string|
176
+ |destinationName|Name of the queue or topic to use as destination||string|
177
+ |clientId|Sets the JMS client ID to use. Note that this value, if specified, must be unique and can only be used by a single JMS connection instance. It is typically only required for durable topic subscriptions with JMS 1.1.||string|
178
+ |connectionFactory|The connection factory to be use. A connection factory must be configured either on the component or endpoint.||object|
179
+ |disableReplyTo|Specifies whether Camel ignores the JMSReplyTo header in messages. If true, Camel does not send a reply back to the destination specified in the JMSReplyTo header. You can use this option if you want Camel to consume from a route and you do not want Camel to automatically send back a reply message because another component in your code handles the reply message. You can also use this option if you want to use Camel as a proxy between different message brokers and you want to route message from one system to another.|false|boolean|
180
+ |durableSubscriptionName|The durable subscriber name for specifying durable topic subscriptions. The clientId option must be configured as well.||string|
181
+ |jmsMessageType|Allows you to force the use of a specific jakarta.jms.Message implementation for sending JMS messages. Possible values are: Bytes, Map, Object, Stream, Text. By default, Camel would determine which JMS message type to use from the In body type. This option allows you to specify it.||object|
182
+ |replyTo|Provides an explicit ReplyTo destination (overrides any incoming value of Message.getJMSReplyTo() in consumer).||string|
183
+ |testConnectionOnStartup|Specifies whether to test the connection on startup. This ensures that when Camel starts that all the JMS consumers have a valid connection to the JMS broker. If a connection cannot be granted then Camel throws an exception on startup. This ensures that Camel is not started with failed connections. The JMS producers is tested as well.|false|boolean|
184
+ |acknowledgementModeName|The JMS acknowledgement name, which is one of: SESSION\_TRANSACTED, CLIENT\_ACKNOWLEDGE, AUTO\_ACKNOWLEDGE, DUPS\_OK\_ACKNOWLEDGE|AUTO\_ACKNOWLEDGE|string|
185
+ |artemisConsumerPriority|Consumer priorities allow you to ensure that high priority consumers receive messages while they are active. Normally, active consumers connected to a queue receive messages from it in a round-robin fashion. When consumer priorities are in use, messages are delivered round-robin if multiple active consumers exist with the same high priority. Messages will only going to lower priority consumers when the high priority consumers do not have credit available to consume the message, or those high priority consumers have declined to accept the message (for instance because it does not meet the criteria of any selectors associated with the consumer).||integer|
186
+ |asyncConsumer|Whether the JmsConsumer processes the Exchange asynchronously. If enabled then the JmsConsumer may pickup the next message from the JMS queue, while the previous message is being processed asynchronously (by the Asynchronous Routing Engine). This means that messages may be processed not 100% strictly in order. If disabled (as default) then the Exchange is fully processed before the JmsConsumer will pickup the next message from the JMS queue. Note if transacted has been enabled, then asyncConsumer=true does not run asynchronously, as transaction must be executed synchronously (Camel 3.0 may support async transactions).|false|boolean|
187
+ |autoStartup|Specifies whether the consumer container should auto-startup.|true|boolean|
188
+ |cacheLevel|Sets the cache level by ID for the underlying JMS resources. See cacheLevelName option for more details.||integer|
189
+ |cacheLevelName|Sets the cache level by name for the underlying JMS resources. Possible values are: CACHE\_AUTO, CACHE\_CONNECTION, CACHE\_CONSUMER, CACHE\_NONE, and CACHE\_SESSION. The default setting is CACHE\_AUTO. See the Spring documentation and Transactions Cache Levels for more information.|CACHE\_AUTO|string|
190
+ |concurrentConsumers|Specifies the default number of concurrent consumers when consuming from JMS (not for request/reply over JMS). See also the maxMessagesPerTask option to control dynamic scaling up/down of threads. When doing request/reply over JMS then the option replyToConcurrentConsumers is used to control number of concurrent consumers on the reply message listener.|1|integer|
191
+ |maxConcurrentConsumers|Specifies the maximum number of concurrent consumers when consuming from JMS (not for request/reply over JMS). See also the maxMessagesPerTask option to control dynamic scaling up/down of threads. When doing request/reply over JMS then the option replyToMaxConcurrentConsumers is used to control number of concurrent consumers on the reply message listener.||integer|
192
+ |replyToDeliveryPersistent|Specifies whether to use persistent delivery by default for replies.|true|boolean|
193
+ |selector|Sets the JMS selector to use||string|
194
+ |subscriptionDurable|Set whether to make the subscription durable. The durable subscription name to be used can be specified through the subscriptionName property. Default is false. Set this to true to register a durable subscription, typically in combination with a subscriptionName value (unless your message listener class name is good enough as subscription name). Only makes sense when listening to a topic (pub-sub domain), therefore this method switches the pubSubDomain flag as well.|false|boolean|
195
+ |subscriptionName|Set the name of a subscription to create. To be applied in case of a topic (pub-sub domain) with a shared or durable subscription. The subscription name needs to be unique within this client's JMS client id. Default is the class name of the specified message listener. Note: Only 1 concurrent consumer (which is the default of this message listener container) is allowed for each subscription, except for a shared subscription (which requires JMS 2.0).||string|
196
+ |subscriptionShared|Set whether to make the subscription shared. The shared subscription name to be used can be specified through the subscriptionName property. Default is false. Set this to true to register a shared subscription, typically in combination with a subscriptionName value (unless your message listener class name is good enough as subscription name). Note that shared subscriptions may also be durable, so this flag can (and often will) be combined with subscriptionDurable as well. Only makes sense when listening to a topic (pub-sub domain), therefore this method switches the pubSubDomain flag as well. Requires a JMS 2.0 compatible message broker.|false|boolean|
197
+ |acceptMessagesWhileStopping|Specifies whether the consumer accept messages while it is stopping. You may consider enabling this option, if you start and stop JMS routes at runtime, while there are still messages enqueued on the queue. If this option is false, and you stop the JMS route, then messages may be rejected, and the JMS broker would have to attempt redeliveries, which yet again may be rejected, and eventually the message may be moved at a dead letter queue on the JMS broker. To avoid this its recommended to enable this option.|false|boolean|
198
+ |allowReplyManagerQuickStop|Whether the DefaultMessageListenerContainer used in the reply managers for request-reply messaging allow the DefaultMessageListenerContainer.runningAllowed flag to quick stop in case JmsConfiguration#isAcceptMessagesWhileStopping is enabled, and org.apache.camel.CamelContext is currently being stopped. This quick stop ability is enabled by default in the regular JMS consumers but to enable for reply managers you must enable this flag.|false|boolean|
199
+ |consumerType|The consumer type to use, which can be one of: Simple, Default, or Custom. The consumer type determines which Spring JMS listener to use. Default will use org.springframework.jms.listener.DefaultMessageListenerContainer, Simple will use org.springframework.jms.listener.SimpleMessageListenerContainer. When Custom is specified, the MessageListenerContainerFactory defined by the messageListenerContainerFactory option will determine what org.springframework.jms.listener.AbstractMessageListenerContainer to use.|Default|object|
200
+ |defaultTaskExecutorType|Specifies what default TaskExecutor type to use in the DefaultMessageListenerContainer, for both consumer endpoints and the ReplyTo consumer of producer endpoints. Possible values: SimpleAsync (uses Spring's SimpleAsyncTaskExecutor) or ThreadPool (uses Spring's ThreadPoolTaskExecutor with optimal values - cached thread-pool-like). If not set, it defaults to the previous behaviour, which uses a cached thread pool for consumer endpoints and SimpleAsync for reply consumers. The use of ThreadPool is recommended to reduce thread trash in elastic configurations with dynamically increasing and decreasing concurrent consumers.||object|
201
+ |destinationOptions|Destination Options are a way to provide extended configuration options to a JMS consumer without having to extend the JMS API. The options are encoded using URL query syntax in the destination name that the consumer is created on. See more details at https://activemq.apache.org/destination-options.||object|
202
+ |eagerLoadingOfProperties|Enables eager loading of JMS properties and payload as soon as a message is loaded which generally is inefficient as the JMS properties may not be required but sometimes can catch early any issues with the underlying JMS provider and the use of JMS properties. See also the option eagerPoisonBody.|false|boolean|
203
+ |eagerPoisonBody|If eagerLoadingOfProperties is enabled and the JMS message payload (JMS body or JMS properties) is poison (cannot be read/mapped), then set this text as the message body instead so the message can be processed (the cause of the poison are already stored as exception on the Exchange). This can be turned off by setting eagerPoisonBody=false. See also the option eagerLoadingOfProperties.|Poison JMS message due to ${exception.message}|string|
204
+ |exceptionHandler|To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.||object|
205
+ |exchangePattern|Sets the exchange pattern when the consumer creates an exchange.||object|
206
+ |exposeListenerSession|Specifies whether the listener session should be exposed when consuming messages.|false|boolean|
207
+ |replyToConsumerType|The consumer type of the reply consumer (when doing request/reply), which can be one of: Simple, Default, or Custom. The consumer type determines which Spring JMS listener to use. Default will use org.springframework.jms.listener.DefaultMessageListenerContainer, Simple will use org.springframework.jms.listener.SimpleMessageListenerContainer. When Custom is specified, the MessageListenerContainerFactory defined by the messageListenerContainerFactory option will determine what org.springframework.jms.listener.AbstractMessageListenerContainer to use.|Default|object|
208
+ |replyToSameDestinationAllowed|Whether a JMS consumer is allowed to send a reply message to the same destination that the consumer is using to consume from. This prevents an endless loop by consuming and sending back the same message to itself.|false|boolean|
209
+ |taskExecutor|Allows you to specify a custom task executor for consuming messages.||object|
210
+ |deliveryDelay|Sets delivery delay to use for send calls for JMS. This option requires JMS 2.0 compliant broker.|-1|integer|
211
+ |deliveryMode|Specifies the delivery mode to be used. Possible values are those defined by jakarta.jms.DeliveryMode. NON\_PERSISTENT = 1 and PERSISTENT = 2.||integer|
212
+ |deliveryPersistent|Specifies whether persistent delivery is used by default.|true|boolean|
213
+ |explicitQosEnabled|Set if the deliveryMode, priority or timeToLive qualities of service should be used when sending messages. This option is based on Spring's JmsTemplate. The deliveryMode, priority and timeToLive options are applied to the current endpoint. This contrasts with the preserveMessageQos option, which operates at message granularity, reading QoS properties exclusively from the Camel In message headers.|false|boolean|
214
+ |formatDateHeadersToIso8601|Sets whether JMS date properties should be formatted according to the ISO 8601 standard.|false|boolean|
215
+ |preserveMessageQos|Set to true, if you want to send message using the QoS settings specified on the message, instead of the QoS settings on the JMS endpoint. The following three headers are considered JMSPriority, JMSDeliveryMode, and JMSExpiration. You can provide all or only some of them. If not provided, Camel will fall back to use the values from the endpoint instead. So, when using this option, the headers override the values from the endpoint. The explicitQosEnabled option, by contrast, will only use options set on the endpoint, and not values from the message header.|false|boolean|
216
+ |priority|Values greater than 1 specify the message priority when sending (where 1 is the lowest priority and 9 is the highest). The explicitQosEnabled option must also be enabled in order for this option to have any effect.|4|integer|
217
+ |replyToConcurrentConsumers|Specifies the default number of concurrent consumers when doing request/reply over JMS. See also the maxMessagesPerTask option to control dynamic scaling up/down of threads.|1|integer|
218
+ |replyToMaxConcurrentConsumers|Specifies the maximum number of concurrent consumers when using request/reply over JMS. See also the maxMessagesPerTask option to control dynamic scaling up/down of threads.||integer|
219
+ |replyToOnTimeoutMaxConcurrentConsumers|Specifies the maximum number of concurrent consumers for continue routing when timeout occurred when using request/reply over JMS.|1|integer|
220
+ |replyToOverride|Provides an explicit ReplyTo destination in the JMS message, which overrides the setting of replyTo. It is useful if you want to forward the message to a remote Queue and receive the reply message from the ReplyTo destination.||string|
221
+ |replyToType|Allows for explicitly specifying which kind of strategy to use for replyTo queues when doing request/reply over JMS. Possible values are: Temporary, Shared, or Exclusive. By default Camel will use temporary queues. However if replyTo has been configured, then Shared is used by default. This option allows you to use exclusive queues instead of shared ones. See Camel JMS documentation for more details, and especially the notes about the implications if running in a clustered environment, and the fact that Shared reply queues has lower performance than its alternatives Temporary and Exclusive.||object|
222
+ |requestTimeout|The timeout for waiting for a reply when using the InOut Exchange Pattern (in milliseconds). The default is 20 seconds. You can include the header CamelJmsRequestTimeout to override this endpoint configured timeout value, and thus have per message individual timeout values. See also the requestTimeoutCheckerInterval option.|20000|duration|
223
+ |timeToLive|When sending messages, specifies the time-to-live of the message (in milliseconds).|-1|integer|
224
+ |allowAdditionalHeaders|This option is used to allow additional headers which may have values that are invalid according to JMS specification. For example, some message systems, such as WMQ, do this with header names using prefix JMS\_IBM\_MQMD\_ containing values with byte array or other invalid types. You can specify multiple header names separated by comma, and use as suffix for wildcard matching.||string|
225
+ |allowNullBody|Whether to allow sending messages with no body. If this option is false and the message body is null, then an JMSException is thrown.|true|boolean|
226
+ |alwaysCopyMessage|If true, Camel will always make a JMS message copy of the message when it is passed to the producer for sending. Copying the message is needed in some situations, such as when a replyToDestinationSelectorName is set (incidentally, Camel will set the alwaysCopyMessage option to true, if a replyToDestinationSelectorName is set)|false|boolean|
227
+ |correlationProperty|When using InOut exchange pattern use this JMS property instead of JMSCorrelationID JMS property to correlate messages. If set messages will be correlated solely on the value of this property JMSCorrelationID property will be ignored and not set by Camel.||string|
228
+ |disableTimeToLive|Use this option to force disabling time to live. For example when you do request/reply over JMS, then Camel will by default use the requestTimeout value as time to live on the message being sent. The problem is that the sender and receiver systems have to have their clocks synchronized, so they are in sync. This is not always so easy to archive. So you can use disableTimeToLive=true to not set a time to live value on the sent message. Then the message will not expire on the receiver system. See below in section About time to live for more details.|false|boolean|
229
+ |forceSendOriginalMessage|When using mapJmsMessage=false Camel will create a new JMS message to send to a new JMS destination if you touch the headers (get or set) during the route. Set this option to true to force Camel to send the original JMS message that was received.|false|boolean|
230
+ |includeSentJMSMessageID|Only applicable when sending to JMS destination using InOnly (eg fire and forget). Enabling this option will enrich the Camel Exchange with the actual JMSMessageID that was used by the JMS client when the message was sent to the JMS destination.|false|boolean|
231
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
232
+ |replyToCacheLevelName|Sets the cache level by name for the reply consumer when doing request/reply over JMS. This option only applies when using fixed reply queues (not temporary). Camel will by default use: CACHE\_CONSUMER for exclusive or shared w/ replyToSelectorName. And CACHE\_SESSION for shared without replyToSelectorName. Some JMS brokers such as IBM WebSphere may require to set the replyToCacheLevelName=CACHE\_NONE to work. Note: If using temporary queues then CACHE\_NONE is not allowed, and you must use a higher value such as CACHE\_CONSUMER or CACHE\_SESSION.||string|
233
+ |replyToDestinationSelectorName|Sets the JMS Selector using the fixed name to be used so you can filter out your own replies from the others when using a shared queue (that is, if you are not using a temporary reply queue).||string|
234
+ |streamMessageTypeEnabled|Sets whether StreamMessage type is enabled or not. Message payloads of streaming kind such as files, InputStream, etc will either by sent as BytesMessage or StreamMessage. This option controls which kind will be used. By default BytesMessage is used which enforces the entire message payload to be read into memory. By enabling this option the message payload is read into memory in chunks and each chunk is then written to the StreamMessage until no more data.|false|boolean|
235
+ |allowSerializedHeaders|Controls whether or not to include serialized headers. Applies only when transferExchange is true. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level.|false|boolean|
236
+ |artemisStreamingEnabled|Whether optimizing for Apache Artemis streaming mode. This can reduce memory overhead when using Artemis with JMS StreamMessage types. This option must only be enabled if Apache Artemis is being used.|false|boolean|
237
+ |asyncStartListener|Whether to startup the JmsConsumer message listener asynchronously, when starting a route. For example if a JmsConsumer cannot get a connection to a remote JMS broker, then it may block while retrying and/or fail-over. This will cause Camel to block while starting routes. By setting this option to true, you will let routes startup, while the JmsConsumer connects to the JMS broker using a dedicated thread in asynchronous mode. If this option is used, then beware that if the connection could not be established, then an exception is logged at WARN level, and the consumer will not be able to receive messages; You can then restart the route to retry.|false|boolean|
238
+ |asyncStopListener|Whether to stop the JmsConsumer message listener asynchronously, when stopping a route.|false|boolean|
239
+ |destinationResolver|A pluggable org.springframework.jms.support.destination.DestinationResolver that allows you to use your own resolver (for example, to lookup the real destination in a JNDI registry).||object|
240
+ |errorHandler|Specifies a org.springframework.util.ErrorHandler to be invoked in case of any uncaught exceptions thrown while processing a Message. By default these exceptions will be logged at the WARN level, if no errorHandler has been configured. You can configure logging level and whether stack traces should be logged using errorHandlerLoggingLevel and errorHandlerLogStackTrace options. This makes it much easier to configure, than having to code a custom errorHandler.||object|
241
+ |exceptionListener|Specifies the JMS Exception Listener that is to be notified of any underlying JMS exceptions.||object|
242
+ |headerFilterStrategy|To use a custom HeaderFilterStrategy to filter header to and from Camel message.||object|
243
+ |idleConsumerLimit|Specify the limit for the number of consumers that are allowed to be idle at any given time.|1|integer|
244
+ |idleTaskExecutionLimit|Specifies the limit for idle executions of a receive task, not having received any message within its execution. If this limit is reached, the task will shut down and leave receiving to other executing tasks (in the case of dynamic scheduling; see the maxConcurrentConsumers setting). There is additional doc available from Spring.|1|integer|
245
+ |includeAllJMSXProperties|Whether to include all JMSX prefixed properties when mapping from JMS to Camel Message. Setting this to true will include properties such as JMSXAppID, and JMSXUserID etc. Note: If you are using a custom headerFilterStrategy then this option does not apply.|false|boolean|
246
+ |jmsKeyFormatStrategy|Pluggable strategy for encoding and decoding JMS keys so they can be compliant with the JMS specification. Camel provides two implementations out of the box: default and passthrough. The default strategy will safely marshal dots and hyphens (. and -). The passthrough strategy leaves the key as is. Can be used for JMS brokers which do not care whether JMS header keys contain illegal characters. You can provide your own implementation of the org.apache.camel.component.jms.JmsKeyFormatStrategy and refer to it using the # notation.||object|
247
+ |mapJmsMessage|Specifies whether Camel should auto map the received JMS message to a suited payload type, such as jakarta.jms.TextMessage to a String etc.|true|boolean|
248
+ |maxMessagesPerTask|The number of messages per task. -1 is unlimited. If you use a range for concurrent consumers (eg min max), then this option can be used to set a value to eg 100 to control how fast the consumers will shrink when less work is required.|-1|integer|
249
+ |messageConverter|To use a custom Spring org.springframework.jms.support.converter.MessageConverter so you can be in control how to map to/from a jakarta.jms.Message.||object|
250
+ |messageCreatedStrategy|To use the given MessageCreatedStrategy which are invoked when Camel creates new instances of jakarta.jms.Message objects when Camel is sending a JMS message.||object|
251
+ |messageIdEnabled|When sending, specifies whether message IDs should be added. This is just an hint to the JMS broker. If the JMS provider accepts this hint, these messages must have the message ID set to null; if the provider ignores the hint, the message ID must be set to its normal unique value.|true|boolean|
252
+ |messageListenerContainerFactory|Registry ID of the MessageListenerContainerFactory used to determine what org.springframework.jms.listener.AbstractMessageListenerContainer to use to consume messages. Setting this will automatically set consumerType to Custom.||object|
253
+ |messageTimestampEnabled|Specifies whether timestamps should be enabled by default on sending messages. This is just an hint to the JMS broker. If the JMS provider accepts this hint, these messages must have the timestamp set to zero; if the provider ignores the hint the timestamp must be set to its normal value.|true|boolean|
254
+ |pubSubNoLocal|Specifies whether to inhibit the delivery of messages published by its own connection.|false|boolean|
255
+ |receiveTimeout|The timeout for receiving messages (in milliseconds).|1000|duration|
256
+ |recoveryInterval|Specifies the interval between recovery attempts, i.e. when a connection is being refreshed, in milliseconds. The default is 5000 ms, that is, 5 seconds.|5000|duration|
257
+ |requestTimeoutCheckerInterval|Configures how often Camel should check for timed out Exchanges when doing request/reply over JMS. By default Camel checks once per second. But if you must react faster when a timeout occurs, then you can lower this interval, to check more frequently. The timeout is determined by the option requestTimeout.|1000|duration|
258
+ |synchronous|Sets whether synchronous processing should be strictly used|false|boolean|
259
+ |temporaryQueueResolver|A pluggable TemporaryQueueResolver that allows you to use your own resolver for creating temporary queues (some messaging systems has special requirements for creating temporary queues).||object|
260
+ |transferException|If enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the consumer side, then the caused Exception will be send back in response as a jakarta.jms.ObjectMessage. If the client is Camel, the returned Exception is rethrown. This allows you to use Camel JMS as a bridge in your routing - for example, using persistent queues to enable robust routing. Notice that if you also have transferExchange enabled, this option takes precedence. The caught exception is required to be serializable. The original Exception on the consumer side can be wrapped in an outer exception such as org.apache.camel.RuntimeCamelException when returned to the producer. Use this with caution as the data is using Java Object serialization and requires the received to be able to deserialize the data at Class level, which forces a strong coupling between the producers and consumer!|false|boolean|
261
+ |transferExchange|You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an Exchange and not a regular payload. Use this with caution as the data is using Java Object serialization and requires the receiver to be able to deserialize the data at Class level, which forces a strong coupling between the producers and consumers having to use compatible Camel versions!|false|boolean|
262
+ |useMessageIDAsCorrelationID|Specifies whether JMSMessageID should always be used as JMSCorrelationID for InOut messages.|false|boolean|
263
+ |waitForProvisionCorrelationToBeUpdatedCounter|Number of times to wait for provisional correlation id to be updated to the actual correlation id when doing request/reply over JMS and when the option useMessageIDAsCorrelationID is enabled.|50|integer|
264
+ |waitForProvisionCorrelationToBeUpdatedThreadSleepingTime|Interval in millis to sleep each time while waiting for provisional correlation id to be updated.|100|duration|
265
+ |waitForTemporaryReplyToToBeUpdatedCounter|Number of times to wait for temporary replyTo queue to be created and ready when doing request/reply over JMS.|200|integer|
266
+ |waitForTemporaryReplyToToBeUpdatedThreadSleepingTime|Interval in millis to sleep each time while waiting for temporary replyTo queue to be ready.|100|duration|
267
+ |errorHandlerLoggingLevel|Allows to configure the default errorHandler logging level for logging uncaught exceptions.|WARN|object|
268
+ |errorHandlerLogStackTrace|Allows to control whether stack-traces should be logged or not, by the default errorHandler.|true|boolean|
269
+ |password|Password to use with the ConnectionFactory. You can also configure username/password directly on the ConnectionFactory.||string|
270
+ |username|Username to use with the ConnectionFactory. You can also configure username/password directly on the ConnectionFactory.||string|
271
+ |transacted|Specifies whether to use transacted mode|false|boolean|
272
+ |transactedInOut|Specifies whether InOut operations (request reply) default to using transacted mode If this flag is set to true, then Spring JmsTemplate will have sessionTransacted set to true, and the acknowledgeMode as transacted on the JmsTemplate used for InOut operations. Note from Spring JMS: that within a JTA transaction, the parameters passed to createQueue, createTopic methods are not taken into account. Depending on the Java EE transaction context, the container makes its own decisions on these values. Analogously, these parameters are not taken into account within a locally managed transaction either, since Spring JMS operates on an existing JMS Session in this case. Setting this flag to true will use a short local JMS transaction when running outside of a managed transaction, and a synchronized local JMS transaction in case of a managed transaction (other than an XA transaction) being present. This has the effect of a local JMS transaction being managed alongside the main transaction (which might be a native JDBC transaction), with the JMS transaction committing right after the main transaction.|false|boolean|
273
+ |lazyCreateTransactionManager|If true, Camel will create a JmsTransactionManager, if there is no transactionManager injected when option transacted=true.|true|boolean|
274
+ |transactionManager|The Spring transaction manager to use.||object|
275
+ |transactionName|The name of the transaction to use.||string|
276
+ |transactionTimeout|The timeout value of the transaction (in seconds), if using transacted mode.|-1|integer|
camel-amqp.md ADDED
@@ -0,0 +1,337 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Amqp
2
+
3
+ **Since Camel 1.2**
4
+
5
+ **Both producer and consumer are supported**
6
+
7
+ The AMQP component supports the [AMQP 1.0
8
+ protocol](http://www.amqp.org/) using the JMS Client API of the
9
+ [Qpid](http://qpid.apache.org/) project.
10
+
11
+ Maven users will need to add the following dependency to their `pom.xml`
12
+ for this component:
13
+
14
+ <dependency>
15
+ <groupId>org.apache.camel</groupId>
16
+ <artifactId>camel-amqp</artifactId>
17
+ <version>${camel.version}</version> <!-- use the same version as your Camel core version -->
18
+ </dependency>
19
+
20
+ # URI format
21
+
22
+ amqp:[queue:|topic:]destinationName[?options]
23
+
24
+ # Usage
25
+
26
+ As AMQP component is inherited from JMS component, the usage of the
27
+ former is almost identical to the latter:
28
+
29
+ **Using AMQP component**
30
+
31
+ // Consuming from AMQP queue
32
+ from("amqp:queue:incoming").
33
+ to(...);
34
+
35
+ // Sending messages to the AMQP topic
36
+ from(...).
37
+ to("amqp:topic:notify");
38
+
39
+ # Configuring AMQP component
40
+
41
+ **Creating AMQP 1.0 component**
42
+
43
+ AMQPComponent amqp = AMQPComponent.amqpComponent("amqp://localhost:5672");
44
+
45
+ AMQPComponent authorizedAmqp = AMQPComponent.amqpComponent("amqp://localhost:5672", "user", "password");
46
+
47
+ You can also add an instance of
48
+ `org.apache.camel.component.amqp.AMQPConnectionDetails` to the registry
49
+ to automatically configure the AMQP component. For example, for Spring
50
+ Boot, you have to define bean:
51
+
52
+ **AMQP connection details auto-configuration**
53
+
54
+ @Bean
55
+ AMQPConnectionDetails amqpConnection() {
56
+ return new AMQPConnectionDetails("amqp://localhost:5672");
57
+ }
58
+
59
+ @Bean
60
+ AMQPConnectionDetails securedAmqpConnection() {
61
+ return new AMQPConnectionDetails("amqp://localhost:5672", "username", "password");
62
+ }
63
+
64
+ Likewise, you can also use CDI producer methods when using Camel-CDI
65
+
66
+ **AMQP connection details auto-configuration for CDI**
67
+
68
+ @Produces
69
+ AMQPConnectionDetails amqpConnection() {
70
+ return new AMQPConnectionDetails("amqp://localhost:5672");
71
+ }
72
+
73
+ You can also rely on the [Camel properties](#properties-component.adoc)
74
+ to read the AMQP connection details. Factory method
75
+ `AMQPConnectionDetails.discoverAMQP()` attempts to read Camel properties
76
+ in a Kubernetes-like convention, just as demonstrated on the snippet
77
+ below:
78
+
79
+ **AMQP connection details auto-configuration**
80
+
81
+ export AMQP_SERVICE_HOST = "mybroker.com"
82
+ export AMQP_SERVICE_PORT = "6666"
83
+ export AMQP_SERVICE_USERNAME = "username"
84
+ export AMQP_SERVICE_PASSWORD = "password"
85
+
86
+ ...
87
+
88
+ @Bean
89
+ AMQPConnectionDetails amqpConnection() {
90
+ return AMQPConnectionDetails.discoverAMQP();
91
+ }
92
+
93
+ **Enabling AMQP specific options**
94
+
95
+ If you, for example, need to enable `amqp.traceFrames` you can do that
96
+ by appending the option to your URI, like the following example:
97
+
98
+ AMQPComponent amqp = AMQPComponent.amqpComponent("amqp://localhost:5672?amqp.traceFrames=true");
99
+
100
+ For reference, take a look at the [QPID JMS client
101
+ configuration](https://qpid.apache.org/releases/qpid-jms-1.7.0/docs/index.html)
102
+
103
+ # Using topics
104
+
105
+ To have using topics working with `camel-amqp` you need to configure the
106
+ component to use `topic://` as topic prefix, as shown below:
107
+
108
+ <bean id="amqp" class="org.apache.camel.component.amqp.AmqpComponent">
109
+ <property name="connectionFactory">
110
+ <bean class="org.apache.qpid.jms.JmsConnectionFactory" factory-method="createFromURL">
111
+ <property name="remoteURI" value="amqp://localhost:5672" />
112
+ <property name="topicPrefix" value="topic://" /> <!-- only necessary when connecting to ActiveMQ over AMQP 1.0 -->
113
+ </bean>
114
+ </property>
115
+ </bean>
116
+
117
+ Keep in mind that both `AMQPComponent#amqpComponent()` methods and
118
+ `AMQPConnectionDetails` pre-configure the component with the topic
119
+ prefix, so you don’t have to configure it explicitly.
120
+
121
+ ## Component Configurations
122
+
123
+
124
+ |Name|Description|Default|Type|
125
+ |---|---|---|---|
126
+ |clientId|Sets the JMS client ID to use. Note that this value, if specified, must be unique and can only be used by a single JMS connection instance. It is typically only required for durable topic subscriptions with JMS 1.1.||string|
127
+ |connectionFactory|The connection factory to be use. A connection factory must be configured either on the component or endpoint.||object|
128
+ |disableReplyTo|Specifies whether Camel ignores the JMSReplyTo header in messages. If true, Camel does not send a reply back to the destination specified in the JMSReplyTo header. You can use this option if you want Camel to consume from a route and you do not want Camel to automatically send back a reply message because another component in your code handles the reply message. You can also use this option if you want to use Camel as a proxy between different message brokers and you want to route message from one system to another.|false|boolean|
129
+ |durableSubscriptionName|The durable subscriber name for specifying durable topic subscriptions. The clientId option must be configured as well.||string|
130
+ |includeAmqpAnnotations|Whether to include AMQP annotations when mapping from AMQP to Camel Message. Setting this to true maps AMQP message annotations that contain a JMS\_AMQP\_MA\_ prefix to message headers. Due to limitations in Apache Qpid JMS API, currently delivery annotations are ignored.|false|boolean|
131
+ |jmsMessageType|Allows you to force the use of a specific jakarta.jms.Message implementation for sending JMS messages. Possible values are: Bytes, Map, Object, Stream, Text. By default, Camel would determine which JMS message type to use from the In body type. This option allows you to specify it.||object|
132
+ |replyTo|Provides an explicit ReplyTo destination (overrides any incoming value of Message.getJMSReplyTo() in consumer).||string|
133
+ |testConnectionOnStartup|Specifies whether to test the connection on startup. This ensures that when Camel starts that all the JMS consumers have a valid connection to the JMS broker. If a connection cannot be granted then Camel throws an exception on startup. This ensures that Camel is not started with failed connections. The JMS producers is tested as well.|false|boolean|
134
+ |acknowledgementModeName|The JMS acknowledgement name, which is one of: SESSION\_TRANSACTED, CLIENT\_ACKNOWLEDGE, AUTO\_ACKNOWLEDGE, DUPS\_OK\_ACKNOWLEDGE|AUTO\_ACKNOWLEDGE|string|
135
+ |artemisConsumerPriority|Consumer priorities allow you to ensure that high priority consumers receive messages while they are active. Normally, active consumers connected to a queue receive messages from it in a round-robin fashion. When consumer priorities are in use, messages are delivered round-robin if multiple active consumers exist with the same high priority. Messages will only going to lower priority consumers when the high priority consumers do not have credit available to consume the message, or those high priority consumers have declined to accept the message (for instance because it does not meet the criteria of any selectors associated with the consumer).||integer|
136
+ |asyncConsumer|Whether the JmsConsumer processes the Exchange asynchronously. If enabled then the JmsConsumer may pickup the next message from the JMS queue, while the previous message is being processed asynchronously (by the Asynchronous Routing Engine). This means that messages may be processed not 100% strictly in order. If disabled (as default) then the Exchange is fully processed before the JmsConsumer will pickup the next message from the JMS queue. Note if transacted has been enabled, then asyncConsumer=true does not run asynchronously, as transaction must be executed synchronously (Camel 3.0 may support async transactions).|false|boolean|
137
+ |autoStartup|Specifies whether the consumer container should auto-startup.|true|boolean|
138
+ |cacheLevel|Sets the cache level by ID for the underlying JMS resources. See cacheLevelName option for more details.||integer|
139
+ |cacheLevelName|Sets the cache level by name for the underlying JMS resources. Possible values are: CACHE\_AUTO, CACHE\_CONNECTION, CACHE\_CONSUMER, CACHE\_NONE, and CACHE\_SESSION. The default setting is CACHE\_AUTO. See the Spring documentation and Transactions Cache Levels for more information.|CACHE\_AUTO|string|
140
+ |concurrentConsumers|Specifies the default number of concurrent consumers when consuming from JMS (not for request/reply over JMS). See also the maxMessagesPerTask option to control dynamic scaling up/down of threads. When doing request/reply over JMS then the option replyToConcurrentConsumers is used to control number of concurrent consumers on the reply message listener.|1|integer|
141
+ |maxConcurrentConsumers|Specifies the maximum number of concurrent consumers when consuming from JMS (not for request/reply over JMS). See also the maxMessagesPerTask option to control dynamic scaling up/down of threads. When doing request/reply over JMS then the option replyToMaxConcurrentConsumers is used to control number of concurrent consumers on the reply message listener.||integer|
142
+ |replyToDeliveryPersistent|Specifies whether to use persistent delivery by default for replies.|true|boolean|
143
+ |selector|Sets the JMS selector to use||string|
144
+ |subscriptionDurable|Set whether to make the subscription durable. The durable subscription name to be used can be specified through the subscriptionName property. Default is false. Set this to true to register a durable subscription, typically in combination with a subscriptionName value (unless your message listener class name is good enough as subscription name). Only makes sense when listening to a topic (pub-sub domain), therefore this method switches the pubSubDomain flag as well.|false|boolean|
145
+ |subscriptionName|Set the name of a subscription to create. To be applied in case of a topic (pub-sub domain) with a shared or durable subscription. The subscription name needs to be unique within this client's JMS client id. Default is the class name of the specified message listener. Note: Only 1 concurrent consumer (which is the default of this message listener container) is allowed for each subscription, except for a shared subscription (which requires JMS 2.0).||string|
146
+ |subscriptionShared|Set whether to make the subscription shared. The shared subscription name to be used can be specified through the subscriptionName property. Default is false. Set this to true to register a shared subscription, typically in combination with a subscriptionName value (unless your message listener class name is good enough as subscription name). Note that shared subscriptions may also be durable, so this flag can (and often will) be combined with subscriptionDurable as well. Only makes sense when listening to a topic (pub-sub domain), therefore this method switches the pubSubDomain flag as well. Requires a JMS 2.0 compatible message broker.|false|boolean|
147
+ |acceptMessagesWhileStopping|Specifies whether the consumer accept messages while it is stopping. You may consider enabling this option, if you start and stop JMS routes at runtime, while there are still messages enqueued on the queue. If this option is false, and you stop the JMS route, then messages may be rejected, and the JMS broker would have to attempt redeliveries, which yet again may be rejected, and eventually the message may be moved at a dead letter queue on the JMS broker. To avoid this its recommended to enable this option.|false|boolean|
148
+ |allowReplyManagerQuickStop|Whether the DefaultMessageListenerContainer used in the reply managers for request-reply messaging allow the DefaultMessageListenerContainer.runningAllowed flag to quick stop in case JmsConfiguration#isAcceptMessagesWhileStopping is enabled, and org.apache.camel.CamelContext is currently being stopped. This quick stop ability is enabled by default in the regular JMS consumers but to enable for reply managers you must enable this flag.|false|boolean|
149
+ |consumerType|The consumer type to use, which can be one of: Simple, Default, or Custom. The consumer type determines which Spring JMS listener to use. Default will use org.springframework.jms.listener.DefaultMessageListenerContainer, Simple will use org.springframework.jms.listener.SimpleMessageListenerContainer. When Custom is specified, the MessageListenerContainerFactory defined by the messageListenerContainerFactory option will determine what org.springframework.jms.listener.AbstractMessageListenerContainer to use.|Default|object|
150
+ |defaultTaskExecutorType|Specifies what default TaskExecutor type to use in the DefaultMessageListenerContainer, for both consumer endpoints and the ReplyTo consumer of producer endpoints. Possible values: SimpleAsync (uses Spring's SimpleAsyncTaskExecutor) or ThreadPool (uses Spring's ThreadPoolTaskExecutor with optimal values - cached thread-pool-like). If not set, it defaults to the previous behaviour, which uses a cached thread pool for consumer endpoints and SimpleAsync for reply consumers. The use of ThreadPool is recommended to reduce thread trash in elastic configurations with dynamically increasing and decreasing concurrent consumers.||object|
151
+ |eagerLoadingOfProperties|Enables eager loading of JMS properties and payload as soon as a message is loaded which generally is inefficient as the JMS properties may not be required but sometimes can catch early any issues with the underlying JMS provider and the use of JMS properties. See also the option eagerPoisonBody.|false|boolean|
152
+ |eagerPoisonBody|If eagerLoadingOfProperties is enabled and the JMS message payload (JMS body or JMS properties) is poison (cannot be read/mapped), then set this text as the message body instead so the message can be processed (the cause of the poison are already stored as exception on the Exchange). This can be turned off by setting eagerPoisonBody=false. See also the option eagerLoadingOfProperties.|Poison JMS message due to ${exception.message}|string|
153
+ |exposeListenerSession|Specifies whether the listener session should be exposed when consuming messages.|false|boolean|
154
+ |replyToConsumerType|The consumer type of the reply consumer (when doing request/reply), which can be one of: Simple, Default, or Custom. The consumer type determines which Spring JMS listener to use. Default will use org.springframework.jms.listener.DefaultMessageListenerContainer, Simple will use org.springframework.jms.listener.SimpleMessageListenerContainer. When Custom is specified, the MessageListenerContainerFactory defined by the messageListenerContainerFactory option will determine what org.springframework.jms.listener.AbstractMessageListenerContainer to use.|Default|object|
155
+ |replyToSameDestinationAllowed|Whether a JMS consumer is allowed to send a reply message to the same destination that the consumer is using to consume from. This prevents an endless loop by consuming and sending back the same message to itself.|false|boolean|
156
+ |taskExecutor|Allows you to specify a custom task executor for consuming messages.||object|
157
+ |deliveryDelay|Sets delivery delay to use for send calls for JMS. This option requires JMS 2.0 compliant broker.|-1|integer|
158
+ |deliveryMode|Specifies the delivery mode to be used. Possible values are those defined by jakarta.jms.DeliveryMode. NON\_PERSISTENT = 1 and PERSISTENT = 2.||integer|
159
+ |deliveryPersistent|Specifies whether persistent delivery is used by default.|true|boolean|
160
+ |explicitQosEnabled|Set if the deliveryMode, priority or timeToLive qualities of service should be used when sending messages. This option is based on Spring's JmsTemplate. The deliveryMode, priority and timeToLive options are applied to the current endpoint. This contrasts with the preserveMessageQos option, which operates at message granularity, reading QoS properties exclusively from the Camel In message headers.|false|boolean|
161
+ |formatDateHeadersToIso8601|Sets whether JMS date properties should be formatted according to the ISO 8601 standard.|false|boolean|
162
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
163
+ |preserveMessageQos|Set to true, if you want to send message using the QoS settings specified on the message, instead of the QoS settings on the JMS endpoint. The following three headers are considered JMSPriority, JMSDeliveryMode, and JMSExpiration. You can provide all or only some of them. If not provided, Camel will fall back to use the values from the endpoint instead. So, when using this option, the headers override the values from the endpoint. The explicitQosEnabled option, by contrast, will only use options set on the endpoint, and not values from the message header.|false|boolean|
164
+ |priority|Values greater than 1 specify the message priority when sending (where 1 is the lowest priority and 9 is the highest). The explicitQosEnabled option must also be enabled in order for this option to have any effect.|4|integer|
165
+ |replyToConcurrentConsumers|Specifies the default number of concurrent consumers when doing request/reply over JMS. See also the maxMessagesPerTask option to control dynamic scaling up/down of threads.|1|integer|
166
+ |replyToMaxConcurrentConsumers|Specifies the maximum number of concurrent consumers when using request/reply over JMS. See also the maxMessagesPerTask option to control dynamic scaling up/down of threads.||integer|
167
+ |replyToOnTimeoutMaxConcurrentConsumers|Specifies the maximum number of concurrent consumers for continue routing when timeout occurred when using request/reply over JMS.|1|integer|
168
+ |replyToOverride|Provides an explicit ReplyTo destination in the JMS message, which overrides the setting of replyTo. It is useful if you want to forward the message to a remote Queue and receive the reply message from the ReplyTo destination.||string|
169
+ |replyToType|Allows for explicitly specifying which kind of strategy to use for replyTo queues when doing request/reply over JMS. Possible values are: Temporary, Shared, or Exclusive. By default Camel will use temporary queues. However if replyTo has been configured, then Shared is used by default. This option allows you to use exclusive queues instead of shared ones. See Camel JMS documentation for more details, and especially the notes about the implications if running in a clustered environment, and the fact that Shared reply queues has lower performance than its alternatives Temporary and Exclusive.||object|
170
+ |requestTimeout|The timeout for waiting for a reply when using the InOut Exchange Pattern (in milliseconds). The default is 20 seconds. You can include the header CamelJmsRequestTimeout to override this endpoint configured timeout value, and thus have per message individual timeout values. See also the requestTimeoutCheckerInterval option.|20000|duration|
171
+ |timeToLive|When sending messages, specifies the time-to-live of the message (in milliseconds).|-1|integer|
172
+ |allowAdditionalHeaders|This option is used to allow additional headers which may have values that are invalid according to JMS specification. For example, some message systems, such as WMQ, do this with header names using prefix JMS\_IBM\_MQMD\_ containing values with byte array or other invalid types. You can specify multiple header names separated by comma, and use as suffix for wildcard matching.||string|
173
+ |allowNullBody|Whether to allow sending messages with no body. If this option is false and the message body is null, then an JMSException is thrown.|true|boolean|
174
+ |alwaysCopyMessage|If true, Camel will always make a JMS message copy of the message when it is passed to the producer for sending. Copying the message is needed in some situations, such as when a replyToDestinationSelectorName is set (incidentally, Camel will set the alwaysCopyMessage option to true, if a replyToDestinationSelectorName is set)|false|boolean|
175
+ |correlationProperty|When using InOut exchange pattern use this JMS property instead of JMSCorrelationID JMS property to correlate messages. If set messages will be correlated solely on the value of this property JMSCorrelationID property will be ignored and not set by Camel.||string|
176
+ |disableTimeToLive|Use this option to force disabling time to live. For example when you do request/reply over JMS, then Camel will by default use the requestTimeout value as time to live on the message being sent. The problem is that the sender and receiver systems have to have their clocks synchronized, so they are in sync. This is not always so easy to archive. So you can use disableTimeToLive=true to not set a time to live value on the sent message. Then the message will not expire on the receiver system. See below in section About time to live for more details.|false|boolean|
177
+ |forceSendOriginalMessage|When using mapJmsMessage=false Camel will create a new JMS message to send to a new JMS destination if you touch the headers (get or set) during the route. Set this option to true to force Camel to send the original JMS message that was received.|false|boolean|
178
+ |includeSentJMSMessageID|Only applicable when sending to JMS destination using InOnly (eg fire and forget). Enabling this option will enrich the Camel Exchange with the actual JMSMessageID that was used by the JMS client when the message was sent to the JMS destination.|false|boolean|
179
+ |replyToCacheLevelName|Sets the cache level by name for the reply consumer when doing request/reply over JMS. This option only applies when using fixed reply queues (not temporary). Camel will by default use: CACHE\_CONSUMER for exclusive or shared w/ replyToSelectorName. And CACHE\_SESSION for shared without replyToSelectorName. Some JMS brokers such as IBM WebSphere may require to set the replyToCacheLevelName=CACHE\_NONE to work. Note: If using temporary queues then CACHE\_NONE is not allowed, and you must use a higher value such as CACHE\_CONSUMER or CACHE\_SESSION.||string|
180
+ |replyToDestinationSelectorName|Sets the JMS Selector using the fixed name to be used so you can filter out your own replies from the others when using a shared queue (that is, if you are not using a temporary reply queue).||string|
181
+ |streamMessageTypeEnabled|Sets whether StreamMessage type is enabled or not. Message payloads of streaming kind such as files, InputStream, etc will either by sent as BytesMessage or StreamMessage. This option controls which kind will be used. By default BytesMessage is used which enforces the entire message payload to be read into memory. By enabling this option the message payload is read into memory in chunks and each chunk is then written to the StreamMessage until no more data.|false|boolean|
182
+ |allowAutoWiredConnectionFactory|Whether to auto-discover ConnectionFactory from the registry, if no connection factory has been configured. If only one instance of ConnectionFactory is found then it will be used. This is enabled by default.|true|boolean|
183
+ |allowAutoWiredDestinationResolver|Whether to auto-discover DestinationResolver from the registry, if no destination resolver has been configured. If only one instance of DestinationResolver is found then it will be used. This is enabled by default.|true|boolean|
184
+ |allowSerializedHeaders|Controls whether or not to include serialized headers. Applies only when transferExchange is true. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level.|false|boolean|
185
+ |artemisStreamingEnabled|Whether optimizing for Apache Artemis streaming mode. This can reduce memory overhead when using Artemis with JMS StreamMessage types. This option must only be enabled if Apache Artemis is being used.|false|boolean|
186
+ |asyncStartListener|Whether to startup the JmsConsumer message listener asynchronously, when starting a route. For example if a JmsConsumer cannot get a connection to a remote JMS broker, then it may block while retrying and/or fail-over. This will cause Camel to block while starting routes. By setting this option to true, you will let routes startup, while the JmsConsumer connects to the JMS broker using a dedicated thread in asynchronous mode. If this option is used, then beware that if the connection could not be established, then an exception is logged at WARN level, and the consumer will not be able to receive messages; You can then restart the route to retry.|false|boolean|
187
+ |asyncStopListener|Whether to stop the JmsConsumer message listener asynchronously, when stopping a route.|false|boolean|
188
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
189
+ |configuration|To use a shared JMS configuration||object|
190
+ |destinationResolver|A pluggable org.springframework.jms.support.destination.DestinationResolver that allows you to use your own resolver (for example, to lookup the real destination in a JNDI registry).||object|
191
+ |errorHandler|Specifies a org.springframework.util.ErrorHandler to be invoked in case of any uncaught exceptions thrown while processing a Message. By default these exceptions will be logged at the WARN level, if no errorHandler has been configured. You can configure logging level and whether stack traces should be logged using errorHandlerLoggingLevel and errorHandlerLogStackTrace options. This makes it much easier to configure, than having to code a custom errorHandler.||object|
192
+ |exceptionListener|Specifies the JMS Exception Listener that is to be notified of any underlying JMS exceptions.||object|
193
+ |idleConsumerLimit|Specify the limit for the number of consumers that are allowed to be idle at any given time.|1|integer|
194
+ |idleTaskExecutionLimit|Specifies the limit for idle executions of a receive task, not having received any message within its execution. If this limit is reached, the task will shut down and leave receiving to other executing tasks (in the case of dynamic scheduling; see the maxConcurrentConsumers setting). There is additional doc available from Spring.|1|integer|
195
+ |includeAllJMSXProperties|Whether to include all JMSX prefixed properties when mapping from JMS to Camel Message. Setting this to true will include properties such as JMSXAppID, and JMSXUserID etc. Note: If you are using a custom headerFilterStrategy then this option does not apply.|false|boolean|
196
+ |includeCorrelationIDAsBytes|Whether the JMS consumer should include JMSCorrelationIDAsBytes as a header on the Camel Message.|true|boolean|
197
+ |jmsKeyFormatStrategy|Pluggable strategy for encoding and decoding JMS keys so they can be compliant with the JMS specification. Camel provides two implementations out of the box: default and passthrough. The default strategy will safely marshal dots and hyphens (. and -). The passthrough strategy leaves the key as is. Can be used for JMS brokers which do not care whether JMS header keys contain illegal characters. You can provide your own implementation of the org.apache.camel.component.jms.JmsKeyFormatStrategy and refer to it using the # notation.||object|
198
+ |mapJmsMessage|Specifies whether Camel should auto map the received JMS message to a suited payload type, such as jakarta.jms.TextMessage to a String etc.|true|boolean|
199
+ |maxMessagesPerTask|The number of messages per task. -1 is unlimited. If you use a range for concurrent consumers (eg min max), then this option can be used to set a value to eg 100 to control how fast the consumers will shrink when less work is required.|-1|integer|
200
+ |messageConverter|To use a custom Spring org.springframework.jms.support.converter.MessageConverter so you can be in control how to map to/from a jakarta.jms.Message.||object|
201
+ |messageCreatedStrategy|To use the given MessageCreatedStrategy which are invoked when Camel creates new instances of jakarta.jms.Message objects when Camel is sending a JMS message.||object|
202
+ |messageIdEnabled|When sending, specifies whether message IDs should be added. This is just an hint to the JMS broker. If the JMS provider accepts this hint, these messages must have the message ID set to null; if the provider ignores the hint, the message ID must be set to its normal unique value.|true|boolean|
203
+ |messageListenerContainerFactory|Registry ID of the MessageListenerContainerFactory used to determine what org.springframework.jms.listener.AbstractMessageListenerContainer to use to consume messages. Setting this will automatically set consumerType to Custom.||object|
204
+ |messageTimestampEnabled|Specifies whether timestamps should be enabled by default on sending messages. This is just an hint to the JMS broker. If the JMS provider accepts this hint, these messages must have the timestamp set to zero; if the provider ignores the hint the timestamp must be set to its normal value.|true|boolean|
205
+ |pubSubNoLocal|Specifies whether to inhibit the delivery of messages published by its own connection.|false|boolean|
206
+ |queueBrowseStrategy|To use a custom QueueBrowseStrategy when browsing queues||object|
207
+ |receiveTimeout|The timeout for receiving messages (in milliseconds).|1000|duration|
208
+ |recoveryInterval|Specifies the interval between recovery attempts, i.e. when a connection is being refreshed, in milliseconds. The default is 5000 ms, that is, 5 seconds.|5000|duration|
209
+ |requestTimeoutCheckerInterval|Configures how often Camel should check for timed out Exchanges when doing request/reply over JMS. By default Camel checks once per second. But if you must react faster when a timeout occurs, then you can lower this interval, to check more frequently. The timeout is determined by the option requestTimeout.|1000|duration|
210
+ |serviceLocationEnabled|Whether to detect the network address location of the JMS broker on startup. This information is gathered via reflection on the ConnectionFactory, and is vendor specific. This option can be used to turn this off.|true|boolean|
211
+ |synchronous|Sets whether synchronous processing should be strictly used|false|boolean|
212
+ |temporaryQueueResolver|A pluggable TemporaryQueueResolver that allows you to use your own resolver for creating temporary queues (some messaging systems has special requirements for creating temporary queues).||object|
213
+ |transferException|If enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the consumer side, then the caused Exception will be send back in response as a jakarta.jms.ObjectMessage. If the client is Camel, the returned Exception is rethrown. This allows you to use Camel JMS as a bridge in your routing - for example, using persistent queues to enable robust routing. Notice that if you also have transferExchange enabled, this option takes precedence. The caught exception is required to be serializable. The original Exception on the consumer side can be wrapped in an outer exception such as org.apache.camel.RuntimeCamelException when returned to the producer. Use this with caution as the data is using Java Object serialization and requires the received to be able to deserialize the data at Class level, which forces a strong coupling between the producers and consumer!|false|boolean|
214
+ |transferExchange|You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an Exchange and not a regular payload. Use this with caution as the data is using Java Object serialization and requires the receiver to be able to deserialize the data at Class level, which forces a strong coupling between the producers and consumers having to use compatible Camel versions!|false|boolean|
215
+ |useMessageIDAsCorrelationID|Specifies whether JMSMessageID should always be used as JMSCorrelationID for InOut messages.|false|boolean|
216
+ |waitForProvisionCorrelationToBeUpdatedCounter|Number of times to wait for provisional correlation id to be updated to the actual correlation id when doing request/reply over JMS and when the option useMessageIDAsCorrelationID is enabled.|50|integer|
217
+ |waitForProvisionCorrelationToBeUpdatedThreadSleepingTime|Interval in millis to sleep each time while waiting for provisional correlation id to be updated.|100|duration|
218
+ |waitForTemporaryReplyToToBeUpdatedCounter|Number of times to wait for temporary replyTo queue to be created and ready when doing request/reply over JMS.|200|integer|
219
+ |waitForTemporaryReplyToToBeUpdatedThreadSleepingTime|Interval in millis to sleep each time while waiting for temporary replyTo queue to be ready.|100|duration|
220
+ |headerFilterStrategy|To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message.||object|
221
+ |errorHandlerLoggingLevel|Allows to configure the default errorHandler logging level for logging uncaught exceptions.|WARN|object|
222
+ |errorHandlerLogStackTrace|Allows to control whether stack-traces should be logged or not, by the default errorHandler.|true|boolean|
223
+ |password|Password to use with the ConnectionFactory. You can also configure username/password directly on the ConnectionFactory.||string|
224
+ |username|Username to use with the ConnectionFactory. You can also configure username/password directly on the ConnectionFactory.||string|
225
+ |transacted|Specifies whether to use transacted mode|false|boolean|
226
+ |transactedInOut|Specifies whether InOut operations (request reply) default to using transacted mode If this flag is set to true, then Spring JmsTemplate will have sessionTransacted set to true, and the acknowledgeMode as transacted on the JmsTemplate used for InOut operations. Note from Spring JMS: that within a JTA transaction, the parameters passed to createQueue, createTopic methods are not taken into account. Depending on the Java EE transaction context, the container makes its own decisions on these values. Analogously, these parameters are not taken into account within a locally managed transaction either, since Spring JMS operates on an existing JMS Session in this case. Setting this flag to true will use a short local JMS transaction when running outside of a managed transaction, and a synchronized local JMS transaction in case of a managed transaction (other than an XA transaction) being present. This has the effect of a local JMS transaction being managed alongside the main transaction (which might be a native JDBC transaction), with the JMS transaction committing right after the main transaction.|false|boolean|
227
+ |lazyCreateTransactionManager|If true, Camel will create a JmsTransactionManager, if there is no transactionManager injected when option transacted=true.|true|boolean|
228
+ |transactionManager|The Spring transaction manager to use.||object|
229
+ |transactionName|The name of the transaction to use.||string|
230
+ |transactionTimeout|The timeout value of the transaction (in seconds), if using transacted mode.|-1|integer|
231
+
232
+ ## Endpoint Configurations
233
+
234
+
235
+ |Name|Description|Default|Type|
236
+ |---|---|---|---|
237
+ |destinationType|The kind of destination to use|queue|string|
238
+ |destinationName|Name of the queue or topic to use as destination||string|
239
+ |clientId|Sets the JMS client ID to use. Note that this value, if specified, must be unique and can only be used by a single JMS connection instance. It is typically only required for durable topic subscriptions with JMS 1.1.||string|
240
+ |connectionFactory|The connection factory to be use. A connection factory must be configured either on the component or endpoint.||object|
241
+ |disableReplyTo|Specifies whether Camel ignores the JMSReplyTo header in messages. If true, Camel does not send a reply back to the destination specified in the JMSReplyTo header. You can use this option if you want Camel to consume from a route and you do not want Camel to automatically send back a reply message because another component in your code handles the reply message. You can also use this option if you want to use Camel as a proxy between different message brokers and you want to route message from one system to another.|false|boolean|
242
+ |durableSubscriptionName|The durable subscriber name for specifying durable topic subscriptions. The clientId option must be configured as well.||string|
243
+ |jmsMessageType|Allows you to force the use of a specific jakarta.jms.Message implementation for sending JMS messages. Possible values are: Bytes, Map, Object, Stream, Text. By default, Camel would determine which JMS message type to use from the In body type. This option allows you to specify it.||object|
244
+ |replyTo|Provides an explicit ReplyTo destination (overrides any incoming value of Message.getJMSReplyTo() in consumer).||string|
245
+ |testConnectionOnStartup|Specifies whether to test the connection on startup. This ensures that when Camel starts that all the JMS consumers have a valid connection to the JMS broker. If a connection cannot be granted then Camel throws an exception on startup. This ensures that Camel is not started with failed connections. The JMS producers is tested as well.|false|boolean|
246
+ |acknowledgementModeName|The JMS acknowledgement name, which is one of: SESSION\_TRANSACTED, CLIENT\_ACKNOWLEDGE, AUTO\_ACKNOWLEDGE, DUPS\_OK\_ACKNOWLEDGE|AUTO\_ACKNOWLEDGE|string|
247
+ |artemisConsumerPriority|Consumer priorities allow you to ensure that high priority consumers receive messages while they are active. Normally, active consumers connected to a queue receive messages from it in a round-robin fashion. When consumer priorities are in use, messages are delivered round-robin if multiple active consumers exist with the same high priority. Messages will only going to lower priority consumers when the high priority consumers do not have credit available to consume the message, or those high priority consumers have declined to accept the message (for instance because it does not meet the criteria of any selectors associated with the consumer).||integer|
248
+ |asyncConsumer|Whether the JmsConsumer processes the Exchange asynchronously. If enabled then the JmsConsumer may pickup the next message from the JMS queue, while the previous message is being processed asynchronously (by the Asynchronous Routing Engine). This means that messages may be processed not 100% strictly in order. If disabled (as default) then the Exchange is fully processed before the JmsConsumer will pickup the next message from the JMS queue. Note if transacted has been enabled, then asyncConsumer=true does not run asynchronously, as transaction must be executed synchronously (Camel 3.0 may support async transactions).|false|boolean|
249
+ |autoStartup|Specifies whether the consumer container should auto-startup.|true|boolean|
250
+ |cacheLevel|Sets the cache level by ID for the underlying JMS resources. See cacheLevelName option for more details.||integer|
251
+ |cacheLevelName|Sets the cache level by name for the underlying JMS resources. Possible values are: CACHE\_AUTO, CACHE\_CONNECTION, CACHE\_CONSUMER, CACHE\_NONE, and CACHE\_SESSION. The default setting is CACHE\_AUTO. See the Spring documentation and Transactions Cache Levels for more information.|CACHE\_AUTO|string|
252
+ |concurrentConsumers|Specifies the default number of concurrent consumers when consuming from JMS (not for request/reply over JMS). See also the maxMessagesPerTask option to control dynamic scaling up/down of threads. When doing request/reply over JMS then the option replyToConcurrentConsumers is used to control number of concurrent consumers on the reply message listener.|1|integer|
253
+ |maxConcurrentConsumers|Specifies the maximum number of concurrent consumers when consuming from JMS (not for request/reply over JMS). See also the maxMessagesPerTask option to control dynamic scaling up/down of threads. When doing request/reply over JMS then the option replyToMaxConcurrentConsumers is used to control number of concurrent consumers on the reply message listener.||integer|
254
+ |replyToDeliveryPersistent|Specifies whether to use persistent delivery by default for replies.|true|boolean|
255
+ |selector|Sets the JMS selector to use||string|
256
+ |subscriptionDurable|Set whether to make the subscription durable. The durable subscription name to be used can be specified through the subscriptionName property. Default is false. Set this to true to register a durable subscription, typically in combination with a subscriptionName value (unless your message listener class name is good enough as subscription name). Only makes sense when listening to a topic (pub-sub domain), therefore this method switches the pubSubDomain flag as well.|false|boolean|
257
+ |subscriptionName|Set the name of a subscription to create. To be applied in case of a topic (pub-sub domain) with a shared or durable subscription. The subscription name needs to be unique within this client's JMS client id. Default is the class name of the specified message listener. Note: Only 1 concurrent consumer (which is the default of this message listener container) is allowed for each subscription, except for a shared subscription (which requires JMS 2.0).||string|
258
+ |subscriptionShared|Set whether to make the subscription shared. The shared subscription name to be used can be specified through the subscriptionName property. Default is false. Set this to true to register a shared subscription, typically in combination with a subscriptionName value (unless your message listener class name is good enough as subscription name). Note that shared subscriptions may also be durable, so this flag can (and often will) be combined with subscriptionDurable as well. Only makes sense when listening to a topic (pub-sub domain), therefore this method switches the pubSubDomain flag as well. Requires a JMS 2.0 compatible message broker.|false|boolean|
259
+ |acceptMessagesWhileStopping|Specifies whether the consumer accept messages while it is stopping. You may consider enabling this option, if you start and stop JMS routes at runtime, while there are still messages enqueued on the queue. If this option is false, and you stop the JMS route, then messages may be rejected, and the JMS broker would have to attempt redeliveries, which yet again may be rejected, and eventually the message may be moved at a dead letter queue on the JMS broker. To avoid this its recommended to enable this option.|false|boolean|
260
+ |allowReplyManagerQuickStop|Whether the DefaultMessageListenerContainer used in the reply managers for request-reply messaging allow the DefaultMessageListenerContainer.runningAllowed flag to quick stop in case JmsConfiguration#isAcceptMessagesWhileStopping is enabled, and org.apache.camel.CamelContext is currently being stopped. This quick stop ability is enabled by default in the regular JMS consumers but to enable for reply managers you must enable this flag.|false|boolean|
261
+ |consumerType|The consumer type to use, which can be one of: Simple, Default, or Custom. The consumer type determines which Spring JMS listener to use. Default will use org.springframework.jms.listener.DefaultMessageListenerContainer, Simple will use org.springframework.jms.listener.SimpleMessageListenerContainer. When Custom is specified, the MessageListenerContainerFactory defined by the messageListenerContainerFactory option will determine what org.springframework.jms.listener.AbstractMessageListenerContainer to use.|Default|object|
262
+ |defaultTaskExecutorType|Specifies what default TaskExecutor type to use in the DefaultMessageListenerContainer, for both consumer endpoints and the ReplyTo consumer of producer endpoints. Possible values: SimpleAsync (uses Spring's SimpleAsyncTaskExecutor) or ThreadPool (uses Spring's ThreadPoolTaskExecutor with optimal values - cached thread-pool-like). If not set, it defaults to the previous behaviour, which uses a cached thread pool for consumer endpoints and SimpleAsync for reply consumers. The use of ThreadPool is recommended to reduce thread trash in elastic configurations with dynamically increasing and decreasing concurrent consumers.||object|
263
+ |eagerLoadingOfProperties|Enables eager loading of JMS properties and payload as soon as a message is loaded which generally is inefficient as the JMS properties may not be required but sometimes can catch early any issues with the underlying JMS provider and the use of JMS properties. See also the option eagerPoisonBody.|false|boolean|
264
+ |eagerPoisonBody|If eagerLoadingOfProperties is enabled and the JMS message payload (JMS body or JMS properties) is poison (cannot be read/mapped), then set this text as the message body instead so the message can be processed (the cause of the poison are already stored as exception on the Exchange). This can be turned off by setting eagerPoisonBody=false. See also the option eagerLoadingOfProperties.|Poison JMS message due to ${exception.message}|string|
265
+ |exceptionHandler|To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.||object|
266
+ |exchangePattern|Sets the exchange pattern when the consumer creates an exchange.||object|
267
+ |exposeListenerSession|Specifies whether the listener session should be exposed when consuming messages.|false|boolean|
268
+ |replyToConsumerType|The consumer type of the reply consumer (when doing request/reply), which can be one of: Simple, Default, or Custom. The consumer type determines which Spring JMS listener to use. Default will use org.springframework.jms.listener.DefaultMessageListenerContainer, Simple will use org.springframework.jms.listener.SimpleMessageListenerContainer. When Custom is specified, the MessageListenerContainerFactory defined by the messageListenerContainerFactory option will determine what org.springframework.jms.listener.AbstractMessageListenerContainer to use.|Default|object|
269
+ |replyToSameDestinationAllowed|Whether a JMS consumer is allowed to send a reply message to the same destination that the consumer is using to consume from. This prevents an endless loop by consuming and sending back the same message to itself.|false|boolean|
270
+ |taskExecutor|Allows you to specify a custom task executor for consuming messages.||object|
271
+ |deliveryDelay|Sets delivery delay to use for send calls for JMS. This option requires JMS 2.0 compliant broker.|-1|integer|
272
+ |deliveryMode|Specifies the delivery mode to be used. Possible values are those defined by jakarta.jms.DeliveryMode. NON\_PERSISTENT = 1 and PERSISTENT = 2.||integer|
273
+ |deliveryPersistent|Specifies whether persistent delivery is used by default.|true|boolean|
274
+ |explicitQosEnabled|Set if the deliveryMode, priority or timeToLive qualities of service should be used when sending messages. This option is based on Spring's JmsTemplate. The deliveryMode, priority and timeToLive options are applied to the current endpoint. This contrasts with the preserveMessageQos option, which operates at message granularity, reading QoS properties exclusively from the Camel In message headers.|false|boolean|
275
+ |formatDateHeadersToIso8601|Sets whether JMS date properties should be formatted according to the ISO 8601 standard.|false|boolean|
276
+ |preserveMessageQos|Set to true, if you want to send message using the QoS settings specified on the message, instead of the QoS settings on the JMS endpoint. The following three headers are considered JMSPriority, JMSDeliveryMode, and JMSExpiration. You can provide all or only some of them. If not provided, Camel will fall back to use the values from the endpoint instead. So, when using this option, the headers override the values from the endpoint. The explicitQosEnabled option, by contrast, will only use options set on the endpoint, and not values from the message header.|false|boolean|
277
+ |priority|Values greater than 1 specify the message priority when sending (where 1 is the lowest priority and 9 is the highest). The explicitQosEnabled option must also be enabled in order for this option to have any effect.|4|integer|
278
+ |replyToConcurrentConsumers|Specifies the default number of concurrent consumers when doing request/reply over JMS. See also the maxMessagesPerTask option to control dynamic scaling up/down of threads.|1|integer|
279
+ |replyToMaxConcurrentConsumers|Specifies the maximum number of concurrent consumers when using request/reply over JMS. See also the maxMessagesPerTask option to control dynamic scaling up/down of threads.||integer|
280
+ |replyToOnTimeoutMaxConcurrentConsumers|Specifies the maximum number of concurrent consumers for continue routing when timeout occurred when using request/reply over JMS.|1|integer|
281
+ |replyToOverride|Provides an explicit ReplyTo destination in the JMS message, which overrides the setting of replyTo. It is useful if you want to forward the message to a remote Queue and receive the reply message from the ReplyTo destination.||string|
282
+ |replyToType|Allows for explicitly specifying which kind of strategy to use for replyTo queues when doing request/reply over JMS. Possible values are: Temporary, Shared, or Exclusive. By default Camel will use temporary queues. However if replyTo has been configured, then Shared is used by default. This option allows you to use exclusive queues instead of shared ones. See Camel JMS documentation for more details, and especially the notes about the implications if running in a clustered environment, and the fact that Shared reply queues has lower performance than its alternatives Temporary and Exclusive.||object|
283
+ |requestTimeout|The timeout for waiting for a reply when using the InOut Exchange Pattern (in milliseconds). The default is 20 seconds. You can include the header CamelJmsRequestTimeout to override this endpoint configured timeout value, and thus have per message individual timeout values. See also the requestTimeoutCheckerInterval option.|20000|duration|
284
+ |timeToLive|When sending messages, specifies the time-to-live of the message (in milliseconds).|-1|integer|
285
+ |allowAdditionalHeaders|This option is used to allow additional headers which may have values that are invalid according to JMS specification. For example, some message systems, such as WMQ, do this with header names using prefix JMS\_IBM\_MQMD\_ containing values with byte array or other invalid types. You can specify multiple header names separated by comma, and use as suffix for wildcard matching.||string|
286
+ |allowNullBody|Whether to allow sending messages with no body. If this option is false and the message body is null, then an JMSException is thrown.|true|boolean|
287
+ |alwaysCopyMessage|If true, Camel will always make a JMS message copy of the message when it is passed to the producer for sending. Copying the message is needed in some situations, such as when a replyToDestinationSelectorName is set (incidentally, Camel will set the alwaysCopyMessage option to true, if a replyToDestinationSelectorName is set)|false|boolean|
288
+ |correlationProperty|When using InOut exchange pattern use this JMS property instead of JMSCorrelationID JMS property to correlate messages. If set messages will be correlated solely on the value of this property JMSCorrelationID property will be ignored and not set by Camel.||string|
289
+ |disableTimeToLive|Use this option to force disabling time to live. For example when you do request/reply over JMS, then Camel will by default use the requestTimeout value as time to live on the message being sent. The problem is that the sender and receiver systems have to have their clocks synchronized, so they are in sync. This is not always so easy to archive. So you can use disableTimeToLive=true to not set a time to live value on the sent message. Then the message will not expire on the receiver system. See below in section About time to live for more details.|false|boolean|
290
+ |forceSendOriginalMessage|When using mapJmsMessage=false Camel will create a new JMS message to send to a new JMS destination if you touch the headers (get or set) during the route. Set this option to true to force Camel to send the original JMS message that was received.|false|boolean|
291
+ |includeSentJMSMessageID|Only applicable when sending to JMS destination using InOnly (eg fire and forget). Enabling this option will enrich the Camel Exchange with the actual JMSMessageID that was used by the JMS client when the message was sent to the JMS destination.|false|boolean|
292
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
293
+ |replyToCacheLevelName|Sets the cache level by name for the reply consumer when doing request/reply over JMS. This option only applies when using fixed reply queues (not temporary). Camel will by default use: CACHE\_CONSUMER for exclusive or shared w/ replyToSelectorName. And CACHE\_SESSION for shared without replyToSelectorName. Some JMS brokers such as IBM WebSphere may require to set the replyToCacheLevelName=CACHE\_NONE to work. Note: If using temporary queues then CACHE\_NONE is not allowed, and you must use a higher value such as CACHE\_CONSUMER or CACHE\_SESSION.||string|
294
+ |replyToDestinationSelectorName|Sets the JMS Selector using the fixed name to be used so you can filter out your own replies from the others when using a shared queue (that is, if you are not using a temporary reply queue).||string|
295
+ |streamMessageTypeEnabled|Sets whether StreamMessage type is enabled or not. Message payloads of streaming kind such as files, InputStream, etc will either by sent as BytesMessage or StreamMessage. This option controls which kind will be used. By default BytesMessage is used which enforces the entire message payload to be read into memory. By enabling this option the message payload is read into memory in chunks and each chunk is then written to the StreamMessage until no more data.|false|boolean|
296
+ |allowSerializedHeaders|Controls whether or not to include serialized headers. Applies only when transferExchange is true. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level.|false|boolean|
297
+ |artemisStreamingEnabled|Whether optimizing for Apache Artemis streaming mode. This can reduce memory overhead when using Artemis with JMS StreamMessage types. This option must only be enabled if Apache Artemis is being used.|false|boolean|
298
+ |asyncStartListener|Whether to startup the JmsConsumer message listener asynchronously, when starting a route. For example if a JmsConsumer cannot get a connection to a remote JMS broker, then it may block while retrying and/or fail-over. This will cause Camel to block while starting routes. By setting this option to true, you will let routes startup, while the JmsConsumer connects to the JMS broker using a dedicated thread in asynchronous mode. If this option is used, then beware that if the connection could not be established, then an exception is logged at WARN level, and the consumer will not be able to receive messages; You can then restart the route to retry.|false|boolean|
299
+ |asyncStopListener|Whether to stop the JmsConsumer message listener asynchronously, when stopping a route.|false|boolean|
300
+ |destinationResolver|A pluggable org.springframework.jms.support.destination.DestinationResolver that allows you to use your own resolver (for example, to lookup the real destination in a JNDI registry).||object|
301
+ |errorHandler|Specifies a org.springframework.util.ErrorHandler to be invoked in case of any uncaught exceptions thrown while processing a Message. By default these exceptions will be logged at the WARN level, if no errorHandler has been configured. You can configure logging level and whether stack traces should be logged using errorHandlerLoggingLevel and errorHandlerLogStackTrace options. This makes it much easier to configure, than having to code a custom errorHandler.||object|
302
+ |exceptionListener|Specifies the JMS Exception Listener that is to be notified of any underlying JMS exceptions.||object|
303
+ |headerFilterStrategy|To use a custom HeaderFilterStrategy to filter header to and from Camel message.||object|
304
+ |idleConsumerLimit|Specify the limit for the number of consumers that are allowed to be idle at any given time.|1|integer|
305
+ |idleTaskExecutionLimit|Specifies the limit for idle executions of a receive task, not having received any message within its execution. If this limit is reached, the task will shut down and leave receiving to other executing tasks (in the case of dynamic scheduling; see the maxConcurrentConsumers setting). There is additional doc available from Spring.|1|integer|
306
+ |includeAllJMSXProperties|Whether to include all JMSX prefixed properties when mapping from JMS to Camel Message. Setting this to true will include properties such as JMSXAppID, and JMSXUserID etc. Note: If you are using a custom headerFilterStrategy then this option does not apply.|false|boolean|
307
+ |jmsKeyFormatStrategy|Pluggable strategy for encoding and decoding JMS keys so they can be compliant with the JMS specification. Camel provides two implementations out of the box: default and passthrough. The default strategy will safely marshal dots and hyphens (. and -). The passthrough strategy leaves the key as is. Can be used for JMS brokers which do not care whether JMS header keys contain illegal characters. You can provide your own implementation of the org.apache.camel.component.jms.JmsKeyFormatStrategy and refer to it using the # notation.||object|
308
+ |mapJmsMessage|Specifies whether Camel should auto map the received JMS message to a suited payload type, such as jakarta.jms.TextMessage to a String etc.|true|boolean|
309
+ |maxMessagesPerTask|The number of messages per task. -1 is unlimited. If you use a range for concurrent consumers (eg min max), then this option can be used to set a value to eg 100 to control how fast the consumers will shrink when less work is required.|-1|integer|
310
+ |messageConverter|To use a custom Spring org.springframework.jms.support.converter.MessageConverter so you can be in control how to map to/from a jakarta.jms.Message.||object|
311
+ |messageCreatedStrategy|To use the given MessageCreatedStrategy which are invoked when Camel creates new instances of jakarta.jms.Message objects when Camel is sending a JMS message.||object|
312
+ |messageIdEnabled|When sending, specifies whether message IDs should be added. This is just an hint to the JMS broker. If the JMS provider accepts this hint, these messages must have the message ID set to null; if the provider ignores the hint, the message ID must be set to its normal unique value.|true|boolean|
313
+ |messageListenerContainerFactory|Registry ID of the MessageListenerContainerFactory used to determine what org.springframework.jms.listener.AbstractMessageListenerContainer to use to consume messages. Setting this will automatically set consumerType to Custom.||object|
314
+ |messageTimestampEnabled|Specifies whether timestamps should be enabled by default on sending messages. This is just an hint to the JMS broker. If the JMS provider accepts this hint, these messages must have the timestamp set to zero; if the provider ignores the hint the timestamp must be set to its normal value.|true|boolean|
315
+ |pubSubNoLocal|Specifies whether to inhibit the delivery of messages published by its own connection.|false|boolean|
316
+ |receiveTimeout|The timeout for receiving messages (in milliseconds).|1000|duration|
317
+ |recoveryInterval|Specifies the interval between recovery attempts, i.e. when a connection is being refreshed, in milliseconds. The default is 5000 ms, that is, 5 seconds.|5000|duration|
318
+ |requestTimeoutCheckerInterval|Configures how often Camel should check for timed out Exchanges when doing request/reply over JMS. By default Camel checks once per second. But if you must react faster when a timeout occurs, then you can lower this interval, to check more frequently. The timeout is determined by the option requestTimeout.|1000|duration|
319
+ |synchronous|Sets whether synchronous processing should be strictly used|false|boolean|
320
+ |temporaryQueueResolver|A pluggable TemporaryQueueResolver that allows you to use your own resolver for creating temporary queues (some messaging systems has special requirements for creating temporary queues).||object|
321
+ |transferException|If enabled and you are using Request Reply messaging (InOut) and an Exchange failed on the consumer side, then the caused Exception will be send back in response as a jakarta.jms.ObjectMessage. If the client is Camel, the returned Exception is rethrown. This allows you to use Camel JMS as a bridge in your routing - for example, using persistent queues to enable robust routing. Notice that if you also have transferExchange enabled, this option takes precedence. The caught exception is required to be serializable. The original Exception on the consumer side can be wrapped in an outer exception such as org.apache.camel.RuntimeCamelException when returned to the producer. Use this with caution as the data is using Java Object serialization and requires the received to be able to deserialize the data at Class level, which forces a strong coupling between the producers and consumer!|false|boolean|
322
+ |transferExchange|You can transfer the exchange over the wire instead of just the body and headers. The following fields are transferred: In body, Out body, Fault body, In headers, Out headers, Fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. You must enable this option on both the producer and consumer side, so Camel knows the payloads is an Exchange and not a regular payload. Use this with caution as the data is using Java Object serialization and requires the receiver to be able to deserialize the data at Class level, which forces a strong coupling between the producers and consumers having to use compatible Camel versions!|false|boolean|
323
+ |useMessageIDAsCorrelationID|Specifies whether JMSMessageID should always be used as JMSCorrelationID for InOut messages.|false|boolean|
324
+ |waitForProvisionCorrelationToBeUpdatedCounter|Number of times to wait for provisional correlation id to be updated to the actual correlation id when doing request/reply over JMS and when the option useMessageIDAsCorrelationID is enabled.|50|integer|
325
+ |waitForProvisionCorrelationToBeUpdatedThreadSleepingTime|Interval in millis to sleep each time while waiting for provisional correlation id to be updated.|100|duration|
326
+ |waitForTemporaryReplyToToBeUpdatedCounter|Number of times to wait for temporary replyTo queue to be created and ready when doing request/reply over JMS.|200|integer|
327
+ |waitForTemporaryReplyToToBeUpdatedThreadSleepingTime|Interval in millis to sleep each time while waiting for temporary replyTo queue to be ready.|100|duration|
328
+ |errorHandlerLoggingLevel|Allows to configure the default errorHandler logging level for logging uncaught exceptions.|WARN|object|
329
+ |errorHandlerLogStackTrace|Allows to control whether stack-traces should be logged or not, by the default errorHandler.|true|boolean|
330
+ |password|Password to use with the ConnectionFactory. You can also configure username/password directly on the ConnectionFactory.||string|
331
+ |username|Username to use with the ConnectionFactory. You can also configure username/password directly on the ConnectionFactory.||string|
332
+ |transacted|Specifies whether to use transacted mode|false|boolean|
333
+ |transactedInOut|Specifies whether InOut operations (request reply) default to using transacted mode If this flag is set to true, then Spring JmsTemplate will have sessionTransacted set to true, and the acknowledgeMode as transacted on the JmsTemplate used for InOut operations. Note from Spring JMS: that within a JTA transaction, the parameters passed to createQueue, createTopic methods are not taken into account. Depending on the Java EE transaction context, the container makes its own decisions on these values. Analogously, these parameters are not taken into account within a locally managed transaction either, since Spring JMS operates on an existing JMS Session in this case. Setting this flag to true will use a short local JMS transaction when running outside of a managed transaction, and a synchronized local JMS transaction in case of a managed transaction (other than an XA transaction) being present. This has the effect of a local JMS transaction being managed alongside the main transaction (which might be a native JDBC transaction), with the JMS transaction committing right after the main transaction.|false|boolean|
334
+ |lazyCreateTransactionManager|If true, Camel will create a JmsTransactionManager, if there is no transactionManager injected when option transacted=true.|true|boolean|
335
+ |transactionManager|The Spring transaction manager to use.||object|
336
+ |transactionName|The name of the transaction to use.||string|
337
+ |transactionTimeout|The timeout value of the transaction (in seconds), if using transacted mode.|-1|integer|
camel-arangodb.md ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Arangodb
2
+
3
+ **Since Camel 3.5**
4
+
5
+ **Only producer is supported**
6
+
7
+ The ArangoDb component is client for ArangoDb that uses the [arango java
8
+ driver](https://github.com/arangodb/arangodb-java-driver) to perform
9
+ queries on collections and graphs in the ArangoDb database.
10
+
11
+ Maven users will need to add the following dependency to their `pom.xml`
12
+ for this component:
13
+
14
+ <dependency>
15
+ <groupId>org.apache.camel</groupId>
16
+ <artifactId>camel-arangodb</artifactId>
17
+ <version>x.x.x</version>
18
+ <!-- use the same version as your Camel core version -->
19
+ </dependency>
20
+
21
+ # URI format
22
+
23
+ arangodb:database[?options]
24
+
25
+ # Examples
26
+
27
+ ## Producer Examples
28
+
29
+ ### Save document on a collection
30
+
31
+ from("direct:insert")
32
+ .to("arangodb:testDb?documentCollection=collection&operation=SAVE_DOCUMENT");
33
+
34
+ And you can set as body a BaseDocument class
35
+
36
+ BaseDocument myObject = new BaseDocument();
37
+ myObject.addAttribute("a", "Foo");
38
+ myObject.addAttribute("b", 42);
39
+
40
+ ### Query a collection
41
+
42
+ from("direct:query")
43
+ .to("arangodb:testDb?operation=AQL_QUERY
44
+
45
+ And you can invoke an AQL Query in this way
46
+
47
+ String query = "FOR t IN " + COLLECTION_NAME + " FILTER t.value == @value";
48
+ Map<String, Object> bindVars = new MapBuilder().put("value", "hello")
49
+ .get();
50
+
51
+ Exchange result = template.request("direct:query", exchange -> {
52
+ exchange.getMessage().setHeader(AQL_QUERY, query);
53
+ exchange.getMessage().setHeader(AQL_QUERY_BIND_PARAMETERS, bindVars);
54
+ });
55
+
56
+ ## Component Configurations
57
+
58
+
59
+ |Name|Description|Default|Type|
60
+ |---|---|---|---|
61
+ |configuration|Component configuration||object|
62
+ |documentCollection|Collection name, when using ArangoDb as a Document Database. Set the documentCollection name when using the CRUD operation on the document database collections (SAVE\_DOCUMENT , FIND\_DOCUMENT\_BY\_KEY, UPDATE\_DOCUMENT, DELETE\_DOCUMENT).||string|
63
+ |edgeCollection|Collection name of vertices, when using ArangoDb as a Graph Database. Set the edgeCollection name to perform CRUD operation on edges using these operations : SAVE\_VERTEX, FIND\_VERTEX\_BY\_KEY, UPDATE\_VERTEX, DELETE\_VERTEX. The graph attribute is mandatory.||string|
64
+ |graph|Graph name, when using ArangoDb as a Graph Database. Combine this attribute with one of the two attributes vertexCollection and edgeCollection.||string|
65
+ |host|ArangoDB host. If host and port are default, this field is Optional.||string|
66
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
67
+ |operation|Operations to perform on ArangoDb. For the operation AQL\_QUERY, no need to specify a collection or graph.||object|
68
+ |port|ArangoDB exposed port. If host and port are default, this field is Optional.||integer|
69
+ |vertexCollection|Collection name of vertices, when using ArangoDb as a Graph Database. Set the vertexCollection name to perform CRUD operation on vertices using these operations : SAVE\_EDGE, FIND\_EDGE\_BY\_KEY, UPDATE\_EDGE, DELETE\_EDGE. The graph attribute is mandatory.||string|
70
+ |arangoDB|To use an existing ArangDB client.||object|
71
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
72
+ |vertx|To use an existing Vertx in the ArangoDB client.||object|
73
+ |password|ArangoDB password. If user and password are default, this field is Optional.||string|
74
+ |user|ArangoDB user. If user and password are default, this field is Optional.||string|
75
+
76
+ ## Endpoint Configurations
77
+
78
+
79
+ |Name|Description|Default|Type|
80
+ |---|---|---|---|
81
+ |database|database name||string|
82
+ |documentCollection|Collection name, when using ArangoDb as a Document Database. Set the documentCollection name when using the CRUD operation on the document database collections (SAVE\_DOCUMENT , FIND\_DOCUMENT\_BY\_KEY, UPDATE\_DOCUMENT, DELETE\_DOCUMENT).||string|
83
+ |edgeCollection|Collection name of vertices, when using ArangoDb as a Graph Database. Set the edgeCollection name to perform CRUD operation on edges using these operations : SAVE\_VERTEX, FIND\_VERTEX\_BY\_KEY, UPDATE\_VERTEX, DELETE\_VERTEX. The graph attribute is mandatory.||string|
84
+ |graph|Graph name, when using ArangoDb as a Graph Database. Combine this attribute with one of the two attributes vertexCollection and edgeCollection.||string|
85
+ |host|ArangoDB host. If host and port are default, this field is Optional.||string|
86
+ |operation|Operations to perform on ArangoDb. For the operation AQL\_QUERY, no need to specify a collection or graph.||object|
87
+ |port|ArangoDB exposed port. If host and port are default, this field is Optional.||integer|
88
+ |vertexCollection|Collection name of vertices, when using ArangoDb as a Graph Database. Set the vertexCollection name to perform CRUD operation on vertices using these operations : SAVE\_EDGE, FIND\_EDGE\_BY\_KEY, UPDATE\_EDGE, DELETE\_EDGE. The graph attribute is mandatory.||string|
89
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
90
+ |arangoDB|To use an existing ArangDB client.||object|
91
+ |vertx|To use an existing Vertx instance in the ArangoDB client.||object|
92
+ |password|ArangoDB password. If user and password are default, this field is Optional.||string|
93
+ |user|ArangoDB user. If user and password are default, this field is Optional.||string|
camel-as2.md ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # As2
2
+
3
+ **Since Camel 2.22**
4
+
5
+ **Both producer and consumer are supported**
6
+
7
+ The AS2 component provides transport of EDI messages using the HTTP
8
+ transfer protocol as specified in
9
+ [RFC4130](https://tools.ietf.org/html/rfc4130).
10
+
11
+ Maven users will need to add the following dependency to their pom.xml
12
+ for this component:
13
+
14
+ <dependency>
15
+ <groupId>org.apache.camel</groupId>
16
+ <artifactId>camel-as2</artifactId>
17
+ <version>x.x.x</version>
18
+ <!-- use the same version as your Camel core version -->
19
+ </dependency>
20
+
21
+ # URI format
22
+
23
+ **Sample URL**
24
+
25
+ as2://apiName/methodName
26
+
27
+ apiName can be one of:
28
+
29
+ - client
30
+
31
+ - server
32
+
33
+ ## Component Configurations
34
+
35
+
36
+ |Name|Description|Default|Type|
37
+ |---|---|---|---|
38
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
39
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
40
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
41
+ |configuration|Component configuration||object|
42
+
43
+ ## Endpoint Configurations
44
+
45
+
46
+ |Name|Description|Default|Type|
47
+ |---|---|---|---|
48
+ |apiName|What kind of operation to perform||object|
49
+ |methodName|What sub operation to use for the selected operation||string|
50
+ |as2From|The value of the AS2From header of AS2 message.||string|
51
+ |as2MessageStructure|The structure of AS2 Message. One of: PLAIN - No encryption, no signature, SIGNED - No encryption, signature, ENCRYPTED - Encryption, no signature, ENCRYPTED\_SIGNED - Encryption, signature||object|
52
+ |as2To|The value of the AS2To header of AS2 message.||string|
53
+ |as2Version|The version of the AS2 protocol.|1.1|string|
54
+ |asyncMdnPortNumber|The port number of asynchronous MDN server.||integer|
55
+ |attachedFileName|The name of the attached file||string|
56
+ |clientFqdn|The Client Fully Qualified Domain Name (FQDN). Used in message ids sent by endpoint.|camel.apache.org|string|
57
+ |compressionAlgorithm|The algorithm used to compress EDI message.||object|
58
+ |dispositionNotificationTo|The value of the Disposition-Notification-To header. Assigning a value to this parameter requests a message disposition notification (MDN) for the AS2 message.||string|
59
+ |ediMessageTransferEncoding|The transfer encoding of EDI message.||string|
60
+ |ediMessageType|The content type of EDI message. One of application/edifact, application/edi-x12, application/edi-consent, application/xml||object|
61
+ |from|The value of the From header of AS2 message.||string|
62
+ |hostnameVerifier|Set hostname verifier for SSL session.||object|
63
+ |httpConnectionPoolSize|The maximum size of the connection pool for http connections (client only)|5|integer|
64
+ |httpConnectionPoolTtl|The time to live for connections in the connection pool (client only)|15m|object|
65
+ |httpConnectionTimeout|The timeout of the http connection (client only)|5s|object|
66
+ |httpSocketTimeout|The timeout of the underlying http socket (client only)|5s|object|
67
+ |inBody|Sets the name of a parameter to be passed in the exchange In Body||string|
68
+ |mdnMessageTemplate|The template used to format MDN message||string|
69
+ |receiptDeliveryOption|The return URL that the message receiver should send an asynchronous MDN to. If not present the receipt is synchronous. (Client only)||string|
70
+ |requestUri|The request URI of EDI message.|/|string|
71
+ |server|The value included in the Server message header identifying the AS2 Server.|Camel AS2 Server Endpoint|string|
72
+ |serverFqdn|The Server Fully Qualified Domain Name (FQDN). Used in message ids sent by endpoint.|camel.apache.org|string|
73
+ |serverPortNumber|The port number of server.||integer|
74
+ |sslContext|Set SSL context for connection to remote server.||object|
75
+ |subject|The value of Subject header of AS2 message.||string|
76
+ |targetHostname|The host name (IP or DNS name) of target host.||string|
77
+ |targetPortNumber|The port number of target host. -1 indicates the scheme default port.|80|integer|
78
+ |userAgent|The value included in the User-Agent message header identifying the AS2 user agent.|Camel AS2 Client Endpoint|string|
79
+ |exceptionHandler|To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.||object|
80
+ |exchangePattern|Sets the exchange pattern when the consumer creates an exchange.||object|
81
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
82
+ |decryptingPrivateKey|The key used to encrypt the EDI message.||object|
83
+ |encryptingAlgorithm|The algorithm used to encrypt EDI message.||object|
84
+ |encryptingCertificateChain|The chain of certificates used to encrypt EDI message.||object|
85
+ |signedReceiptMicAlgorithms|The list of algorithms, in order of preference, requested to generate a message integrity check (MIC) returned in message dispostion notification (MDN)||array|
86
+ |signingAlgorithm|The algorithm used to sign EDI message.||object|
87
+ |signingCertificateChain|The chain of certificates used to sign EDI message.||object|
88
+ |signingPrivateKey|The key used to sign the EDI message.||object|
89
+ |validateSigningCertificateChain|Certificates to validate the message's signature against. If not supplied, validation will not take place. Server: validates the received message. Client: not yet implemented, should validate the MDN||object|
camel-asterisk.md ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Asterisk
2
+
3
+ **Since Camel 2.18**
4
+
5
+ **Both producer and consumer are supported**
6
+
7
+ The Asterisk component allows you to work easily with an Asterisk PBX
8
+ Server [http://www.asterisk.org/](http://www.asterisk.org/) using
9
+ [asterisk-java](https://asterisk-java.org/)
10
+
11
+ This component helps to interface with [Asterisk Manager
12
+ Interface](http://www.voip-info.org/wiki-Asterisk+manager+API)
13
+
14
+ Maven users will need to add the following dependency to their `pom.xml`
15
+ for this component:
16
+
17
+ <dependency>
18
+ <groupId>org.apache.camel</groupId>
19
+ <artifactId>camel-asterisk</artifactId>
20
+ <version>x.x.x</version>
21
+ <!-- use the same version as your Camel core version -->
22
+ </dependency>
23
+
24
+ # URI format
25
+
26
+ asterisk:name[?options]
27
+
28
+ # Action
29
+
30
+ Supported actions are:
31
+
32
+ - QUEUE\_STATUS: Queue status
33
+
34
+ - SIP\_PEERS: List SIP peers
35
+
36
+ - EXTENSION\_STATE: Check extension status
37
+
38
+ # Examples
39
+
40
+ ## Producer Example
41
+
42
+ from("direct:in")
43
+ .to("asterisk://myVoIP?hostname=hostname&username=username&password=password&action=EXTENSION_STATE")
44
+
45
+ ## Consumer Example
46
+
47
+ from("asterisk:myVoIP?hostname=hostname&username=username&password=password")
48
+ .log("Received a message - ${body}");
49
+
50
+ ## Component Configurations
51
+
52
+
53
+ |Name|Description|Default|Type|
54
+ |---|---|---|---|
55
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
56
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
57
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
58
+
59
+ ## Endpoint Configurations
60
+
61
+
62
+ |Name|Description|Default|Type|
63
+ |---|---|---|---|
64
+ |name|Name of component||string|
65
+ |hostname|The hostname of the asterisk server||string|
66
+ |password|Login password||string|
67
+ |username|Login username||string|
68
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
69
+ |exceptionHandler|To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.||object|
70
+ |exchangePattern|Sets the exchange pattern when the consumer creates an exchange.||object|
71
+ |action|What action to perform such as getting queue status, sip peers or extension state.||object|
72
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
camel-atmosphere-websocket.md ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Atmosphere-websocket
2
+
3
+ **Since Camel 2.14**
4
+
5
+ **Both producer and consumer are supported**
6
+
7
+ The Atmosphere-Websocket component provides Websocket based endpoints
8
+ for a servlet communicating with external clients over Websocket (as a
9
+ servlet accepting websocket connections from external clients). This
10
+ component uses the
11
+ [Atmosphere](https://github.com/Atmosphere/atmosphere) library to
12
+ support the Websocket transport in various Servlet containers.
13
+
14
+ Maven users will need to add the following dependency to their `pom.xml`
15
+ for this component:
16
+
17
+ <dependency>
18
+ <groupId>org.apache.camel</groupId>
19
+ <artifactId>camel-atmosphere-websocket</artifactId>
20
+ <version>x.x.x</version>
21
+ <!-- use the same version as your Camel core version -->
22
+ </dependency>
23
+
24
+ # Reading and Writing Data over Websocket
25
+
26
+ An atmopshere-websocket endpoint can either write data to the socket or
27
+ read from the socket, depending on whether the endpoint is configured as
28
+ the producer or the consumer, respectively.
29
+
30
+ # Examples
31
+
32
+ ## Consumer Example
33
+
34
+ In the route below, Camel will read from the specified websocket
35
+ connection.
36
+
37
+ from("atmosphere-websocket:///servicepath")
38
+ .to("direct:next");
39
+
40
+ And the equivalent Spring sample:
41
+
42
+ <camelContext xmlns="http://camel.apache.org/schema/spring">
43
+ <route>
44
+ <from uri="atmosphere-websocket:///servicepath"/>
45
+ <to uri="direct:next"/>
46
+ </route>
47
+ </camelContext>
48
+
49
+ ## Producer Example
50
+
51
+ In the route below, Camel will write to the specified websocket
52
+ connection.
53
+
54
+ from("direct:next")
55
+ .to("atmosphere-websocket:///servicepath");
56
+
57
+ And the equivalent Spring sample:
58
+
59
+ <camelContext xmlns="http://camel.apache.org/schema/spring">
60
+ <route>
61
+ <from uri="direct:next"/>
62
+ <to uri="atmosphere-websocket:///servicepath"/>
63
+ </route>
64
+ </camelContext>
65
+
66
+ ## Component Configurations
67
+
68
+
69
+ |Name|Description|Default|Type|
70
+ |---|---|---|---|
71
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
72
+ |muteException|If enabled and an Exchange failed processing on the consumer side the response's body won't contain the exception's stack trace.|true|boolean|
73
+ |servletName|Default name of servlet to use. The default name is CamelServlet.|CamelServlet|string|
74
+ |attachmentMultipartBinding|Whether to automatic bind multipart/form-data as attachments on the Camel Exchange. The options attachmentMultipartBinding=true and disableStreamCache=false cannot work together. Remove disableStreamCache to use AttachmentMultipartBinding. This is turn off by default as this may require servlet specific configuration to enable this when using Servlet's.|false|boolean|
75
+ |fileNameExtWhitelist|Whitelist of accepted filename extensions for accepting uploaded files. Multiple extensions can be separated by comma, such as txt,xml.||string|
76
+ |httpRegistry|To use a custom org.apache.camel.component.servlet.HttpRegistry.||object|
77
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
78
+ |allowJavaSerializedObject|Whether to allow java serialization when a request uses context-type=application/x-java-serialized-object. This is by default turned off. If you enable this then be aware that Java will deserialize the incoming data from the request to Java and that can be a potential security risk.|false|boolean|
79
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
80
+ |httpBinding|To use a custom HttpBinding to control the mapping between Camel message and HttpClient.||object|
81
+ |httpConfiguration|To use the shared HttpConfiguration as base configuration.||object|
82
+ |headerFilterStrategy|To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message.||object|
83
+
84
+ ## Endpoint Configurations
85
+
86
+
87
+ |Name|Description|Default|Type|
88
+ |---|---|---|---|
89
+ |servicePath|Name of websocket endpoint||string|
90
+ |chunked|If this option is false the Servlet will disable the HTTP streaming and set the content-length header on the response|true|boolean|
91
+ |disableStreamCache|Determines whether or not the raw input stream from Servlet is cached or not (Camel will read the stream into a in memory/overflow to file, Stream caching) cache. By default Camel will cache the Servlet input stream to support reading it multiple times to ensure it Camel can retrieve all data from the stream. However you can set this option to true when you for example need to access the raw stream, such as streaming it directly to a file or other persistent store. DefaultHttpBinding will copy the request input stream into a stream cache and put it into message body if this option is false to support reading the stream multiple times. If you use Servlet to bridge/proxy an endpoint then consider enabling this option to improve performance, in case you do not need to read the message payload multiple times. The http producer will by default cache the response body stream. If setting this option to true, then the producers will not cache the response body stream but use the response stream as-is as the message body.|false|boolean|
92
+ |sendToAll|Whether to send to all (broadcast) or send to a single receiver.|false|boolean|
93
+ |transferException|If enabled and an Exchange failed processing on the consumer side, and if the caused Exception was send back serialized in the response as a application/x-java-serialized-object content type. On the producer side the exception will be deserialized and thrown as is, instead of the HttpOperationFailedException. The caused exception is required to be serialized. This is by default turned off. If you enable this then be aware that Java will deserialize the incoming data from the request to Java and that can be a potential security risk.|false|boolean|
94
+ |useStreaming|To enable streaming to send data as multiple text fragments.|false|boolean|
95
+ |headerFilterStrategy|To use a custom HeaderFilterStrategy to filter header to and from Camel message.||object|
96
+ |httpBinding|To use a custom HttpBinding to control the mapping between Camel message and HttpClient.||object|
97
+ |async|Configure the consumer to work in async mode|false|boolean|
98
+ |httpMethodRestrict|Used to only allow consuming if the HttpMethod matches, such as GET/POST/PUT etc. Multiple methods can be specified separated by comma.||string|
99
+ |logException|If enabled and an Exchange failed processing on the consumer side the exception's stack trace will be logged when the exception stack trace is not sent in the response's body.|false|boolean|
100
+ |matchOnUriPrefix|Whether or not the consumer should try to find a target consumer by matching the URI prefix if no exact match is found.|false|boolean|
101
+ |muteException|If enabled and an Exchange failed processing on the consumer side the response's body won't contain the exception's stack trace.|false|boolean|
102
+ |responseBufferSize|To use a custom buffer size on the jakarta.servlet.ServletResponse.||integer|
103
+ |servletName|Name of the servlet to use|CamelServlet|string|
104
+ |attachmentMultipartBinding|Whether to automatic bind multipart/form-data as attachments on the Camel Exchange. The options attachmentMultipartBinding=true and disableStreamCache=false cannot work together. Remove disableStreamCache to use AttachmentMultipartBinding. This is turn off by default as this may require servlet specific configuration to enable this when using Servlet's.|false|boolean|
105
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
106
+ |eagerCheckContentAvailable|Whether to eager check whether the HTTP requests has content if the content-length header is 0 or not present. This can be turned on in case HTTP clients do not send streamed data.|false|boolean|
107
+ |exceptionHandler|To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.||object|
108
+ |exchangePattern|Sets the exchange pattern when the consumer creates an exchange.||object|
109
+ |fileNameExtWhitelist|Whitelist of accepted filename extensions for accepting uploaded files. Multiple extensions can be separated by comma, such as txt,xml.||string|
110
+ |mapHttpMessageBody|If this option is true then IN exchange Body of the exchange will be mapped to HTTP body. Setting this to false will avoid the HTTP mapping.|true|boolean|
111
+ |mapHttpMessageFormUrlEncodedBody|If this option is true then IN exchange Form Encoded body of the exchange will be mapped to HTTP. Setting this to false will avoid the HTTP Form Encoded body mapping.|true|boolean|
112
+ |mapHttpMessageHeaders|If this option is true then IN exchange Headers of the exchange will be mapped to HTTP headers. Setting this to false will avoid the HTTP Headers mapping.|true|boolean|
113
+ |optionsEnabled|Specifies whether to enable HTTP OPTIONS for this Servlet consumer. By default OPTIONS is turned off.|false|boolean|
114
+ |traceEnabled|Specifies whether to enable HTTP TRACE for this Servlet consumer. By default TRACE is turned off.|false|boolean|
115
+ |bridgeEndpoint|If the option is true, HttpProducer will ignore the Exchange.HTTP\_URI header, and use the endpoint's URI for request. You may also set the option throwExceptionOnFailure to be false to let the HttpProducer send all the fault response back.|false|boolean|
116
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
117
+ |oauth2ClientId|OAuth2 client id||string|
118
+ |oauth2ClientSecret|OAuth2 client secret||string|
119
+ |oauth2TokenEndpoint|OAuth2 Token endpoint||string|
camel-atom.md ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Atom
2
+
3
+ **Since Camel 1.2**
4
+
5
+ **Only consumer is supported**
6
+
7
+ The Atom component is used for polling Atom feeds.
8
+
9
+ Camel will poll the feed every 60 seconds by default.
10
+ **Note:** The component currently only supports polling (consuming)
11
+ feeds.
12
+
13
+ Maven users will need to add the following dependency to their `pom.xml`
14
+ for this component:
15
+
16
+ <dependency>
17
+ <groupId>org.apache.camel</groupId>
18
+ <artifactId>camel-atom</artifactId>
19
+ <version>x.x.x</version>
20
+ <!-- use the same version as your Camel core version -->
21
+ </dependency>
22
+
23
+ # URI format
24
+
25
+ atom://atomUri[?options]
26
+
27
+ Where **atomUri** is the URI to the Atom feed to poll.
28
+
29
+ # Exchange data format
30
+
31
+ Camel will set the In body on the returned `Exchange` with the entries.
32
+ Depending on the `splitEntries` flag Camel will either return one
33
+ `Entry` or a `List<Entry>`.
34
+
35
+ <table>
36
+ <colgroup>
37
+ <col style="width: 10%" />
38
+ <col style="width: 10%" />
39
+ <col style="width: 79%" />
40
+ </colgroup>
41
+ <thead>
42
+ <tr>
43
+ <th style="text-align: left;">Option</th>
44
+ <th style="text-align: left;">Value</th>
45
+ <th style="text-align: left;">Behavior</th>
46
+ </tr>
47
+ </thead>
48
+ <tbody>
49
+ <tr>
50
+ <td style="text-align: left;"><p><code>splitEntries</code></p></td>
51
+ <td style="text-align: left;"><p><code>true</code></p></td>
52
+ <td style="text-align: left;"><p>Only a single entry from the currently
53
+ being processed feed is set:
54
+ <code>exchange.in.body(Entry)</code></p></td>
55
+ </tr>
56
+ <tr>
57
+ <td style="text-align: left;"><p><code>splitEntries</code></p></td>
58
+ <td style="text-align: left;"><p><code>false</code></p></td>
59
+ <td style="text-align: left;"><p>The entire list of entries from the
60
+ feed is set: <code>exchange.in.body(List&lt;Entry&gt;)</code></p></td>
61
+ </tr>
62
+ </tbody>
63
+ </table>
64
+
65
+ Camel can set the `Feed` object on the In header (see `feedHeader`
66
+ option to disable this):
67
+
68
+ # Examples
69
+
70
+ ## Consumer Example
71
+
72
+ In this sample, we poll James Strachan’s blog.
73
+
74
+ from("atom://http://macstrac.blogspot.com/feeds/posts/default").to("seda:feeds");
75
+
76
+ In this sample, we want to filter only good blogs we like to a SEDA
77
+ queue. The sample also shows how to set up Camel standalone, not running
78
+ in any Container or using Spring.
79
+
80
+ ## Component Configurations
81
+
82
+
83
+ |Name|Description|Default|Type|
84
+ |---|---|---|---|
85
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
86
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
87
+
88
+ ## Endpoint Configurations
89
+
90
+
91
+ |Name|Description|Default|Type|
92
+ |---|---|---|---|
93
+ |feedUri|The URI to the feed to poll.||string|
94
+ |sendEmptyMessageWhenIdle|If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead.|false|boolean|
95
+ |sortEntries|Sets whether to sort entries by published date. Only works when splitEntries = true.|false|boolean|
96
+ |splitEntries|Sets whether or not entries should be sent individually or whether the entire feed should be sent as a single message|true|boolean|
97
+ |throttleEntries|Sets whether all entries identified in a single feed poll should be delivered immediately. If true, only one entry is processed per delay. Only applicable when splitEntries = true.|true|boolean|
98
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
99
+ |exceptionHandler|To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.||object|
100
+ |exchangePattern|Sets the exchange pattern when the consumer creates an exchange.||object|
101
+ |pollStrategy|A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel.||object|
102
+ |feedHeader|Sets whether to add the feed object as a header.|true|boolean|
103
+ |backoffErrorThreshold|The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in.||integer|
104
+ |backoffIdleThreshold|The number of subsequent idle polls that should happen before the backoffMultipler should kick-in.||integer|
105
+ |backoffMultiplier|To let the scheduled polling consumer backoff if there has been a number of subsequent idles/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and/or backoffErrorThreshold must also be configured.||integer|
106
+ |delay|Milliseconds before the next poll.|500|integer|
107
+ |greedy|If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages.|false|boolean|
108
+ |initialDelay|Milliseconds before the first poll starts.|1000|integer|
109
+ |repeatCount|Specifies a maximum limit of number of fires. So if you set it to 1, the scheduler will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever.|0|integer|
110
+ |runLoggingLevel|The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that.|TRACE|object|
111
+ |scheduledExecutorService|Allows for configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool.||object|
112
+ |scheduler|To use a cron scheduler from either camel-spring or camel-quartz component. Use value spring or quartz for built in scheduler|none|object|
113
+ |schedulerProperties|To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler.||object|
114
+ |startScheduler|Whether the scheduler should be auto started.|true|boolean|
115
+ |timeUnit|Time unit for initialDelay and delay options.|MILLISECONDS|object|
116
+ |useFixedDelay|Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details.|true|boolean|
camel-avro.md ADDED
@@ -0,0 +1,212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Avro
2
+
3
+ **Since Camel 2.10**
4
+
5
+ **Both producer and consumer are supported**
6
+
7
+ This component provides support for Apache Avro’s rpc, by providing
8
+ producers and consumers endpoint for using avro over netty or http.
9
+ Before Camel 3.2 this functionality was a part of camel-avro component.
10
+
11
+ Maven users will need to add the following dependency to their `pom.xml`
12
+ for this component:
13
+
14
+ <dependency>
15
+ <groupId>org.apache.camel</groupId>
16
+ <artifactId>camel-avro-rpc</artifactId>
17
+ <version>x.x.x</version>
18
+ <!-- use the same version as your Camel core version -->
19
+ </dependency>
20
+
21
+ # Apache Avro Overview
22
+
23
+ Avro allows you to define message types and a protocol using a json like
24
+ format and then generate java code for the specified types and messages.
25
+ An example of how a schema looks like is below.
26
+
27
+ {"namespace": "org.apache.camel.avro.generated",
28
+ "protocol": "KeyValueProtocol",
29
+
30
+ "types": [
31
+ {"name": "Key", "type": "record",
32
+ "fields": [
33
+ {"name": "key", "type": "string"}
34
+ ]
35
+ },
36
+ {"name": "Value", "type": "record",
37
+ "fields": [
38
+ {"name": "value", "type": "string"}
39
+ ]
40
+ }
41
+ ],
42
+
43
+ "messages": {
44
+ "put": {
45
+ "request": [{"name": "key", "type": "Key"}, {"name": "value", "type": "Value"} ],
46
+ "response": "null"
47
+ },
48
+ "get": {
49
+ "request": [{"name": "key", "type": "Key"}],
50
+ "response": "Value"
51
+ }
52
+ }
53
+ }
54
+
55
+ You can easily generate classes from a schema, using maven, ant etc.
56
+ More details can be found at the [Apache Avro
57
+ documentation](http://avro.apache.org/docs/current/).
58
+
59
+ However, it doesn’t enforce a schema-first approach, and you can create
60
+ schema for your existing classes. You can use existing protocol
61
+ interfaces to make RCP calls. You should use interface for the protocol
62
+ itself and POJO beans or primitive/String classes for parameter and
63
+ result types. Here is an example of the class that corresponds to the
64
+ schema above:
65
+
66
+ package org.apache.camel.avro.reflection;
67
+
68
+ public interface KeyValueProtocol {
69
+ void put(String key, Value value);
70
+ Value get(String key);
71
+ }
72
+
73
+ class Value {
74
+ private String value;
75
+ public String getValue() { return value; }
76
+ public void setValue(String value) { this.value = value; }
77
+ }
78
+
79
+ *Note: Existing classes can be used only for RPC (see below), not in
80
+ data format.*
81
+
82
+ # Using Avro RPC in Camel
83
+
84
+ As mentioned above, Avro also provides RPC support over multiple
85
+ transports such as http and netty. Camel provides consumers and
86
+ producers for these two transports.
87
+
88
+ avro:[transport]:[host]:[port][?options]
89
+
90
+ The supported transport values are currently http or netty.
91
+
92
+ You can specify the message name right in the URI:
93
+
94
+ avro:[transport]:[host]:[port][/messageName][?options]
95
+
96
+ For consumers, this allows you to have multiple routes attached to the
97
+ same socket. Dispatching to the correct route will be done by the avro
98
+ component automatically. Route with no messageName specified (if any)
99
+ will be used as default.
100
+
101
+ When using camel producers for avro ipc, the "in" message body needs to
102
+ contain the parameters of the operation specified in the avro protocol.
103
+ The response will be added in the body of the "out" message.
104
+
105
+ In a similar manner when using camel avro consumers for avro ipc, the
106
+ request parameters will be placed inside the "in" message body of the
107
+ created exchange. Once the exchange is processed, the body of the "out"
108
+ message will be sent as a response.
109
+
110
+ **Note:** By default, consumer parameters are wrapped into an array. If
111
+ you’ve got only one parameter, **since 2.12** you can use
112
+ `singleParameter` URI option to receive it directly in the "in" message
113
+ body without array wrapping.
114
+
115
+ # Examples
116
+
117
+ An example of using camel avro producers via http:
118
+
119
+ <route>
120
+ <from uri="direct:start"/>
121
+ <to uri="avro:http:localhost:{{avroport}}?protocolClassName=org.apache.camel.avro.generated.KeyValueProtocol"/>
122
+ <to uri="log:avro"/>
123
+ </route>
124
+
125
+ In the example above you need to fill `CamelAvroMessageName` header.
126
+
127
+ You can use the following syntax to call constant messages:
128
+
129
+ <route>
130
+ <from uri="direct:start"/>
131
+ <to uri="avro:http:localhost:{{avroport}}/put?protocolClassName=org.apache.camel.avro.generated.KeyValueProtocol"/>
132
+ <to uri="log:avro"/>
133
+ </route>
134
+
135
+ An example of consuming messages using camel avro consumers via netty:
136
+
137
+ <route>
138
+ <from uri="avro:netty:localhost:{{avroport}}?protocolClassName=org.apache.camel.avro.generated.KeyValueProtocol"/>
139
+ <choice>
140
+ <when>
141
+ <el>${in.headers.CamelAvroMessageName == 'put'}</el>
142
+ <process ref="putProcessor"/>
143
+ </when>
144
+ <when>
145
+ <el>${in.headers.CamelAvroMessageName == 'get'}</el>
146
+ <process ref="getProcessor"/>
147
+ </when>
148
+ </choice>
149
+ </route>
150
+
151
+ You can set up two distinct routes to perform the same task:
152
+
153
+ <route>
154
+ <from uri="avro:netty:localhost:{{avroport}}/put?protocolClassName=org.apache.camel.avro.generated.KeyValueProtocol">
155
+ <process ref="putProcessor"/>
156
+ </route>
157
+ <route>
158
+ <from uri="avro:netty:localhost:{{avroport}}/get?protocolClassName=org.apache.camel.avro.generated.KeyValueProtocol&singleParameter=true"/>
159
+ <process ref="getProcessor"/>
160
+ </route>
161
+
162
+ In the example above, get takes only one parameter, so `singleParameter`
163
+ is used and `getProcessor` will receive Value class directly in body,
164
+ while `putProcessor` will receive an array of size 2 with `String` key
165
+ and `Value` value filled as array contents.
166
+
167
+ # Avro via HTTP SPI
168
+
169
+ The Avro RPC component offers the
170
+ `org.apache.camel.component.avro.spi.AvroRpcHttpServerFactory` service
171
+ provider interface (SPI) so that various platforms can provide their own
172
+ implementation based on their native HTTP server.
173
+
174
+ The default implementation available in
175
+ `org.apache.camel:camel-avro-jetty` is based on
176
+ `org.apache.avro:avro-ipc-jetty`.
177
+
178
+ ## Component Configurations
179
+
180
+
181
+ |Name|Description|Default|Type|
182
+ |---|---|---|---|
183
+ |protocol|Avro protocol to use||object|
184
+ |protocolClassName|Avro protocol to use defined by the FQN class name||string|
185
+ |protocolLocation|Avro protocol location||string|
186
+ |reflectionProtocol|If the protocol object provided is reflection protocol. Should be used only with protocol parameter because for protocolClassName protocol type will be auto-detected|false|boolean|
187
+ |singleParameter|If true, consumer parameter won't be wrapped into an array. Will fail if protocol specifies more than one parameter for the message|false|boolean|
188
+ |uriAuthority|Authority to use (username and password)||string|
189
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
190
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
191
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
192
+ |configuration|To use a shared AvroConfiguration to configure options once||object|
193
+
194
+ ## Endpoint Configurations
195
+
196
+
197
+ |Name|Description|Default|Type|
198
+ |---|---|---|---|
199
+ |transport|Transport to use, can be either http or netty||object|
200
+ |port|Port number to use||integer|
201
+ |host|Hostname to use||string|
202
+ |messageName|The name of the message to send.||string|
203
+ |protocol|Avro protocol to use||object|
204
+ |protocolClassName|Avro protocol to use defined by the FQN class name||string|
205
+ |protocolLocation|Avro protocol location||string|
206
+ |reflectionProtocol|If the protocol object provided is reflection protocol. Should be used only with protocol parameter because for protocolClassName protocol type will be auto-detected|false|boolean|
207
+ |singleParameter|If true, consumer parameter won't be wrapped into an array. Will fail if protocol specifies more than one parameter for the message|false|boolean|
208
+ |uriAuthority|Authority to use (username and password)||string|
209
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
210
+ |exceptionHandler|To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.||object|
211
+ |exchangePattern|Sets the exchange pattern when the consumer creates an exchange.||object|
212
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
camel-aws-bedrock-agent-runtime.md ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws-bedrock-agent-runtime
2
+
3
+ **Since Camel 4.5**
4
+
5
+ **Only producer is supported**
6
+
7
+ The AWS2 Bedrock component supports invoking a supported LLM model from
8
+ [AWS Bedrock](https://aws.amazon.com/bedrock/) service.
9
+
10
+ Prerequisites
11
+
12
+ You must have a valid Amazon Web Services developer account, and be
13
+ signed up to use Amazon Bedrock. More information is available at
14
+ [Amazon Bedrock](https://aws.amazon.com/bedrock/).
15
+
16
+ # URI Format
17
+
18
+ aws-bedrock-agent-runtime://label[?options]
19
+
20
+ You can append query options to the URI in the following format:
21
+
22
+ `?options=value&option2=value&...`
23
+
24
+ Required Bedrock component options
25
+
26
+ You have to provide the bedrockRuntimeClient in the Registry or your
27
+ accessKey and secretKey to access the [Amazon
28
+ Bedrock](https://aws.amazon.com/bedrock/) service.
29
+
30
+ # Usage
31
+
32
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
33
+
34
+ You have the possibility of avoiding the usage of explicit static
35
+ credentials by specifying the useDefaultCredentialsProvider option and
36
+ set it to true.
37
+
38
+ The order of evaluation for Default Credentials Provider is the
39
+ following:
40
+
41
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
42
+
43
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
44
+ `AWS_SECRET_ACCESS_KEY`.
45
+
46
+ - Web Identity Token from AWS STS.
47
+
48
+ - The shared credentials and config files.
49
+
50
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
51
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
52
+ set.
53
+
54
+ - Amazon EC2 Instance profile credentials.
55
+
56
+ You have also the possibility of using Profile Credentials Provider, by
57
+ specifying the useProfileCredentialsProvider option to true and
58
+ profileCredentialsName to the profile name.
59
+
60
+ Only one of static, default and profile credentials could be used at the
61
+ same time.
62
+
63
+ For more information about this you can look at [AWS credentials
64
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
65
+
66
+ # Dependencies
67
+
68
+ Maven users will need to add the following dependency to their pom.xml.
69
+
70
+ **pom.xml**
71
+
72
+ <dependency>
73
+ <groupId>org.apache.camel</groupId>
74
+ <artifactId>camel-aws-bedrock</artifactId>
75
+ <version>${camel-version}</version>
76
+ </dependency>
77
+
78
+ where `${camel-version}` must be replaced by the actual version of
79
+ Camel.
80
+
81
+ ## Component Configurations
82
+
83
+
84
+ |Name|Description|Default|Type|
85
+ |---|---|---|---|
86
+ |configuration|Component configuration||object|
87
+ |knowledgeBaseId|Define the Knowledge Base Id we are going to use||string|
88
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
89
+ |modelId|Define the model Id we are going to use||string|
90
+ |operation|The operation to perform||object|
91
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
92
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
93
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name|false|string|
94
+ |region|The region in which Bedrock Agent Runtime client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
95
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
96
+ |useDefaultCredentialsProvider|Set whether the Bedrock Agent Runtime client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
97
+ |useProfileCredentialsProvider|Set whether the Bedrock Agent Runtime client should expect to load credentials through a profile credentials provider.|false|boolean|
98
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
99
+ |bedrockAgentRuntimeClient|To use an existing configured AWS Bedrock Agent Runtime client||object|
100
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
101
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
102
+ |proxyHost|To define a proxy host when instantiating the Bedrock Agent Runtime client||string|
103
+ |proxyPort|To define a proxy port when instantiating the Bedrock Agent Runtime client||integer|
104
+ |proxyProtocol|To define a proxy protocol when instantiating the Bedrock Agent Runtime client|HTTPS|object|
105
+ |accessKey|Amazon AWS Access Key||string|
106
+ |secretKey|Amazon AWS Secret Key||string|
107
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
108
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
109
+ |useSessionCredentials|Set whether the Bedrock Agent Runtime client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in Bedrock.|false|boolean|
110
+
111
+ ## Endpoint Configurations
112
+
113
+
114
+ |Name|Description|Default|Type|
115
+ |---|---|---|---|
116
+ |label|Logical name||string|
117
+ |knowledgeBaseId|Define the Knowledge Base Id we are going to use||string|
118
+ |modelId|Define the model Id we are going to use||string|
119
+ |operation|The operation to perform||object|
120
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
121
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
122
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name|false|string|
123
+ |region|The region in which Bedrock Agent Runtime client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
124
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
125
+ |useDefaultCredentialsProvider|Set whether the Bedrock Agent Runtime client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
126
+ |useProfileCredentialsProvider|Set whether the Bedrock Agent Runtime client should expect to load credentials through a profile credentials provider.|false|boolean|
127
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
128
+ |bedrockAgentRuntimeClient|To use an existing configured AWS Bedrock Agent Runtime client||object|
129
+ |proxyHost|To define a proxy host when instantiating the Bedrock Agent Runtime client||string|
130
+ |proxyPort|To define a proxy port when instantiating the Bedrock Agent Runtime client||integer|
131
+ |proxyProtocol|To define a proxy protocol when instantiating the Bedrock Agent Runtime client|HTTPS|object|
132
+ |accessKey|Amazon AWS Access Key||string|
133
+ |secretKey|Amazon AWS Secret Key||string|
134
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
135
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
136
+ |useSessionCredentials|Set whether the Bedrock Agent Runtime client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in Bedrock.|false|boolean|
camel-aws-bedrock-agent.md ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws-bedrock-agent
2
+
3
+ **Since Camel 4.5**
4
+
5
+ **Both producer and consumer are supported**
6
+
7
+ The AWS2 Bedrock component supports invoking a supported LLM model from
8
+ [AWS Bedrock](https://aws.amazon.com/bedrock/) service.
9
+
10
+ Prerequisites
11
+
12
+ You must have a valid Amazon Web Services developer account, and be
13
+ signed up to use Amazon Bedrock. More information is available at
14
+ [Amazon Bedrock](https://aws.amazon.com/bedrock/).
15
+
16
+ # URI Format
17
+
18
+ aws-bedrock-agent-runtime://label[?options]
19
+
20
+ You can append query options to the URI in the following format:
21
+
22
+ `?options=value&option2=value&...`
23
+
24
+ Required Bedrock component options
25
+
26
+ You have to provide the bedrockRuntimeClient in the Registry or your
27
+ accessKey and secretKey to access the [Amazon
28
+ Bedrock](https://aws.amazon.com/bedrock/) service.
29
+
30
+ # Usage
31
+
32
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
33
+
34
+ You have the possibility of avoiding the usage of explicit static
35
+ credentials by specifying the useDefaultCredentialsProvider option and
36
+ set it to true.
37
+
38
+ The order of evaluation for Default Credentials Provider is the
39
+ following:
40
+
41
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
42
+
43
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
44
+ `AWS_SECRET_ACCESS_KEY`.
45
+
46
+ - Web Identity Token from AWS STS.
47
+
48
+ - The shared credentials and config files.
49
+
50
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
51
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
52
+ set.
53
+
54
+ - Amazon EC2 Instance profile credentials.
55
+
56
+ You have also the possibility of using Profile Credentials Provider, by
57
+ specifying the useProfileCredentialsProvider option to true and
58
+ profileCredentialsName to the profile name.
59
+
60
+ Only one of static, default and profile credentials could be used at the
61
+ same time.
62
+
63
+ For more information about this you can look at [AWS credentials
64
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
65
+
66
+ # Dependencies
67
+
68
+ Maven users will need to add the following dependency to their pom.xml.
69
+
70
+ **pom.xml**
71
+
72
+ <dependency>
73
+ <groupId>org.apache.camel</groupId>
74
+ <artifactId>camel-aws-bedrock</artifactId>
75
+ <version>${camel-version}</version>
76
+ </dependency>
77
+
78
+ where `${camel-version}` must be replaced by the actual version of
79
+ Camel.
80
+
81
+ ## Component Configurations
82
+
83
+
84
+ |Name|Description|Default|Type|
85
+ |---|---|---|---|
86
+ |configuration|Component configuration||object|
87
+ |dataSourceId|Define the Data source Id we are going to use||string|
88
+ |knowledgeBaseId|Define the Knowledge Base Id we are going to use||string|
89
+ |modelId|Define the model Id we are going to use||string|
90
+ |operation|The operation to perform||object|
91
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
92
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
93
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name|false|string|
94
+ |region|The region in which Bedrock Agent client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
95
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
96
+ |useDefaultCredentialsProvider|Set whether the Bedrock Agent client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
97
+ |useProfileCredentialsProvider|Set whether the Bedrock Agent client should expect to load credentials through a profile credentials provider.|false|boolean|
98
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
99
+ |ingestionJobId|Define the Ingestion Job Id we want to track||string|
100
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
101
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
102
+ |bedrockAgentClient|To use an existing configured AWS Bedrock Agent client||object|
103
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
104
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
105
+ |proxyHost|To define a proxy host when instantiating the Bedrock Agent client||string|
106
+ |proxyPort|To define a proxy port when instantiating the Bedrock Agent client||integer|
107
+ |proxyProtocol|To define a proxy protocol when instantiating the Bedrock Agent client|HTTPS|object|
108
+ |accessKey|Amazon AWS Access Key||string|
109
+ |secretKey|Amazon AWS Secret Key||string|
110
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
111
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
112
+ |useSessionCredentials|Set whether the Bedrock Agent client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in Bedrock.|false|boolean|
113
+
114
+ ## Endpoint Configurations
115
+
116
+
117
+ |Name|Description|Default|Type|
118
+ |---|---|---|---|
119
+ |label|Logical name||string|
120
+ |dataSourceId|Define the Data source Id we are going to use||string|
121
+ |knowledgeBaseId|Define the Knowledge Base Id we are going to use||string|
122
+ |modelId|Define the model Id we are going to use||string|
123
+ |operation|The operation to perform||object|
124
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
125
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
126
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name|false|string|
127
+ |region|The region in which Bedrock Agent client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
128
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
129
+ |useDefaultCredentialsProvider|Set whether the Bedrock Agent client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
130
+ |useProfileCredentialsProvider|Set whether the Bedrock Agent client should expect to load credentials through a profile credentials provider.|false|boolean|
131
+ |ingestionJobId|Define the Ingestion Job Id we want to track||string|
132
+ |sendEmptyMessageWhenIdle|If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead.|false|boolean|
133
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
134
+ |exceptionHandler|To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.||object|
135
+ |exchangePattern|Sets the exchange pattern when the consumer creates an exchange.||object|
136
+ |pollStrategy|A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel.||object|
137
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
138
+ |bedrockAgentClient|To use an existing configured AWS Bedrock Agent client||object|
139
+ |proxyHost|To define a proxy host when instantiating the Bedrock Agent client||string|
140
+ |proxyPort|To define a proxy port when instantiating the Bedrock Agent client||integer|
141
+ |proxyProtocol|To define a proxy protocol when instantiating the Bedrock Agent client|HTTPS|object|
142
+ |backoffErrorThreshold|The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in.||integer|
143
+ |backoffIdleThreshold|The number of subsequent idle polls that should happen before the backoffMultipler should kick-in.||integer|
144
+ |backoffMultiplier|To let the scheduled polling consumer backoff if there has been a number of subsequent idles/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and/or backoffErrorThreshold must also be configured.||integer|
145
+ |delay|Milliseconds before the next poll.|500|integer|
146
+ |greedy|If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages.|false|boolean|
147
+ |initialDelay|Milliseconds before the first poll starts.|1000|integer|
148
+ |repeatCount|Specifies a maximum limit of number of fires. So if you set it to 1, the scheduler will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever.|0|integer|
149
+ |runLoggingLevel|The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that.|TRACE|object|
150
+ |scheduledExecutorService|Allows for configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool.||object|
151
+ |scheduler|To use a cron scheduler from either camel-spring or camel-quartz component. Use value spring or quartz for built in scheduler|none|object|
152
+ |schedulerProperties|To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler.||object|
153
+ |startScheduler|Whether the scheduler should be auto started.|true|boolean|
154
+ |timeUnit|Time unit for initialDelay and delay options.|MILLISECONDS|object|
155
+ |useFixedDelay|Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details.|true|boolean|
156
+ |accessKey|Amazon AWS Access Key||string|
157
+ |secretKey|Amazon AWS Secret Key||string|
158
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
159
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
160
+ |useSessionCredentials|Set whether the Bedrock Agent client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in Bedrock.|false|boolean|
camel-aws-bedrock.md ADDED
@@ -0,0 +1,830 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws-bedrock
2
+
3
+ **Since Camel 4.5**
4
+
5
+ **Only producer is supported**
6
+
7
+ The AWS2 Bedrock component supports invoking a supported LLM model from
8
+ [AWS Bedrock](https://aws.amazon.com/bedrock/) service.
9
+
10
+ Prerequisites
11
+
12
+ You must have a valid Amazon Web Services developer account, and be
13
+ signed up to use Amazon Bedrock. More information is available at
14
+ [Amazon Bedrock](https://aws.amazon.com/bedrock/).
15
+
16
+ # URI Format
17
+
18
+ aws-bedrock://label[?options]
19
+
20
+ You can append query options to the URI in the following format:
21
+
22
+ `?options=value&option2=value&...`
23
+
24
+ Required Bedrock component options
25
+
26
+ You have to provide the bedrockRuntimeClient in the Registry or your
27
+ accessKey and secretKey to access the [Amazon
28
+ Bedrock](https://aws.amazon.com/bedrock/) service.
29
+
30
+ # Usage
31
+
32
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
33
+
34
+ You have the possibility of avoiding the usage of explicit static
35
+ credentials by specifying the useDefaultCredentialsProvider option and
36
+ set it to true.
37
+
38
+ The order of evaluation for Default Credentials Provider is the
39
+ following:
40
+
41
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
42
+
43
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
44
+ `AWS_SECRET_ACCESS_KEY`.
45
+
46
+ - Web Identity Token from AWS STS.
47
+
48
+ - The shared credentials and config files.
49
+
50
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
51
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
52
+ set.
53
+
54
+ - Amazon EC2 Instance profile credentials.
55
+
56
+ You have also the possibility of using Profile Credentials Provider, by
57
+ specifying the useProfileCredentialsProvider option to true and
58
+ profileCredentialsName to the profile name.
59
+
60
+ Only one of static, default and profile credentials could be used at the
61
+ same time.
62
+
63
+ For more information about this you can look at [AWS credentials
64
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
65
+
66
+ ## Supported AWS Bedrock Models
67
+
68
+ - Titan Text Express V1 with id `amazon.titan-text-express-v1` Express
69
+ is a large language model for text generation. It is useful for a
70
+ wide range of advanced, general language tasks such as open-ended
71
+ text generation and conversational chat, as well as support within
72
+ Retrieval Augmented Generation (RAG).
73
+
74
+ Json schema for request
75
+
76
+ {
77
+ "$schema": "http://json-schema.org/draft-04/schema#",
78
+ "type": "object",
79
+ "properties": {
80
+ "inputText": {
81
+ "type": "string"
82
+ },
83
+ "textGenerationConfig": {
84
+ "type": "object",
85
+ "properties": {
86
+ "maxTokenCount": {
87
+ "type": "integer"
88
+ },
89
+ "stopSequences": {
90
+ "type": "array",
91
+ "items": [
92
+ {
93
+ "type": "string"
94
+ }
95
+ ]
96
+ },
97
+ "temperature": {
98
+ "type": "integer"
99
+ },
100
+ "topP": {
101
+ "type": "integer"
102
+ }
103
+ },
104
+ "required": [
105
+ "maxTokenCount",
106
+ "stopSequences",
107
+ "temperature",
108
+ "topP"
109
+ ]
110
+ }
111
+ },
112
+ "required": [
113
+ "inputText",
114
+ "textGenerationConfig"
115
+ ]
116
+ }
117
+
118
+ - Titan Text Lite V1 with id `amazon.titan-text-lite-v1` Lite is a
119
+ light weight efficient model, ideal for fine-tuning of
120
+ English-language tasks.
121
+
122
+ Json schema for request
123
+
124
+ {
125
+ "$schema": "http://json-schema.org/draft-04/schema#",
126
+ "type": "object",
127
+ "properties": {
128
+ "inputText": {
129
+ "type": "string"
130
+ },
131
+ "textGenerationConfig": {
132
+ "type": "object",
133
+ "properties": {
134
+ "maxTokenCount": {
135
+ "type": "integer"
136
+ },
137
+ "stopSequences": {
138
+ "type": "array",
139
+ "items": [
140
+ {
141
+ "type": "string"
142
+ }
143
+ ]
144
+ },
145
+ "temperature": {
146
+ "type": "integer"
147
+ },
148
+ "topP": {
149
+ "type": "integer"
150
+ }
151
+ },
152
+ "required": [
153
+ "maxTokenCount",
154
+ "stopSequences",
155
+ "temperature",
156
+ "topP"
157
+ ]
158
+ }
159
+ },
160
+ "required": [
161
+ "inputText",
162
+ "textGenerationConfig"
163
+ ]
164
+ }
165
+
166
+ - Titan Image Generator G1 with id `amazon.titan-image-generator-v1`
167
+ It generates images from text, and allows users to upload and edit
168
+ an existing image. Users can edit an image with a text prompt
169
+ (without a mask) or parts of an image with an image mask. You can
170
+ extend the boundaries of an image with outpainting, and fill in an
171
+ image with inpainting.
172
+
173
+ Json schema for request
174
+
175
+ {
176
+ "$schema": "http://json-schema.org/draft-04/schema#",
177
+ "type": "object",
178
+ "properties": {
179
+ "textToImageParams": {
180
+ "type": "object",
181
+ "properties": {
182
+ "text": {
183
+ "type": "string"
184
+ },
185
+ "negativeText": {
186
+ "type": "string"
187
+ }
188
+ },
189
+ "required": [
190
+ "text",
191
+ "negativeText"
192
+ ]
193
+ },
194
+ "taskType": {
195
+ "type": "string"
196
+ },
197
+ "imageGenerationConfig": {
198
+ "type": "object",
199
+ "properties": {
200
+ "cfgScale": {
201
+ "type": "integer"
202
+ },
203
+ "seed": {
204
+ "type": "integer"
205
+ },
206
+ "quality": {
207
+ "type": "string"
208
+ },
209
+ "width": {
210
+ "type": "integer"
211
+ },
212
+ "height": {
213
+ "type": "integer"
214
+ },
215
+ "numberOfImages": {
216
+ "type": "integer"
217
+ }
218
+ },
219
+ "required": [
220
+ "cfgScale",
221
+ "seed",
222
+ "quality",
223
+ "width",
224
+ "height",
225
+ "numberOfImages"
226
+ ]
227
+ }
228
+ },
229
+ "required": [
230
+ "textToImageParams",
231
+ "taskType",
232
+ "imageGenerationConfig"
233
+ ]
234
+ }
235
+
236
+ - Titan Embeddings G1 with id `amazon.titan-embed-text-v1` The Amazon
237
+ Titan Embeddings G1 - Text – Text v1.2 can intake up to 8k tokens
238
+ and outputs a vector of 1,536 dimensions. The model also works in
239
+ 25+ different language
240
+
241
+ Json schema for request
242
+
243
+ {
244
+ "$schema": "http://json-schema.org/draft-04/schema#",
245
+ "type": "object",
246
+ "properties": {
247
+ "inputText": {
248
+ "type": "string"
249
+ }
250
+ },
251
+ "required": [
252
+ "inputText"
253
+ ]
254
+ }
255
+
256
+ - Jurassic2-Ultra with id `ai21.j2-ultra-v1` Jurassic-2 Ultra is
257
+ AI21’s most powerful model for complex tasks that require advanced
258
+ text generation and comprehension.
259
+
260
+ Json schema for request
261
+
262
+ {
263
+ "$schema": "http://json-schema.org/draft-04/schema#",
264
+ "type": "object",
265
+ "properties": {
266
+ "prompt": {
267
+ "type": "string"
268
+ },
269
+ "maxTokens": {
270
+ "type": "integer"
271
+ },
272
+ "temperature": {
273
+ "type": "integer"
274
+ },
275
+ "topP": {
276
+ "type": "integer"
277
+ },
278
+ "stopSequences": {
279
+ "type": "array",
280
+ "items": [
281
+ {
282
+ "type": "string"
283
+ }
284
+ ]
285
+ },
286
+ "presencePenalty": {
287
+ "type": "object",
288
+ "properties": {
289
+ "scale": {
290
+ "type": "integer"
291
+ }
292
+ },
293
+ "required": [
294
+ "scale"
295
+ ]
296
+ },
297
+ "frequencyPenalty": {
298
+ "type": "object",
299
+ "properties": {
300
+ "scale": {
301
+ "type": "integer"
302
+ }
303
+ },
304
+ "required": [
305
+ "scale"
306
+ ]
307
+ }
308
+ },
309
+ "required": [
310
+ "prompt",
311
+ "maxTokens",
312
+ "temperature",
313
+ "topP",
314
+ "stopSequences",
315
+ "presencePenalty",
316
+ "frequencyPenalty"
317
+ ]
318
+ }
319
+
320
+ - Jurassic2-Mid with id `ai21.j2-mid-v1` Jurassic-2 Mid is less
321
+ powerful than Ultra, yet carefully designed to strike the right
322
+ balance between exceptional quality and affordability.
323
+
324
+ Json schema for request
325
+
326
+ {
327
+ "$schema": "http://json-schema.org/draft-04/schema#",
328
+ "type": "object",
329
+ "properties": {
330
+ "prompt": {
331
+ "type": "string"
332
+ },
333
+ "maxTokens": {
334
+ "type": "integer"
335
+ },
336
+ "temperature": {
337
+ "type": "integer"
338
+ },
339
+ "topP": {
340
+ "type": "integer"
341
+ },
342
+ "stopSequences": {
343
+ "type": "array",
344
+ "items": [
345
+ {
346
+ "type": "string"
347
+ }
348
+ ]
349
+ },
350
+ "presencePenalty": {
351
+ "type": "object",
352
+ "properties": {
353
+ "scale": {
354
+ "type": "integer"
355
+ }
356
+ },
357
+ "required": [
358
+ "scale"
359
+ ]
360
+ },
361
+ "frequencyPenalty": {
362
+ "type": "object",
363
+ "properties": {
364
+ "scale": {
365
+ "type": "integer"
366
+ }
367
+ },
368
+ "required": [
369
+ "scale"
370
+ ]
371
+ }
372
+ },
373
+ "required": [
374
+ "prompt",
375
+ "maxTokens",
376
+ "temperature",
377
+ "topP",
378
+ "stopSequences",
379
+ "presencePenalty",
380
+ "frequencyPenalty"
381
+ ]
382
+ }
383
+
384
+ - Claude Instant V1.2 with id `anthropic.claude-instant-v1` A fast,
385
+ affordable yet still very capable model, which can handle a range of
386
+ tasks including casual dialogue, text analysis, summarization, and
387
+ document question-answering.
388
+
389
+ Json schema for request
390
+
391
+ {
392
+ "$schema": "http://json-schema.org/draft-04/schema#",
393
+ "type": "object",
394
+ "properties": {
395
+ "prompt": {
396
+ "type": "string"
397
+ },
398
+ "max_tokens_to_sample": {
399
+ "type": "integer"
400
+ },
401
+ "stop_sequences": {
402
+ "type": "array",
403
+ "items": [
404
+ {
405
+ "type": "string"
406
+ }
407
+ ]
408
+ },
409
+ "temperature": {
410
+ "type": "number"
411
+ },
412
+ "top_p": {
413
+ "type": "integer"
414
+ },
415
+ "top_k": {
416
+ "type": "integer"
417
+ },
418
+ "anthropic_version": {
419
+ "type": "string"
420
+ }
421
+ },
422
+ "required": [
423
+ "prompt",
424
+ "max_tokens_to_sample",
425
+ "stop_sequences",
426
+ "temperature",
427
+ "top_p",
428
+ "top_k",
429
+ "anthropic_version"
430
+ ]
431
+ }
432
+
433
+ - Claude 2 with id `anthropic.claude-v2` Anthropic’s highly capable
434
+ model across a wide range of tasks from sophisticated dialogue and
435
+ creative content generation to detailed instruction following.
436
+
437
+ Json schema for request
438
+
439
+ {
440
+ "$schema": "http://json-schema.org/draft-04/schema#",
441
+ "type": "object",
442
+ "properties": {
443
+ "prompt": {
444
+ "type": "string"
445
+ },
446
+ "max_tokens_to_sample": {
447
+ "type": "integer"
448
+ },
449
+ "stop_sequences": {
450
+ "type": "array",
451
+ "items": [
452
+ {
453
+ "type": "string"
454
+ }
455
+ ]
456
+ },
457
+ "temperature": {
458
+ "type": "number"
459
+ },
460
+ "top_p": {
461
+ "type": "integer"
462
+ },
463
+ "top_k": {
464
+ "type": "integer"
465
+ },
466
+ "anthropic_version": {
467
+ "type": "string"
468
+ }
469
+ },
470
+ "required": [
471
+ "prompt",
472
+ "max_tokens_to_sample",
473
+ "stop_sequences",
474
+ "temperature",
475
+ "top_p",
476
+ "top_k",
477
+ "anthropic_version"
478
+ ]
479
+ }
480
+
481
+ - Claude 2.1 with id `anthropic.claude-v2:1` An update to Claude 2
482
+ that features double the context window, plus improvements across
483
+ reliability, hallucination rates, and evidence-based accuracy in
484
+ long document and RAG contexts.
485
+
486
+ Json schema for request
487
+
488
+ {
489
+ "$schema": "http://json-schema.org/draft-04/schema#",
490
+ "type": "object",
491
+ "properties": {
492
+ "prompt": {
493
+ "type": "string"
494
+ },
495
+ "max_tokens_to_sample": {
496
+ "type": "integer"
497
+ },
498
+ "stop_sequences": {
499
+ "type": "array",
500
+ "items": [
501
+ {
502
+ "type": "string"
503
+ }
504
+ ]
505
+ },
506
+ "temperature": {
507
+ "type": "number"
508
+ },
509
+ "top_p": {
510
+ "type": "integer"
511
+ },
512
+ "top_k": {
513
+ "type": "integer"
514
+ },
515
+ "anthropic_version": {
516
+ "type": "string"
517
+ }
518
+ },
519
+ "required": [
520
+ "prompt",
521
+ "max_tokens_to_sample",
522
+ "stop_sequences",
523
+ "temperature",
524
+ "top_p",
525
+ "top_k",
526
+ "anthropic_version"
527
+ ]
528
+ }
529
+
530
+ - Claude 3 Sonnet with id `anthropic.claude-3-sonnet-20240229-v1:0`
531
+ Claude 3 Sonnet by Anthropic strikes the ideal balance between
532
+ intelligence and speed—particularly for enterprise workloads.
533
+
534
+ Json schema for request
535
+
536
+ {
537
+ "$schema": "http://json-schema.org/draft-04/schema#",
538
+ "type": "object",
539
+ "properties": {
540
+ "messages": {
541
+ "type": "array",
542
+ "items": [
543
+ {
544
+ "type": "object",
545
+ "properties": {
546
+ "role": {
547
+ "type": "string"
548
+ },
549
+ "content": {
550
+ "type": "array",
551
+ "items": [
552
+ {
553
+ "type": "object",
554
+ "properties": {
555
+ "type": {
556
+ "type": "string"
557
+ },
558
+ "text": {
559
+ "type": "string"
560
+ }
561
+ },
562
+ "required": [
563
+ "type",
564
+ "text"
565
+ ]
566
+ }
567
+ ]
568
+ }
569
+ },
570
+ "required": [
571
+ "role",
572
+ "content"
573
+ ]
574
+ }
575
+ ]
576
+ },
577
+ "max_tokens": {
578
+ "type": "integer"
579
+ },
580
+ "anthropic_version": {
581
+ "type": "string"
582
+ }
583
+ },
584
+ "required": [
585
+ "messages",
586
+ "max_tokens",
587
+ "anthropic_version"
588
+ ]
589
+ }
590
+
591
+ - Claude 3 Haiku with id `anthropic.claude-3-haiku-20240307-v1:0`
592
+ Claude 3 Haiku is Anthropic’s fastest, most compact model for
593
+ near-instant responsiveness. It answers simple queries and requests
594
+ with speed.
595
+
596
+ Json schema for request
597
+
598
+ {
599
+ "$schema": "http://json-schema.org/draft-04/schema#",
600
+ "type": "object",
601
+ "properties": {
602
+ "messages": {
603
+ "type": "array",
604
+ "items": [
605
+ {
606
+ "type": "object",
607
+ "properties": {
608
+ "role": {
609
+ "type": "string"
610
+ },
611
+ "content": {
612
+ "type": "array",
613
+ "items": [
614
+ {
615
+ "type": "object",
616
+ "properties": {
617
+ "type": {
618
+ "type": "string"
619
+ },
620
+ "text": {
621
+ "type": "string"
622
+ }
623
+ },
624
+ "required": [
625
+ "type",
626
+ "text"
627
+ ]
628
+ }
629
+ ]
630
+ }
631
+ },
632
+ "required": [
633
+ "role",
634
+ "content"
635
+ ]
636
+ }
637
+ ]
638
+ },
639
+ "max_tokens": {
640
+ "type": "integer"
641
+ },
642
+ "anthropic_version": {
643
+ "type": "string"
644
+ }
645
+ },
646
+ "required": [
647
+ "messages",
648
+ "max_tokens",
649
+ "anthropic_version"
650
+ ]
651
+ }
652
+
653
+ ## Bedrock Producer operations
654
+
655
+ Camel-AWS Bedrock component provides the following operation on the
656
+ producer side:
657
+
658
+ - invokeTextModel
659
+
660
+ - invokeImageModel
661
+
662
+ - invokeEmbeddingsModel
663
+
664
+ # Producer Examples
665
+
666
+ - invokeTextModel: this operation will invoke a model from Bedrock.
667
+ This is an example for both Titan Express and Titan Lite.
668
+
669
+ <!-- -->
670
+
671
+ from("direct:invoke")
672
+ .to("aws-bedrock://test?bedrockRuntimeClient=#amazonBedrockRuntimeClient&operation=invokeTextModel&modelId="
673
+ + BedrockModels.TITAN_TEXT_EXPRESS_V1.model))
674
+
675
+ and you can then send to the direct endpoint something like
676
+
677
+ final Exchange result = template.send("direct:invoke", exchange -> {
678
+ ObjectMapper mapper = new ObjectMapper();
679
+ ObjectNode rootNode = mapper.createObjectNode();
680
+ rootNode.put("inputText",
681
+ "User: Generate synthetic data for daily product sales in various categories - include row number, product name, category, date of sale and price. Produce output in JSON format. Count records and ensure there are no more than 5.");
682
+
683
+ ArrayNode stopSequences = mapper.createArrayNode();
684
+ stopSequences.add("User:");
685
+ ObjectNode childNode = mapper.createObjectNode();
686
+ childNode.put("maxTokenCount", 1024);
687
+ childNode.put("stopSequences", stopSequences);
688
+ childNode.put("temperature", 0).put("topP", 1);
689
+
690
+ rootNode.put("textGenerationConfig", childNode);
691
+ exchange.getMessage().setBody(mapper.writer().writeValueAsString(rootNode));
692
+ exchange.getMessage().setHeader(BedrockConstants.MODEL_CONTENT_TYPE, "application/json");
693
+ exchange.getMessage().setHeader(BedrockConstants.MODEL_ACCEPT_CONTENT_TYPE, "application/json");
694
+ });
695
+
696
+ where template is a ProducerTemplate.
697
+
698
+ - invokeImageModel: this operation will invoke a model from Bedrock.
699
+ This is an example for both Titan Express and Titan Lite.
700
+
701
+ <!-- -->
702
+
703
+ from("direct:invoke")
704
+ .to("aws-bedrock://test?bedrockRuntimeClient=#amazonBedrockRuntimeClient&operation=invokeImageModel&modelId="
705
+ + BedrockModels.TITAN_IMAGE_GENERATOR_V1.model))
706
+ .split(body())
707
+ .unmarshal().base64()
708
+ .setHeader("CamelFileName", simple("image-${random(128)}.png")).to("file:target/generated_images")
709
+
710
+ and you can then send to the direct endpoint something like
711
+
712
+ final Exchange result = template.send("direct:send_titan_image", exchange -> {
713
+ ObjectMapper mapper = new ObjectMapper();
714
+ ObjectNode rootNode = mapper.createObjectNode();
715
+ ObjectNode textParameter = mapper.createObjectNode();
716
+ textParameter.putIfAbsent("text",
717
+ new TextNode("A Sci-fi camel running in the desert"));
718
+ rootNode.putIfAbsent("textToImageParams", textParameter);
719
+ rootNode.putIfAbsent("taskType", new TextNode("TEXT_IMAGE"));
720
+ ObjectNode childNode = mapper.createObjectNode();
721
+ childNode.putIfAbsent("numberOfImages", new IntNode(3));
722
+ childNode.putIfAbsent("quality", new TextNode("standard"));
723
+ childNode.putIfAbsent("cfgScale", new IntNode(8));
724
+ childNode.putIfAbsent("height", new IntNode(512));
725
+ childNode.putIfAbsent("width", new IntNode(512));
726
+ childNode.putIfAbsent("seed", new IntNode(0));
727
+
728
+ rootNode.putIfAbsent("imageGenerationConfig", childNode);
729
+
730
+ exchange.getMessage().setBody(mapper.writer().writeValueAsString(rootNode));
731
+ exchange.getMessage().setHeader(BedrockConstants.MODEL_CONTENT_TYPE, "application/json");
732
+ exchange.getMessage().setHeader(BedrockConstants.MODEL_ACCEPT_CONTENT_TYPE, "application/json");
733
+ });
734
+
735
+ where template is a ProducerTemplate.
736
+
737
+ - invokeEmbeddingsModel: this operation will invoke an Embeddings
738
+ model from Bedrock. This is an example for Titan Embeddings G1.
739
+
740
+ <!-- -->
741
+
742
+ from("direct:send_titan_embeddings")
743
+ .to("aws-bedrock:label?useDefaultCredentialsProvider=true&region=us-east-1&operation=invokeEmbeddingsModel&modelId="
744
+ + BedrockModels.TITAN_EMBEDDINGS_G1.model)
745
+ .to(result);
746
+
747
+ and you can then send to the direct endpoint something like
748
+
749
+ final Exchange result = template.send("direct:send_titan_embeddings", exchange -> {
750
+ ObjectMapper mapper = new ObjectMapper();
751
+ ObjectNode rootNode = mapper.createObjectNode();
752
+ rootNode.putIfAbsent("inputText",
753
+ new TextNode("A Sci-fi camel running in the desert"));
754
+
755
+ exchange.getMessage().setBody(mapper.writer().writeValueAsString(rootNode));
756
+ exchange.getMessage().setHeader(BedrockConstants.MODEL_CONTENT_TYPE, "application/json");
757
+ exchange.getMessage().setHeader(BedrockConstants.MODEL_ACCEPT_CONTENT_TYPE, "*/*");
758
+ });
759
+
760
+ where template is a ProducerTemplate.
761
+
762
+ # Dependencies
763
+
764
+ Maven users will need to add the following dependency to their pom.xml.
765
+
766
+ **pom.xml**
767
+
768
+ <dependency>
769
+ <groupId>org.apache.camel</groupId>
770
+ <artifactId>camel-aws-bedrock</artifactId>
771
+ <version>${camel-version}</version>
772
+ </dependency>
773
+
774
+ where `${camel-version}` must be replaced by the actual version of
775
+ Camel.
776
+
777
+ ## Component Configurations
778
+
779
+
780
+ |Name|Description|Default|Type|
781
+ |---|---|---|---|
782
+ |configuration|Component configuration||object|
783
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
784
+ |modelId|Define the model Id we are going to use||string|
785
+ |operation|The operation to perform||object|
786
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
787
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
788
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name|false|string|
789
+ |region|The region in which Bedrock client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
790
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
791
+ |useDefaultCredentialsProvider|Set whether the Bedrock client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
792
+ |useProfileCredentialsProvider|Set whether the Bedrock client should expect to load credentials through a profile credentials provider.|false|boolean|
793
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
794
+ |bedrockRuntimeClient|To use an existing configured AWS Bedrock Runtime client||object|
795
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
796
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
797
+ |proxyHost|To define a proxy host when instantiating the Bedrock client||string|
798
+ |proxyPort|To define a proxy port when instantiating the Bedrock client||integer|
799
+ |proxyProtocol|To define a proxy protocol when instantiating the Bedrock client|HTTPS|object|
800
+ |accessKey|Amazon AWS Access Key||string|
801
+ |secretKey|Amazon AWS Secret Key||string|
802
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
803
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
804
+ |useSessionCredentials|Set whether the Bedrock client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in Bedrock.|false|boolean|
805
+
806
+ ## Endpoint Configurations
807
+
808
+
809
+ |Name|Description|Default|Type|
810
+ |---|---|---|---|
811
+ |label|Logical name||string|
812
+ |modelId|Define the model Id we are going to use||string|
813
+ |operation|The operation to perform||object|
814
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
815
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
816
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name|false|string|
817
+ |region|The region in which Bedrock client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
818
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
819
+ |useDefaultCredentialsProvider|Set whether the Bedrock client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
820
+ |useProfileCredentialsProvider|Set whether the Bedrock client should expect to load credentials through a profile credentials provider.|false|boolean|
821
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
822
+ |bedrockRuntimeClient|To use an existing configured AWS Bedrock Runtime client||object|
823
+ |proxyHost|To define a proxy host when instantiating the Bedrock client||string|
824
+ |proxyPort|To define a proxy port when instantiating the Bedrock client||integer|
825
+ |proxyProtocol|To define a proxy protocol when instantiating the Bedrock client|HTTPS|object|
826
+ |accessKey|Amazon AWS Access Key||string|
827
+ |secretKey|Amazon AWS Secret Key||string|
828
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
829
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
830
+ |useSessionCredentials|Set whether the Bedrock client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in Bedrock.|false|boolean|
camel-aws-cloudtrail.md ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws-cloudtrail
2
+
3
+ **Since Camel 3.19**
4
+
5
+ **Only consumer is supported**
6
+
7
+ The AWS Cloudtrail component supports receiving events from Amazon
8
+ Cloudtrail service.
9
+
10
+ Prerequisites
11
+
12
+ You must have a valid Amazon Web Services developer account, and be
13
+ signed up to use Amazon Cloudtrail. More information is available at
14
+ [AWS Cloudtrail](https://aws.amazon.com/cloudtrail/)
15
+
16
+ # Static credentials, Default Credential Provider and Profile Credentials Provider
17
+
18
+ You have the possibility of avoiding the usage of explicit static
19
+ credentials by specifying the useDefaultCredentialsProvider option and
20
+ set it to true.
21
+
22
+ The order of evaluation for Default Credentials Provider is the
23
+ following:
24
+
25
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
26
+
27
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
28
+ `AWS_SECRET_ACCESS_KEY`.
29
+
30
+ - Web Identity Token from AWS STS.
31
+
32
+ - The shared credentials and config files.
33
+
34
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
35
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
36
+ set.
37
+
38
+ - Amazon EC2 Instance profile credentials.
39
+
40
+ You have also the possibility of using Profile Credentials Provider, by
41
+ specifying the useProfileCredentialsProvider option to true and
42
+ profileCredentialsName to the profile name.
43
+
44
+ Only one of static, default and profile credentials could be used at the
45
+ same time.
46
+
47
+ For more information about this you can look at [AWS credentials
48
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
49
+
50
+ # Cloudtrail Events consumed
51
+
52
+ The Cloudtrail consumer will use an API method called LookupEvents.
53
+
54
+ This method will only take into account management events like
55
+ create/update/delete of resources and Cloudtrail insight events where
56
+ enabled.
57
+
58
+ This means you won’t consume the events registered in the Cloudtrail
59
+ logs stored on S3, in case of creation of a new Trail.
60
+
61
+ This is important to notice, and it must be taken into account when
62
+ using this component.
63
+
64
+ # URI Format
65
+
66
+ aws-cloudtrail://label[?options]
67
+
68
+ The stream needs to be created prior to it being used.
69
+
70
+ You can append query options to the URI in the following format:
71
+
72
+ `?options=value&option2=value&...`
73
+
74
+ ## Component Configurations
75
+
76
+
77
+ |Name|Description|Default|Type|
78
+ |---|---|---|---|
79
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
80
+ |configuration|Component configuration||object|
81
+ |eventSource|Specify an event source to select events||string|
82
+ |maxResults|Maximum number of records that will be fetched in each poll|1|integer|
83
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with uriEndpointOverride option|false|boolean|
84
+ |region|The region in which Cloudtrail client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
85
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
86
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
87
+ |cloudTrailClient|Amazon Cloudtrail client to use for all requests for this endpoint||object|
88
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
89
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
90
+ |proxyHost|To define a proxy host when instantiating the Cloudtrail client||string|
91
+ |proxyPort|To define a proxy port when instantiating the Cloudtrail client||integer|
92
+ |proxyProtocol|To define a proxy protocol when instantiating the Cloudtrail client|HTTPS|object|
93
+ |accessKey|Amazon AWS Access Key||string|
94
+ |profileCredentialsName|If using a profile credentials provider this parameter will set the profile name.||string|
95
+ |secretKey|Amazon AWS Secret Key||string|
96
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume a IAM role||string|
97
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
98
+ |useDefaultCredentialsProvider|Set whether the Cloudtrail client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
99
+ |useProfileCredentialsProvider|Set whether the Cloudtrail client should expect to load credentials through a profile credentials provider.|false|boolean|
100
+ |useSessionCredentials|Set whether the CloudTrail client should expect to use Session Credentials. This is useful in situation in which the user needs to assume a IAM role for doing operations in CloudTrail.|false|boolean|
101
+
102
+ ## Endpoint Configurations
103
+
104
+
105
+ |Name|Description|Default|Type|
106
+ |---|---|---|---|
107
+ |label|A label for indexing cloudtrail endpoints||string|
108
+ |eventSource|Specify an event source to select events||string|
109
+ |maxResults|Maximum number of records that will be fetched in each poll|1|integer|
110
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with uriEndpointOverride option|false|boolean|
111
+ |region|The region in which Cloudtrail client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
112
+ |sendEmptyMessageWhenIdle|If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead.|false|boolean|
113
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
114
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
115
+ |exceptionHandler|To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.||object|
116
+ |exchangePattern|Sets the exchange pattern when the consumer creates an exchange.||object|
117
+ |pollStrategy|A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel.||object|
118
+ |cloudTrailClient|Amazon Cloudtrail client to use for all requests for this endpoint||object|
119
+ |proxyHost|To define a proxy host when instantiating the Cloudtrail client||string|
120
+ |proxyPort|To define a proxy port when instantiating the Cloudtrail client||integer|
121
+ |proxyProtocol|To define a proxy protocol when instantiating the Cloudtrail client|HTTPS|object|
122
+ |backoffErrorThreshold|The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in.||integer|
123
+ |backoffIdleThreshold|The number of subsequent idle polls that should happen before the backoffMultipler should kick-in.||integer|
124
+ |backoffMultiplier|To let the scheduled polling consumer backoff if there has been a number of subsequent idles/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and/or backoffErrorThreshold must also be configured.||integer|
125
+ |delay|Milliseconds before the next poll.|500|integer|
126
+ |greedy|If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages.|false|boolean|
127
+ |initialDelay|Milliseconds before the first poll starts.|1000|integer|
128
+ |repeatCount|Specifies a maximum limit of number of fires. So if you set it to 1, the scheduler will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever.|0|integer|
129
+ |runLoggingLevel|The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that.|TRACE|object|
130
+ |scheduledExecutorService|Allows for configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool.||object|
131
+ |scheduler|To use a cron scheduler from either camel-spring or camel-quartz component. Use value spring or quartz for built in scheduler|none|object|
132
+ |schedulerProperties|To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler.||object|
133
+ |startScheduler|Whether the scheduler should be auto started.|true|boolean|
134
+ |timeUnit|Time unit for initialDelay and delay options.|MILLISECONDS|object|
135
+ |useFixedDelay|Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details.|true|boolean|
136
+ |accessKey|Amazon AWS Access Key||string|
137
+ |profileCredentialsName|If using a profile credentials provider this parameter will set the profile name.||string|
138
+ |secretKey|Amazon AWS Secret Key||string|
139
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume a IAM role||string|
140
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
141
+ |useDefaultCredentialsProvider|Set whether the Cloudtrail client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
142
+ |useProfileCredentialsProvider|Set whether the Cloudtrail client should expect to load credentials through a profile credentials provider.|false|boolean|
143
+ |useSessionCredentials|Set whether the CloudTrail client should expect to use Session Credentials. This is useful in situation in which the user needs to assume a IAM role for doing operations in CloudTrail.|false|boolean|
camel-aws-config.md ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws-config
2
+
3
+ **Since Camel 4.3**
4
+
5
+ **Only producer is supported**
6
+
7
+ The AWS Config component supports create and delete config rules [AWS
8
+ ECS](https://aws.amazon.com/config/) clusters instances.
9
+
10
+ Prerequisites
11
+
12
+ You must have a valid Amazon Web Services developer account, and be
13
+ signed up to use Amazon Config. More information is available at [Amazon
14
+ Config](https://aws.amazon.com/config/).
15
+
16
+ # URI Format
17
+
18
+ aws-config://label[?options]
19
+
20
+ You can append query options to the URI in the following format:
21
+
22
+ `?options=value&option2=value&...`
23
+
24
+ Required Config component options
25
+
26
+ You have to provide the ConfigClient in the Registry or your accessKey
27
+ and secretKey to access the [Amazon
28
+ Config](https://aws.amazon.com/config/) service.
29
+
30
+ # Usage
31
+
32
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
33
+
34
+ You have the possibility of avoiding the usage of explicit static
35
+ credentials by specifying the useDefaultCredentialsProvider option and
36
+ set it to true.
37
+
38
+ The order of evaluation for Default Credentials Provider is the
39
+ following:
40
+
41
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
42
+
43
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
44
+ `AWS_SECRET_ACCESS_KEY`.
45
+
46
+ - Web Identity Token from AWS STS.
47
+
48
+ - The shared credentials and config files.
49
+
50
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
51
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
52
+ set.
53
+
54
+ - Amazon EC2 Instance profile credentials.
55
+
56
+ You have also the possibility of using Profile Credentials Provider, by
57
+ specifying the useProfileCredentialsProvider option to true and
58
+ profileCredentialsName to the profile name.
59
+
60
+ Only one of static, default and profile credentials could be used at the
61
+ same time.
62
+
63
+ For more information about this you can look at [AWS credentials
64
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
65
+
66
+ ## Component Configurations
67
+
68
+
69
+ |Name|Description|Default|Type|
70
+ |---|---|---|---|
71
+ |configuration|Component configuration||object|
72
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
73
+ |operation|The operation to perform||object|
74
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
75
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
76
+ |region|The region in which the Config client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
77
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
78
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
79
+ |configClient|Amazon AWS Config Client instance||object|
80
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
81
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
82
+ |proxyHost|To define a proxy host when instantiating the Config client||string|
83
+ |proxyPort|To define a proxy port when instantiating the Config client||integer|
84
+ |proxyProtocol|To define a proxy protocol when instantiating the Config client|HTTPS|object|
85
+ |accessKey|Amazon AWS Access Key||string|
86
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
87
+ |secretKey|Amazon AWS Secret Key||string|
88
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
89
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
90
+ |useDefaultCredentialsProvider|Set whether the Config client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
91
+ |useProfileCredentialsProvider|Set whether the Config client should expect to load credentials through a profile credentials provider.|false|boolean|
92
+ |useSessionCredentials|Set whether the Config client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in Config.|false|boolean|
93
+
94
+ ## Endpoint Configurations
95
+
96
+
97
+ |Name|Description|Default|Type|
98
+ |---|---|---|---|
99
+ |label|Logical name||string|
100
+ |operation|The operation to perform||object|
101
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
102
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
103
+ |region|The region in which the Config client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
104
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
105
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
106
+ |configClient|Amazon AWS Config Client instance||object|
107
+ |proxyHost|To define a proxy host when instantiating the Config client||string|
108
+ |proxyPort|To define a proxy port when instantiating the Config client||integer|
109
+ |proxyProtocol|To define a proxy protocol when instantiating the Config client|HTTPS|object|
110
+ |accessKey|Amazon AWS Access Key||string|
111
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
112
+ |secretKey|Amazon AWS Secret Key||string|
113
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
114
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
115
+ |useDefaultCredentialsProvider|Set whether the Config client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
116
+ |useProfileCredentialsProvider|Set whether the Config client should expect to load credentials through a profile credentials provider.|false|boolean|
117
+ |useSessionCredentials|Set whether the Config client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in Config.|false|boolean|
camel-aws-secrets-manager.md ADDED
@@ -0,0 +1,393 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws-secrets-manager
2
+
3
+ **Since Camel 3.9**
4
+
5
+ **Only producer is supported**
6
+
7
+ The AWS Secrets Manager component supports list secret [AWS Secrets
8
+ Manager](https://aws.amazon.com/secrets-manager/) service.
9
+
10
+ Prerequisites
11
+
12
+ You must have a valid Amazon Web Services developer account, and be
13
+ signed up to use Amazon Secrets Manager. More information is available
14
+ at [AWS Secrets Manager](https://aws.amazon.com/secrets-manager/).
15
+
16
+ # URI Format
17
+
18
+ aws-secrets-manager://label[?options]
19
+
20
+ You can append query options to the URI in the following format:
21
+
22
+ `?options=value&option2=value&...`
23
+
24
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
25
+
26
+ You have the possibility of avoiding the usage of explicit static
27
+ credentials by specifying the useDefaultCredentialsProvider option and
28
+ set it to true.
29
+
30
+ The order of evaluation for Default Credentials Provider is the
31
+ following:
32
+
33
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
34
+
35
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
36
+ `AWS_SECRET_ACCESS_KEY`.
37
+
38
+ - Web Identity Token from AWS STS.
39
+
40
+ - The shared credentials and config files.
41
+
42
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
43
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
44
+ set.
45
+
46
+ - Amazon EC2 Instance profile credentials.
47
+
48
+ You have also the possibility of using Profile Credentials Provider, by
49
+ specifying the useProfileCredentialsProvider option to true and
50
+ profileCredentialsName to the profile name.
51
+
52
+ Only one of static, default and profile credentials could be used at the
53
+ same time.
54
+
55
+ For more information about this you can look at [AWS credentials
56
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
57
+
58
+ ## Using AWS Secrets Manager Property Function
59
+
60
+ To use this function, you’ll need to provide credentials to AWS Secrets
61
+ Manager Service as environment variables:
62
+
63
+ export $CAMEL_VAULT_AWS_ACCESS_KEY=accessKey
64
+ export $CAMEL_VAULT_AWS_SECRET_KEY=secretKey
65
+ export $CAMEL_VAULT_AWS_REGION=region
66
+
67
+ You can also configure the credentials in the `application.properties`
68
+ file such as:
69
+
70
+ camel.vault.aws.accessKey = accessKey
71
+ camel.vault.aws.secretKey = secretKey
72
+ camel.vault.aws.region = region
73
+
74
+ If you want instead to use the [AWS default credentials
75
+ provider](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html),
76
+ you’ll need to provide the following env variables:
77
+
78
+ export $CAMEL_VAULT_AWS_USE_DEFAULT_CREDENTIALS_PROVIDER=true
79
+ export $CAMEL_VAULT_AWS_REGION=region
80
+
81
+ You can also configure the credentials in the `application.properties`
82
+ file such as:
83
+
84
+ camel.vault.aws.defaultCredentialsProvider = true
85
+ camel.vault.aws.region = region
86
+
87
+ It is also possible to specify a particular profile name for accessing
88
+ AWS Secrets Manager
89
+
90
+ export $CAMEL_VAULT_AWS_USE_PROFILE_CREDENTIALS_PROVIDER=true
91
+ export $CAMEL_VAULT_AWS_PROFILE_NAME=test-account
92
+ export $CAMEL_VAULT_AWS_REGION=region
93
+
94
+ You can also configure the credentials in the `application.properties`
95
+ file such as:
96
+
97
+ camel.vault.aws.profileCredentialsProvider = true
98
+ camel.vault.aws.profileName = test-account
99
+ camel.vault.aws.region = region
100
+
101
+ At this point, you’ll be able to reference a property in the following
102
+ way:
103
+
104
+ <camelContext>
105
+ <route>
106
+ <from uri="direct:start"/>
107
+ <to uri="{{aws:route}}"/>
108
+ </route>
109
+ </camelContext>
110
+
111
+ Where route will be the name of the secret stored in the AWS Secrets
112
+ Manager Service.
113
+
114
+ You could specify a default value in case the secret is not present on
115
+ AWS Secret Manager:
116
+
117
+ <camelContext>
118
+ <route>
119
+ <from uri="direct:start"/>
120
+ <to uri="{{aws:route:default}}"/>
121
+ </route>
122
+ </camelContext>
123
+
124
+ In this case, if the secret doesn’t exist, the property will fall back
125
+ to "default" as value.
126
+
127
+ Also, you are able to get a particular field of the secret, if you have,
128
+ for example, a secret named database of this form:
129
+
130
+ {
131
+ "username": "admin",
132
+ "password": "password123",
133
+ "engine": "postgres",
134
+ "host": "127.0.0.1",
135
+ "port": "3128",
136
+ "dbname": "db"
137
+ }
138
+
139
+ You’re able to do get single secret value in your route, like for
140
+ example:
141
+
142
+ <camelContext>
143
+ <route>
144
+ <from uri="direct:start"/>
145
+ <log message="Username is {{aws:database/username}}"/>
146
+ </route>
147
+ </camelContext>
148
+
149
+ Or re-use the property as part of an endpoint.
150
+
151
+ You could specify a default value in case the particular field of secret
152
+ is not present on AWS Secret Manager:
153
+
154
+ <camelContext>
155
+ <route>
156
+ <from uri="direct:start"/>
157
+ <log message="Username is {{aws:database/username:admin}}"/>
158
+ </route>
159
+ </camelContext>
160
+
161
+ In this case, if the secret doesn’t exist or the secret exists, but the
162
+ username field is not part of the secret, the property will fall back to
163
+ "admin" as value.
164
+
165
+ There is also the syntax to get a particular version of the secret for
166
+ both the approach, with field/default value specified or only with
167
+ secret:
168
+
169
+ <camelContext>
170
+ <route>
171
+ <from uri="direct:start"/>
172
+ <to uri="{{aws:route@bf9b4f4b-8e63-43fd-a73c-3e2d3748b451}}"/>
173
+ </route>
174
+ </camelContext>
175
+
176
+ This approach will return the RAW route secret with the version
177
+ *bf9b4f4b-8e63-43fd-a73c-3e2d3748b451*.
178
+
179
+ <camelContext>
180
+ <route>
181
+ <from uri="direct:start"/>
182
+ <to uri="{{aws:route:default@bf9b4f4b-8e63-43fd-a73c-3e2d3748b451}}"/>
183
+ </route>
184
+ </camelContext>
185
+
186
+ This approach will return the route secret value with version
187
+ *bf9b4f4b-8e63-43fd-a73c-3e2d3748b451* or default value in case the
188
+ secret doesn’t exist or the version doesn’t exist.
189
+
190
+ <camelContext>
191
+ <route>
192
+ <from uri="direct:start"/>
193
+ <log message="Username is {{aws:database/username:admin@bf9b4f4b-8e63-43fd-a73c-3e2d3748b451}}"/>
194
+ </route>
195
+ </camelContext>
196
+
197
+ This approach will return the username field of the database secret with
198
+ version *bf9b4f4b-8e63-43fd-a73c-3e2d3748b451* or admin in case the
199
+ secret doesn’t exist or the version doesn’t exist.
200
+
201
+ For the moment we are not considering the rotation function if any are
202
+ applied, but it is in the work to be done.
203
+
204
+ The only requirement is adding the camel-aws-secrets-manager jar to your
205
+ Camel application.
206
+
207
+ ## Automatic Camel context reloading on Secret Refresh
208
+
209
+ Being able to reload Camel context on a Secret Refresh could be done by
210
+ specifying the usual credentials (the same used for AWS Secret Manager
211
+ Property Function).
212
+
213
+ With Environment variables:
214
+
215
+ export $CAMEL_VAULT_AWS_USE_DEFAULT_CREDENTIALS_PROVIDER=accessKey
216
+ export $CAMEL_VAULT_AWS_REGION=region
217
+
218
+ or as plain Camel main properties:
219
+
220
+ camel.vault.aws.useDefaultCredentialProvider = true
221
+ camel.vault.aws.region = region
222
+
223
+ Or by specifying accessKey/SecretKey and region, instead of using the
224
+ default credentials provider chain.
225
+
226
+ To enable the automatic refresh, you’ll need additional properties to
227
+ set:
228
+
229
+ camel.vault.aws.refreshEnabled=true
230
+ camel.vault.aws.refreshPeriod=60000
231
+ camel.vault.aws.secrets=Secret
232
+ camel.main.context-reload-enabled = true
233
+
234
+ where `camel.vault.aws.refreshEnabled` will enable the automatic context
235
+ reload, `camel.vault.aws.refreshPeriod` is the interval of time between
236
+ two different checks for update events and `camel.vault.aws.secrets` is
237
+ a regex representing the secrets we want to track for updates.
238
+
239
+ Note that `camel.vault.aws.secrets` is not mandatory: if not specified
240
+ the task responsible for checking updates events will take into accounts
241
+ or the properties with an `aws:` prefix.
242
+
243
+ ## Automatic Camel context reloading on Secret Refresh with Eventbridge and AWS SQS Services
244
+
245
+ Another option is to use AWS EventBridge in conjunction with the AWS SQS
246
+ service.
247
+
248
+ On the AWS side, the following resources need to be created:
249
+
250
+ - an AWS Couldtrail trail
251
+
252
+ - an AWS SQS Queue
253
+
254
+ - an Eventbridge rule of the following kind
255
+
256
+ <!-- -->
257
+
258
+ {
259
+ "source": ["aws.secretsmanager"],
260
+ "detail-type": ["AWS API Call via CloudTrail"],
261
+ "detail": {
262
+ "eventSource": ["secretsmanager.amazonaws.com"]
263
+ }
264
+ }
265
+
266
+ This rule will make the event related to AWS Secrets Manager filtered
267
+
268
+ - You need to set the a Rule target to the AWS SQS Queue for
269
+ Eventbridge rule
270
+
271
+ - You need to give permission to the Eventbrige rule, to write on the
272
+ above SQS Queue. For doing this you’ll need to define a json file
273
+ like this:
274
+
275
+ <!-- -->
276
+
277
+ {
278
+ "Policy": "{\"Version\":\"2012-10-17\",\"Id\":\"<queue_arn>/SQSDefaultPolicy\",\"Statement\":[{\"Sid\": \"EventsToMyQueue\", \"Effect\": \"Allow\", \"Principal\": {\"Service\": \"events.amazonaws.com\"}, \"Action\": \"sqs:SendMessage\", \"Resource\": \"<queue_arn>\", \"Condition\": {\"ArnEquals\": {\"aws:SourceArn\": \"<eventbridge_rule_arn>\"}}}]}"
279
+ }
280
+
281
+ Change the values for queue\_arn and eventbridge\_rule\_arn, save the
282
+ file with policy.json name and run the following command with AWS CLI
283
+
284
+ aws sqs set-queue-attributes --queue-url <queue_url> --attributes file://policy.json
285
+
286
+ where queue\_url is the AWS SQS Queue URL of the just created Queue.
287
+
288
+ Now you should be able to set up the configuration on the Camel side. To
289
+ enable the SQS notification add the following properties:
290
+
291
+ camel.vault.aws.refreshEnabled=true
292
+ camel.vault.aws.refreshPeriod=60000
293
+ camel.vault.aws.secrets=Secret
294
+ camel.main.context-reload-enabled = true
295
+ camel.vault.aws.useSqsNotification=true
296
+ camel.vault.aws.sqsQueueUrl=<queue_url>
297
+
298
+ where queue\_url is the AWS SQS Queue URL of the just created Queue.
299
+
300
+ Whenever an event of PutSecretValue for the Secret named *Secret* will
301
+ happen, a message will be enqueued in the AWS SQS Queue and consumed on
302
+ the Camel side and a context reload will be triggered.
303
+
304
+ ## Secrets Manager Producer operations
305
+
306
+ Camel-AWS-Secrets-manager component provides the following operation on
307
+ the producer side:
308
+
309
+ - listSecrets
310
+
311
+ - createSecret
312
+
313
+ - deleteSecret
314
+
315
+ - describeSecret
316
+
317
+ - rotateSecret
318
+
319
+ - getSecret
320
+
321
+ - updateSecret
322
+
323
+ - replicateSecretToRegions
324
+
325
+ # Dependencies
326
+
327
+ Maven users will need to add the following dependency to their pom.xml.
328
+
329
+ **pom.xml**
330
+
331
+ <dependency>
332
+ <groupId>org.apache.camel</groupId>
333
+ <artifactId>camel-aws-secrets-manager</artifactId>
334
+ <version>${camel-version}</version>
335
+ </dependency>
336
+
337
+ where `${camel-version}` must be replaced by the actual version of
338
+ Camel.
339
+
340
+ ## Component Configurations
341
+
342
+
343
+ |Name|Description|Default|Type|
344
+ |---|---|---|---|
345
+ |binaryPayload|Set if the secret is binary or not|false|boolean|
346
+ |configuration|Component configuration||object|
347
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
348
+ |operation|The operation to perform||object|
349
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
350
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
351
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
352
+ |region|The region in which a Secrets Manager client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
353
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
354
+ |useProfileCredentialsProvider|Set whether the Secrets Manager client should expect to load credentials through a profile credentials provider.|false|boolean|
355
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
356
+ |secretsManagerClient|To use an existing configured AWS Secrets Manager client||object|
357
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
358
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
359
+ |proxyHost|To define a proxy host when instantiating the Secrets Manager client||string|
360
+ |proxyPort|To define a proxy port when instantiating the Secrets Manager client||integer|
361
+ |proxyProtocol|To define a proxy protocol when instantiating the Secrets Manager client|HTTPS|object|
362
+ |accessKey|Amazon AWS Access Key||string|
363
+ |secretKey|Amazon AWS Secret Key||string|
364
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
365
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
366
+ |useDefaultCredentialsProvider|Set whether the Translate client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
367
+ |useSessionCredentials|Set whether the Secrets Manager client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in Secrets Manager.|false|boolean|
368
+
369
+ ## Endpoint Configurations
370
+
371
+
372
+ |Name|Description|Default|Type|
373
+ |---|---|---|---|
374
+ |label|Logical name||string|
375
+ |binaryPayload|Set if the secret is binary or not|false|boolean|
376
+ |operation|The operation to perform||object|
377
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
378
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
379
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
380
+ |region|The region in which a Secrets Manager client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
381
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
382
+ |useProfileCredentialsProvider|Set whether the Secrets Manager client should expect to load credentials through a profile credentials provider.|false|boolean|
383
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
384
+ |secretsManagerClient|To use an existing configured AWS Secrets Manager client||object|
385
+ |proxyHost|To define a proxy host when instantiating the Secrets Manager client||string|
386
+ |proxyPort|To define a proxy port when instantiating the Secrets Manager client||integer|
387
+ |proxyProtocol|To define a proxy protocol when instantiating the Secrets Manager client|HTTPS|object|
388
+ |accessKey|Amazon AWS Access Key||string|
389
+ |secretKey|Amazon AWS Secret Key||string|
390
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
391
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
392
+ |useDefaultCredentialsProvider|Set whether the Translate client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
393
+ |useSessionCredentials|Set whether the Secrets Manager client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in Secrets Manager.|false|boolean|
camel-aws2-athena.md ADDED
@@ -0,0 +1,408 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws2-athena
2
+
3
+ **Since Camel 3.4**
4
+
5
+ **Only producer is supported**
6
+
7
+ The AWS2 Athena component supports running queries with [AWS
8
+ Athena](https://aws.amazon.com/athena/) and working with results.
9
+
10
+ Prerequisites
11
+
12
+ You must have a valid Amazon Web Services developer account, and be
13
+ signed up to use Amazon Athena. More information is available at [AWS
14
+ Athena](https://aws.amazon.com/athena/).
15
+
16
+ # URI Format
17
+
18
+ aws2-athena://label[?options]
19
+
20
+ You can append query options to the URI in the following format:
21
+ `?options=value&option2=value&...`
22
+
23
+ Required Athena component options
24
+
25
+ You have to provide the amazonAthenaClient in the Registry or your
26
+ accessKey and secretKey to access the [AWS
27
+ Athena](https://aws.amazon.com/athena/) service.
28
+
29
+ # Examples
30
+
31
+ ## Producer Examples
32
+
33
+ For example, to run a simple query, wait up to 60 seconds for
34
+ completion, and log the results:
35
+
36
+ from("direct:start")
37
+ .setBody(constant("SELECT 1"))
38
+ .to("aws2-athena://label?waitTimeout=60000&outputLocation=s3://bucket/path/")
39
+ .to("aws2-athena://label?operation=getQueryResults&outputType=StreamList")
40
+ .split(body()).streaming()
41
+ .to("log:out")
42
+ .to("mock:result");
43
+
44
+ Similarly, running the query and returning a path to the results in S3:
45
+
46
+ from("direct:start")
47
+ .setBody(constant("SELECT 1"))
48
+ .to("aws2-athena://label?waitTimeout=60000&outputLocation=s3://bucket/path/")
49
+ .to("aws2-athena://label?operation=getQueryResults&outputType=S3Pointer")
50
+ .to("mock:result");
51
+
52
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
53
+
54
+ You have the possibility of avoiding the usage of explicit static
55
+ credentials by specifying the useDefaultCredentialsProvider option and
56
+ set it to true.
57
+
58
+ The order of evaluation for Default Credentials Provider is the
59
+ following:
60
+
61
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
62
+
63
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
64
+ `AWS_SECRET_ACCESS_KEY`.
65
+
66
+ - Web Identity Token from AWS STS.
67
+
68
+ - The shared credentials and config files.
69
+
70
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
71
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
72
+ set.
73
+
74
+ - Amazon EC2 Instance profile credentials.
75
+
76
+ You have also the possibility of using Profile Credentials Provider, by
77
+ specifying the useProfileCredentialsProvider option to true and
78
+ profileCredentialsName to the profile name.
79
+
80
+ Only one of static, default and profile credentials could be used at the
81
+ same time.
82
+
83
+ For more information about this you can look at [AWS credentials
84
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
85
+
86
+ ## Athena Producer operations
87
+
88
+ The Camel-AWS Athena component provides the following operation on the
89
+ producer side:
90
+
91
+ - getQueryExecution
92
+
93
+ - getQueryResults
94
+
95
+ - listQueryExecutions
96
+
97
+ - startQueryExecution
98
+
99
+ ## Advanced AmazonAthena configuration
100
+
101
+ If your Camel Application is running behind a firewall or if you need to
102
+ have more control over the `AthenaClient` instance configuration, you
103
+ can create your own instance and refer to it in your Camel aws2-athena
104
+ component configuration:
105
+
106
+ from("aws2-athena://MyQuery?amazonAthenaClient=#client&...")
107
+ .to("mock:result");
108
+
109
+ ## Overriding query parameters with message headers
110
+
111
+ Message headers listed in "Message headers evaluated by the Athena
112
+ producer" override the corresponding query parameters listed in "Query
113
+ Parameters".
114
+
115
+ For example:
116
+
117
+ from("direct:start")
118
+ .setHeader(Athena2Constants.OUTPUT_LOCATION, constant("s3://other/location/"))
119
+ .to("aws2-athena:label?outputLocation=s3://foo/bar/")
120
+ .to("mock:result");
121
+
122
+ Will cause the output location to be `s3://other/location/`.
123
+
124
+ ## Athena Producer Operation examples
125
+
126
+ - getQueryExecution: this operation returns information about a query
127
+ given its query execution ID
128
+
129
+ <!-- -->
130
+
131
+ from("direct:start")
132
+ .to("aws2-athena://label?operation=getQueryExecution&queryExecutionId=11111111-1111-1111-1111-111111111111")
133
+ .to("mock:result");
134
+
135
+ The preceding example will yield an [Athena
136
+ QueryExecution](https://docs.aws.amazon.com/athena/latest/APIReference/API_QueryExecution.html)
137
+ in the body.
138
+
139
+ The getQueryExecution operation also supports retrieving the query
140
+ execution ID from a header (`CamelAwsAthenaQueryExecutionId`), and since
141
+ startQueryExecution sets the same header, upon starting a query, these
142
+ operations can be used together:
143
+
144
+ from("direct:start")
145
+ .setBody(constant("SELECT 1"))
146
+ .to("aws2-athena://label?operation=startQueryExecution&outputLocation=s3://bucket/path/")
147
+ .to("aws2-athena://label?operation=getQueryExecution")
148
+ .to("mock:result");
149
+
150
+ The preceding example will yield an Athena QueryExecution in the body
151
+ for the query that was just started.
152
+
153
+ - getQueryResults: this operation returns the results of a query that
154
+ has succeeded. The results are returned in the body in one of three
155
+ formats.
156
+
157
+ `StreamList` - the default - returns a
158
+ [GetQueryResultsIterable](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/athena/paginators/GetQueryResultsIterable.html)
159
+ in the body that can page through all results:
160
+
161
+ from("direct:start")
162
+ .setBody(constant("SELECT 1"))
163
+ .to("aws2-athena://label?operation=startQueryExecution&waitTimeout=60000&outputLocation=s3://bucket/path/")
164
+ .to("aws2-athena://label?operation=getQueryResults&outputType=StreamList")
165
+ .to("mock:result");
166
+
167
+ The output of StreamList can be processed in various ways:
168
+
169
+ from("direct:start")
170
+ .setBody(constant(
171
+ "SELECT * FROM ("
172
+ + " VALUES"
173
+ + " (1, 'a'),"
174
+ + " (2, 'b')"
175
+ + ") AS t (id, name)"))
176
+ .to("aws2-athena://label?operation=startQueryExecution&waitTimeout=60000&outputLocation=s3://bucket/path/")
177
+ .to("aws2-athena://label?operation=getQueryResults&outputType=StreamList")
178
+ .split(body()).streaming()
179
+ .process(new Processor() {
180
+
181
+ @Override
182
+ public void process(Exchange exchange) {
183
+ GetQueryResultsResponse page = exchange
184
+ .getMessage()
185
+ .getBody(GetQueryResultsResponse.class);
186
+ for (Row row : page.resultSet().rows()) {
187
+ String line = row.data()
188
+ .stream()
189
+ .map(Datum::varCharValue)
190
+ .collect(Collectors.joining(","));
191
+ System.out.println(line);
192
+ }
193
+ }
194
+ })
195
+ .to("mock:result");
196
+
197
+ The preceding example will print the results of the query as CSV to the
198
+ console.
199
+
200
+ `SelectList` - returns a
201
+ [GetQueryResponse](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/athena/model/GetQueryResultsResponse.html)
202
+ in the body containing at most 1,000 rows, plus the NextToken value as a
203
+ header (`CamelAwsAthenaNextToken`), which can be used for manual
204
+ pagination of results:
205
+
206
+ from("direct:start")
207
+ .setBody(constant("SELECT 1"))
208
+ .to("aws2-athena://label?operation=startQueryExecution&waitTimeout=60000&outputLocation=s3://bucket/path/")
209
+ .to("aws2-athena://label?operation=getQueryResults&outputType=SelectList")
210
+ .to("mock:result");
211
+
212
+ The preceding example will return a
213
+ [GetQueryResponse](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/athena/model/GetQueryResultsResponse.html)
214
+ in the body plus the NextToken value as a header
215
+ (`CamelAwsAthenaNextToken`), which can be used to manually page through
216
+ the results 1,000 rows at a time.
217
+
218
+ `S3Pointer` - return an S3 path (e.g. `s3://bucket/path/`) pointing to
219
+ the results:
220
+
221
+ from("direct:start")
222
+ .setBody(constant("SELECT 1"))
223
+ .to("aws2-athena://label?operation=startQueryExecution&waitTimeout=60000&outputLocation=s3://bucket/path/")
224
+ .to("aws2-athena://label?operation=getQueryResults&outputType=S3Pointer")
225
+ .to("mock:result");
226
+
227
+ The preceding example will return an S3 path (e.g. `s3://bucket/path/`)
228
+ in the body pointing to the results. The path will also be set in a
229
+ header (`CamelAwsAthenaOutputLocation`).
230
+
231
+ - listQueryExecutions: this operation returns a list of query
232
+ execution IDs
233
+
234
+ <!-- -->
235
+
236
+ from("direct:start")
237
+ .to("aws2-athena://label?operation=listQueryExecutions")
238
+ .to("mock:result");
239
+
240
+ The preceding example will return a list of query executions in the
241
+ body, plus the NextToken value as a header (`CamelAwsAthenaNextToken`)
242
+ than can be used for manual pagination of results.
243
+
244
+ - startQueryExecution: this operation starts the execution of a query.
245
+ It supports waiting for the query to complete before proceeding, and
246
+ retrying the query based on a set of configurable failure
247
+ conditions:
248
+
249
+ <!-- -->
250
+
251
+ from("direct:start")
252
+ .setBody(constant("SELECT 1"))
253
+ .to("aws2-athena://label?operation=startQueryExecution&outputLocation=s3://bucket/path/")
254
+ .to("mock:result");
255
+
256
+ The preceding example will start the query `SELECT 1` and configure the
257
+ results to be saved to `s3://bucket/path/`, but will not wait for the
258
+ query to complete.
259
+
260
+ from("direct:start")
261
+ .setBody(constant("SELECT 1"))
262
+ .to("aws2-athena://label?operation=startQueryExecution&waitTimeout=60000&outputLocation=s3://bucket/path/")
263
+ .to("mock:result");
264
+
265
+ The preceding example will start a query and wait up to 60 seconds for
266
+ it to reach a status that indicates it is complete (one of SUCCEEDED,
267
+ FAILED, CANCELLED, or UNKNOWN\_TO\_SDK\_VERSION). Upon failure, the
268
+ query would not be retried.
269
+
270
+ from("direct:start")
271
+ .setBody(constant("SELECT 1"))
272
+ .to("aws2-athena://label?operation=startQueryExecution&waitTimeout=60000&initialDelay=10000&delay=1000&maxAttempts=3&retry=retryable&outputLocation=s3://bucket/path/")
273
+ .to("mock:result");
274
+
275
+ The preceding example will start a query and wait up to 60 seconds for
276
+ it to reach a status that indicates it is complete (one of SUCCEEDED,
277
+ FAILED, CANCELLED, or UNKNOWN\_TO\_SDK\_VERSION). Upon failure, the
278
+ query would be automatically retried up to two more times if the failure
279
+ state indicates the query may succeed upon retry (Athena queries that
280
+ fail with states such as `GENERIC_INTERNAL_ERROR` or "resource limit
281
+ exhaustion" will sometimes succeed if retried). While waiting for the
282
+ query to complete, the query status would first be checked after an
283
+ initial delay of 10 seconds, and subsequently every 1 second until the
284
+ query completes.
285
+
286
+ ## Putting it all together
287
+
288
+ from("direct:start")
289
+ .setBody(constant("SELECT 1"))
290
+ .to("aws2-athena://label?waitTimeout=60000&&maxAttempts=3&retry=retryable&outputLocation=s3://bucket/path/")
291
+ .to("aws2-athena://label?operation=getQueryResults&outputType=StreamList")
292
+ .to("mock:result");
293
+
294
+ The preceding example will start the query and wait up to 60 seconds for
295
+ it to complete. Upon completion, getQueryResults put the results of the
296
+ query into the body of the message for further processing.
297
+
298
+ For the sake of completeness, a similar outcome could be achieved with
299
+ the following:
300
+
301
+ from("direct:start")
302
+ .setBody(constant("SELECT 1"))
303
+ .to("aws2-athena://label?operation=startQueryExecution&outputLocation=s3://bucket/path/")
304
+ .loopDoWhile(simple("${header." + Athena2Constants.QUERY_EXECUTION_STATE + "} != 'SUCCEEDED'"))
305
+ .delay(1_000)
306
+ .to("aws2-athena://label?operation=getQueryExecution")
307
+ .end()
308
+ .to("aws2-athena://label?operation=getQueryResults&outputType=StreamList")
309
+ .to("mock:result");
310
+
311
+ Caution: the preceding example would block indefinitely, however, if the
312
+ query did not complete with a status of SUCCEEDED.
313
+
314
+ # Dependencies
315
+
316
+ Maven users will need to add the following dependency to their pom.xml.
317
+
318
+ **pom.xml**
319
+
320
+ <dependency>
321
+ <groupId>org.apache.camel</groupId>
322
+ <artifactId>camel-aws2-athena</artifactId>
323
+ <version>${camel-version}</version>
324
+ </dependency>
325
+
326
+ where `${camel-version}` must be replaced by the actual version of
327
+ Camel.
328
+
329
+ ## Component Configurations
330
+
331
+
332
+ |Name|Description|Default|Type|
333
+ |---|---|---|---|
334
+ |configuration|The component configuration.||object|
335
+ |database|The Athena database to use.||string|
336
+ |delay|Milliseconds before the next poll for query execution status. See the section Waiting for Query Completion and Retrying Failed Queries to learn more.|2000|integer|
337
+ |initialDelay|Milliseconds before the first poll for query execution status. See the section Waiting for Query Completion and Retrying Failed Queries to learn more.|1000|integer|
338
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
339
+ |maxAttempts|Maximum number of times to attempt a query. Set to 1 to disable retries. See the section Waiting for Query Completion and Retrying Failed Queries to learn more.|1|integer|
340
+ |maxResults|Max number of results to return for the given operation (if supported by the Athena API endpoint). If not set, will use the Athena API default for the given operation.||integer|
341
+ |nextToken|Pagination token to use in the case where the response from the previous request was truncated.||string|
342
+ |operation|The Athena API function to call.|startQueryExecution|object|
343
+ |outputLocation|The location in Amazon S3 where query results are stored, such as s3://path/to/query/bucket/. Ensure this value ends with a forward slash.||string|
344
+ |outputType|How query results should be returned. One of StreamList (default - return a GetQueryResultsIterable that can page through all results), SelectList (returns at most 1000 rows at a time, plus a NextToken value as a header than can be used for manual pagination of results), S3Pointer (return an S3 path pointing to the results).|StreamList|object|
345
+ |queryExecutionId|The unique ID identifying the query execution.||string|
346
+ |queryString|The SQL query to run. Except for simple queries, prefer setting this as the body of the Exchange or as a header using Athena2Constants.QUERY\_STRING to avoid having to deal with URL encoding issues.||string|
347
+ |region|The region in which Athena client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example ap-east-1).||string|
348
+ |resetWaitTimeoutOnRetry|Reset the waitTimeout countdown in the event of a query retry. If set to true, potential max time spent waiting for queries is equal to waitTimeout x maxAttempts. See the section Waiting for Query Completion and Retrying Failed Queries to learn more.|true|boolean|
349
+ |retry|Optional comma separated list of error types to retry the query for. Use: 'retryable' to retry all retryable failure conditions (e.g. generic errors and resources exhausted), 'generic' to retry 'GENERIC\_INTERNAL\_ERROR' failures, 'exhausted' to retry queries that have exhausted resource limits, 'always' to always retry regardless of failure condition, or 'never' or null to never retry (default). See the section Waiting for Query Completion and Retrying Failed Queries to learn more.|never|string|
350
+ |waitTimeout|Optional max wait time in millis to wait for a successful query completion. See the section Waiting for Query Completion and Retrying Failed Queries to learn more.|0|integer|
351
+ |workGroup|The workgroup to use for running the query.||string|
352
+ |amazonAthenaClient|The AmazonAthena instance to use as the client.||object|
353
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
354
+ |clientRequestToken|A unique string to ensure issues queries are idempotent. It is unlikely you will need to set this.||string|
355
+ |includeTrace|Include useful trace information at the beginning of queries as an SQL comment (prefixed with --).|false|boolean|
356
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
357
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
358
+ |proxyHost|To define a proxy host when instantiating the Athena client.||string|
359
+ |proxyPort|To define a proxy port when instantiating the Athena client.||integer|
360
+ |proxyProtocol|To define a proxy protocol when instantiating the Athena client.|HTTPS|object|
361
+ |accessKey|Amazon AWS Access Key.||string|
362
+ |encryptionOption|The encryption type to use when storing query results in S3. One of SSE\_S3, SSE\_KMS, or CSE\_KMS.||object|
363
+ |kmsKey|For SSE-KMS and CSE-KMS, this is the KMS key ARN or ID.||string|
364
+ |profileCredentialsName|If using a profile credentials provider this parameter will set the profile name||string|
365
+ |secretKey|Amazon AWS Secret Key.||string|
366
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
367
+ |useDefaultCredentialsProvider|Set whether the Athena client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in|false|boolean|
368
+ |useProfileCredentialsProvider|Set whether the Athena client should expect to load credentials through a profile credentials provider.|false|boolean|
369
+ |useSessionCredentials|Set whether the Athena client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume a IAM role for doing operations in Athena.|false|boolean|
370
+
371
+ ## Endpoint Configurations
372
+
373
+
374
+ |Name|Description|Default|Type|
375
+ |---|---|---|---|
376
+ |label|Logical name||string|
377
+ |database|The Athena database to use.||string|
378
+ |delay|Milliseconds before the next poll for query execution status. See the section Waiting for Query Completion and Retrying Failed Queries to learn more.|2000|integer|
379
+ |initialDelay|Milliseconds before the first poll for query execution status. See the section Waiting for Query Completion and Retrying Failed Queries to learn more.|1000|integer|
380
+ |maxAttempts|Maximum number of times to attempt a query. Set to 1 to disable retries. See the section Waiting for Query Completion and Retrying Failed Queries to learn more.|1|integer|
381
+ |maxResults|Max number of results to return for the given operation (if supported by the Athena API endpoint). If not set, will use the Athena API default for the given operation.||integer|
382
+ |nextToken|Pagination token to use in the case where the response from the previous request was truncated.||string|
383
+ |operation|The Athena API function to call.|startQueryExecution|object|
384
+ |outputLocation|The location in Amazon S3 where query results are stored, such as s3://path/to/query/bucket/. Ensure this value ends with a forward slash.||string|
385
+ |outputType|How query results should be returned. One of StreamList (default - return a GetQueryResultsIterable that can page through all results), SelectList (returns at most 1000 rows at a time, plus a NextToken value as a header than can be used for manual pagination of results), S3Pointer (return an S3 path pointing to the results).|StreamList|object|
386
+ |queryExecutionId|The unique ID identifying the query execution.||string|
387
+ |queryString|The SQL query to run. Except for simple queries, prefer setting this as the body of the Exchange or as a header using Athena2Constants.QUERY\_STRING to avoid having to deal with URL encoding issues.||string|
388
+ |region|The region in which Athena client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example ap-east-1).||string|
389
+ |resetWaitTimeoutOnRetry|Reset the waitTimeout countdown in the event of a query retry. If set to true, potential max time spent waiting for queries is equal to waitTimeout x maxAttempts. See the section Waiting for Query Completion and Retrying Failed Queries to learn more.|true|boolean|
390
+ |retry|Optional comma separated list of error types to retry the query for. Use: 'retryable' to retry all retryable failure conditions (e.g. generic errors and resources exhausted), 'generic' to retry 'GENERIC\_INTERNAL\_ERROR' failures, 'exhausted' to retry queries that have exhausted resource limits, 'always' to always retry regardless of failure condition, or 'never' or null to never retry (default). See the section Waiting for Query Completion and Retrying Failed Queries to learn more.|never|string|
391
+ |waitTimeout|Optional max wait time in millis to wait for a successful query completion. See the section Waiting for Query Completion and Retrying Failed Queries to learn more.|0|integer|
392
+ |workGroup|The workgroup to use for running the query.||string|
393
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
394
+ |amazonAthenaClient|The AmazonAthena instance to use as the client.||object|
395
+ |clientRequestToken|A unique string to ensure issues queries are idempotent. It is unlikely you will need to set this.||string|
396
+ |includeTrace|Include useful trace information at the beginning of queries as an SQL comment (prefixed with --).|false|boolean|
397
+ |proxyHost|To define a proxy host when instantiating the Athena client.||string|
398
+ |proxyPort|To define a proxy port when instantiating the Athena client.||integer|
399
+ |proxyProtocol|To define a proxy protocol when instantiating the Athena client.|HTTPS|object|
400
+ |accessKey|Amazon AWS Access Key.||string|
401
+ |encryptionOption|The encryption type to use when storing query results in S3. One of SSE\_S3, SSE\_KMS, or CSE\_KMS.||object|
402
+ |kmsKey|For SSE-KMS and CSE-KMS, this is the KMS key ARN or ID.||string|
403
+ |profileCredentialsName|If using a profile credentials provider this parameter will set the profile name||string|
404
+ |secretKey|Amazon AWS Secret Key.||string|
405
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
406
+ |useDefaultCredentialsProvider|Set whether the Athena client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in|false|boolean|
407
+ |useProfileCredentialsProvider|Set whether the Athena client should expect to load credentials through a profile credentials provider.|false|boolean|
408
+ |useSessionCredentials|Set whether the Athena client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume a IAM role for doing operations in Athena.|false|boolean|
camel-aws2-cw.md ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws2-cw
2
+
3
+ **Since Camel 3.1**
4
+
5
+ **Only producer is supported**
6
+
7
+ The AWS2 Cloudwatch component allows messages to be sent to an [Amazon
8
+ CloudWatch](https://aws.amazon.com/cloudwatch/) metrics. The
9
+ implementation of the Amazon API is provided by the [AWS
10
+ SDK](https://aws.amazon.com/sdkforjava/).
11
+
12
+ Prerequisites
13
+
14
+ You must have a valid Amazon Web Services developer account, and be
15
+ signed up to use Amazon CloudWatch. More information is available at
16
+ [Amazon CloudWatch](https://aws.amazon.com/cloudwatch/).
17
+
18
+ # URI Format
19
+
20
+ aws2-cw://namespace[?options]
21
+
22
+ The metrics will be created if they don’t already exist.
23
+
24
+ You can append query options to the URI in the following format:
25
+ `?options=value&option2=value&...`
26
+
27
+ Required CW component options
28
+
29
+ You have to provide the amazonCwClient in the Registry or your accessKey
30
+ and secretKey to access the [Amazon’s
31
+ CloudWatch](https://aws.amazon.com/cloudwatch/).
32
+
33
+ # Usage
34
+
35
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
36
+
37
+ You have the possibility of avoiding the usage of explicit static
38
+ credentials by specifying the useDefaultCredentialsProvider option and
39
+ set it to true.
40
+
41
+ The order of evaluation for Default Credentials Provider is the
42
+ following:
43
+
44
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
45
+
46
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
47
+ `AWS_SECRET_ACCESS_KEY`.
48
+
49
+ - Web Identity Token from AWS STS.
50
+
51
+ - The shared credentials and config files.
52
+
53
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
54
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
55
+ set.
56
+
57
+ - Amazon EC2 Instance profile credentials.
58
+
59
+ You have also the possibility of using Profile Credentials Provider, by
60
+ specifying the useProfileCredentialsProvider option to true and
61
+ profileCredentialsName to the profile name.
62
+
63
+ Only one of static, default and profile credentials could be used at the
64
+ same time.
65
+
66
+ For more information about this you can look at [AWS credentials
67
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
68
+
69
+ ## Advanced CloudWatchClient configuration
70
+
71
+ If you need more control over the `CloudWatchClient` instance
72
+ configuration you can create your own instance and refer to it from the
73
+ URI:
74
+
75
+ from("direct:start")
76
+ .to("aws2-cw://namespace?amazonCwClient=#client");
77
+
78
+ The `#client` refers to a `CloudWatchClient` in the Registry.
79
+
80
+ # Dependencies
81
+
82
+ Maven users will need to add the following dependency to their pom.xml.
83
+
84
+ **pom.xml**
85
+
86
+ <dependency>
87
+ <groupId>org.apache.camel</groupId>
88
+ <artifactId>camel-aws2-cw</artifactId>
89
+ <version>${camel-version}</version>
90
+ </dependency>
91
+
92
+ where `${camel-version`} must be replaced by the actual version of
93
+ Camel.
94
+
95
+ # Examples
96
+
97
+ ## Producer Example
98
+
99
+ from("direct:start")
100
+ .to("aws2-cw://http://camel.apache.org/aws-cw");
101
+
102
+ and sends something like
103
+
104
+ exchange.getIn().setHeader(Cw2Constants.METRIC_NAME, "ExchangesCompleted");
105
+ exchange.getIn().setHeader(Cw2Constants.METRIC_VALUE, "2.0");
106
+ exchange.getIn().setHeader(Cw2Constants.METRIC_UNIT, "Count");
107
+
108
+ ## Component Configurations
109
+
110
+
111
+ |Name|Description|Default|Type|
112
+ |---|---|---|---|
113
+ |configuration|The component configuration||object|
114
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
115
+ |name|The metric name||string|
116
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
117
+ |region|The region in which CW client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
118
+ |timestamp|The metric timestamp||object|
119
+ |unit|The metric unit||string|
120
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
121
+ |value|The metric value||number|
122
+ |amazonCwClient|To use the AmazonCloudWatch as the client||object|
123
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
124
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
125
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
126
+ |proxyHost|To define a proxy host when instantiating the CW client||string|
127
+ |proxyPort|To define a proxy port when instantiating the CW client||integer|
128
+ |proxyProtocol|To define a proxy protocol when instantiating the CW client|HTTPS|object|
129
+ |accessKey|Amazon AWS Access Key||string|
130
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
131
+ |secretKey|Amazon AWS Secret Key||string|
132
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
133
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
134
+ |useDefaultCredentialsProvider|Set whether the S3 client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
135
+ |useProfileCredentialsProvider|Set whether the Cloudwatch client should expect to load credentials through a profile credentials provider.|false|boolean|
136
+ |useSessionCredentials|Set whether the CloudWatch client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in CloudWatch.|false|boolean|
137
+
138
+ ## Endpoint Configurations
139
+
140
+
141
+ |Name|Description|Default|Type|
142
+ |---|---|---|---|
143
+ |namespace|The metric namespace||string|
144
+ |name|The metric name||string|
145
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
146
+ |region|The region in which CW client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
147
+ |timestamp|The metric timestamp||object|
148
+ |unit|The metric unit||string|
149
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
150
+ |value|The metric value||number|
151
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
152
+ |amazonCwClient|To use the AmazonCloudWatch as the client||object|
153
+ |proxyHost|To define a proxy host when instantiating the CW client||string|
154
+ |proxyPort|To define a proxy port when instantiating the CW client||integer|
155
+ |proxyProtocol|To define a proxy protocol when instantiating the CW client|HTTPS|object|
156
+ |accessKey|Amazon AWS Access Key||string|
157
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
158
+ |secretKey|Amazon AWS Secret Key||string|
159
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
160
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
161
+ |useDefaultCredentialsProvider|Set whether the S3 client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
162
+ |useProfileCredentialsProvider|Set whether the Cloudwatch client should expect to load credentials through a profile credentials provider.|false|boolean|
163
+ |useSessionCredentials|Set whether the CloudWatch client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in CloudWatch.|false|boolean|
camel-aws2-ddb.md ADDED
@@ -0,0 +1,263 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws2-ddb
2
+
3
+ **Since Camel 3.1**
4
+
5
+ **Only producer is supported**
6
+
7
+ The AWS2 DynamoDB component supports storing and retrieving data from/to
8
+ [Amazon’s DynamoDB](https://aws.amazon.com/dynamodb) service.
9
+
10
+ Prerequisites
11
+
12
+ You must have a valid Amazon Web Services developer account, and be
13
+ signed up to use Amazon DynamoDB. More information is available at
14
+ [Amazon DynamoDB](https://aws.amazon.com/dynamodb).
15
+
16
+ # URI Format
17
+
18
+ aws2-ddb://domainName[?options]
19
+
20
+ You can append query options to the URI in the following format:
21
+
22
+ `?options=value&option2=value&...`
23
+
24
+ Required DDB component options
25
+
26
+ You have to provide the amazonDDBClient in the Registry or your
27
+ accessKey and secretKey to access the [Amazon’s
28
+ DynamoDB](https://aws.amazon.com/dynamodb).
29
+
30
+ # Usage
31
+
32
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
33
+
34
+ You have the possibility of avoiding the usage of explicit static
35
+ credentials by specifying the useDefaultCredentialsProvider option and
36
+ set it to true.
37
+
38
+ The order of evaluation for Default Credentials Provider is the
39
+ following:
40
+
41
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
42
+
43
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
44
+ `AWS_SECRET_ACCESS_KEY`.
45
+
46
+ - Web Identity Token from AWS STS.
47
+
48
+ - The shared credentials and config files.
49
+
50
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
51
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
52
+ set.
53
+
54
+ - Amazon EC2 Instance profile credentials.
55
+
56
+ You have also the possibility of using Profile Credentials Provider, by
57
+ specifying the useProfileCredentialsProvider option to true and
58
+ profileCredentialsName to the profile name.
59
+
60
+ Only one of static, default and profile credentials could be used at the
61
+ same time.
62
+
63
+ For more information about this you can look at [AWS credentials
64
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
65
+
66
+ ## Advanced AmazonDynamoDB configuration
67
+
68
+ If you need more control over the `AmazonDynamoDB` instance
69
+ configuration you can create your own instance and refer to it from the
70
+ URI:
71
+
72
+ public class MyRouteBuilder extends RouteBuilder {
73
+
74
+ private String accessKey = "myaccessKey";
75
+ private String secretKey = "secretKey";
76
+
77
+ @Override
78
+ public void configure() throws Exception {
79
+
80
+ DynamoDbClient client = DynamoDbClient.builder()
81
+ .region(Region.AP_SOUTHEAST_2)
82
+ .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create(accessKey, secretKey)))
83
+ .build();
84
+
85
+ getCamelContext().getRegistry().bind("client", client);
86
+
87
+ from("direct:start")
88
+ .to("aws2-ddb://domainName?amazonDDBClient=#client");
89
+ }
90
+ }
91
+
92
+ The `#client` refers to a `DynamoDbClient` in the Registry.
93
+
94
+ # Supported producer operations
95
+
96
+ - BatchGetItems
97
+
98
+ - DeleteItem
99
+
100
+ - DeleteTable
101
+
102
+ - DescribeTable
103
+
104
+ - GetItem
105
+
106
+ - PutItem
107
+
108
+ - Query
109
+
110
+ - Scan
111
+
112
+ - UpdateItem
113
+
114
+ - UpdateTable
115
+
116
+ # Dependencies
117
+
118
+ Maven users will need to add the following dependency to their pom.xml.
119
+
120
+ **pom.xml**
121
+
122
+ <dependency>
123
+ <groupId>org.apache.camel</groupId>
124
+ <artifactId>camel-aws2-ddb</artifactId>
125
+ <version>${camel-version}</version>
126
+ </dependency>
127
+
128
+ where `${camel-version}` must be replaced by the actual version of
129
+ Camel.
130
+
131
+ # Examples
132
+
133
+ ## Producer Examples
134
+
135
+ - PutItem: this operation will create an entry into DynamoDB
136
+
137
+ <!-- -->
138
+
139
+ Map<String, AttributeValue> attributeMap = new HashMap<>();
140
+ attributeMap.put("partitionKey", AttributeValue.builder().s("3000").build());
141
+ attributeMap.put("id", AttributeValue.builder().s("1001").build());
142
+ attributeMap.put("barcode", AttributeValue.builder().s("9002811220001").build());
143
+
144
+ from("direct:start")
145
+ .setHeader(Ddb2Constants.OPERATION, constant(Ddb2Operations.PutItem))
146
+ .setHeader(Ddb2Constants.CONSISTENT_READ, constant("true"))
147
+ .setHeader(Ddb2Constants.RETURN_VALUES, constant("ALL_OLD"))
148
+ .setHeader(Ddb2Constants.ITEM, constant(attributeMap))
149
+ .setHeader(Ddb2Constants.ATTRIBUTE_NAMES, constant(attributeMap.keySet()))
150
+ .to("aws2-ddb://" + tableName + "?amazonDDBClient=#client");
151
+
152
+ - UpdateItem: this operation will update an entry into DynamoDB
153
+
154
+ <!-- -->
155
+
156
+ Map<String, AttributeValueUpdate> attributeMap = new HashMap<>();
157
+ attributeMap.put("partitionKey", AttributeValueUpdate.builder().value(AttributeValue.builder().s("3000").build()).build());
158
+ attributeMap.put("sortKey", AttributeValueUpdate.builder().value(AttributeValue.builder().s("1001").build()).build());
159
+ attributeMap.put("borcode", AttributeValueUpdate.builder().value(AttributeValue.builder().s("900281122").build()).build());
160
+
161
+ Map<String, AttributeValue> keyMap = new HashMap<>();
162
+ keyMap.put("partitionKey", AttributeValue.builder().s("3000").build());
163
+ keyMap.put("sortKey", AttributeValue.builder().s("1001").build());
164
+
165
+ from("direct:start")
166
+ .setHeader(Ddb2Constants.OPERATION, constant(Ddb2Operations.UpdateItem))
167
+ .setHeader(Ddb2Constants.UPDATE_VALUES, constant(attributeMap))
168
+ .setHeader(Ddb2Constants.KEY, constant(keyMap))
169
+ .to("aws2-ddb://" + tableName + "?amazonDDBClient=#client");
170
+
171
+ - GetItem: this operation will retrieve an entry from DynamoDB
172
+
173
+ <!-- -->
174
+
175
+ from("direct:get")
176
+ .process(exchange -> {
177
+ final Map<String, AttributeValue> keyMap = new HashMap<>();
178
+ keyMap.put("table-key", AttributeValue.builder().s("1").build());
179
+
180
+ exchange.getIn().setHeader(Ddb2Constants.OPERATION, Ddb2Operations.GetItem);
181
+ exchange.getIn().setHeader(Ddb2Constants.ATTRIBUTE_NAMES, constant(List.of("table-key", "message")));
182
+ exchange.getIn().setHeader(Ddb2Constants.KEY, keyMap);
183
+ })
184
+ .toF("aws2-ddb://%s?amazonDDBClient=#client&consistentRead=true", tableName);
185
+
186
+ - DeleteItem: this operation will delete an entry from DynamoDB
187
+
188
+ <!-- -->
189
+
190
+ from("direct:delete")
191
+ .process(exchange -> {
192
+ final Map<String, AttributeValue> keyMap = new HashMap<>();
193
+ keyMap.put("table-key", AttributeValue.builder().s("1").build());
194
+
195
+ exchange.getIn().setHeader(Ddb2Constants.OPERATION, Ddb2Operations.DeleteItem);
196
+ exchange.getIn().setHeader(Ddb2Constants.KEY, keyMap);
197
+ })
198
+ .toF("aws2-ddb://%s?amazonDDBClient=#client&consistentRead=true", tableName);
199
+
200
+ ## Component Configurations
201
+
202
+
203
+ |Name|Description|Default|Type|
204
+ |---|---|---|---|
205
+ |configuration|The component configuration||object|
206
+ |consistentRead|Determines whether strong consistency should be enforced when data is read.|false|boolean|
207
+ |enabledInitialDescribeTable|Set whether the initial Describe table operation in the DDB Endpoint must be done, or not.|true|boolean|
208
+ |keyAttributeName|Attribute name when creating table||string|
209
+ |keyAttributeType|Attribute type when creating table||string|
210
+ |keyScalarType|The key scalar type, it can be S (String), N (Number) and B (Bytes)||string|
211
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
212
+ |operation|What operation to perform|PutItem|object|
213
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with uriEndpointOverride option|false|boolean|
214
+ |readCapacity|The provisioned throughput to reserve for reading resources from your table||integer|
215
+ |region|The region in which DDB client needs to work||string|
216
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
217
+ |writeCapacity|The provisioned throughput to reserved for writing resources to your table||integer|
218
+ |amazonDDBClient|To use the AmazonDynamoDB as the client||object|
219
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
220
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
221
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
222
+ |proxyHost|To define a proxy host when instantiating the DDB client||string|
223
+ |proxyPort|The region in which DynamoDB client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||integer|
224
+ |proxyProtocol|To define a proxy protocol when instantiating the DDB client|HTTPS|object|
225
+ |accessKey|Amazon AWS Access Key||string|
226
+ |profileCredentialsName|If using a profile credentials provider this parameter will set the profile name||string|
227
+ |secretKey|Amazon AWS Secret Key||string|
228
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume a IAM role||string|
229
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
230
+ |useDefaultCredentialsProvider|Set whether the S3 client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
231
+ |useProfileCredentialsProvider|Set whether the DDB client should expect to load credentials through a profile credentials provider.|false|boolean|
232
+ |useSessionCredentials|Set whether the DDB client should expect to use Session Credentials. This is useful in situation in which the user needs to assume a IAM role for doing operations in DDB.|false|boolean|
233
+
234
+ ## Endpoint Configurations
235
+
236
+
237
+ |Name|Description|Default|Type|
238
+ |---|---|---|---|
239
+ |tableName|The name of the table currently worked with.||string|
240
+ |consistentRead|Determines whether strong consistency should be enforced when data is read.|false|boolean|
241
+ |enabledInitialDescribeTable|Set whether the initial Describe table operation in the DDB Endpoint must be done, or not.|true|boolean|
242
+ |keyAttributeName|Attribute name when creating table||string|
243
+ |keyAttributeType|Attribute type when creating table||string|
244
+ |keyScalarType|The key scalar type, it can be S (String), N (Number) and B (Bytes)||string|
245
+ |operation|What operation to perform|PutItem|object|
246
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with uriEndpointOverride option|false|boolean|
247
+ |readCapacity|The provisioned throughput to reserve for reading resources from your table||integer|
248
+ |region|The region in which DDB client needs to work||string|
249
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
250
+ |writeCapacity|The provisioned throughput to reserved for writing resources to your table||integer|
251
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
252
+ |amazonDDBClient|To use the AmazonDynamoDB as the client||object|
253
+ |proxyHost|To define a proxy host when instantiating the DDB client||string|
254
+ |proxyPort|The region in which DynamoDB client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||integer|
255
+ |proxyProtocol|To define a proxy protocol when instantiating the DDB client|HTTPS|object|
256
+ |accessKey|Amazon AWS Access Key||string|
257
+ |profileCredentialsName|If using a profile credentials provider this parameter will set the profile name||string|
258
+ |secretKey|Amazon AWS Secret Key||string|
259
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume a IAM role||string|
260
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
261
+ |useDefaultCredentialsProvider|Set whether the S3 client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
262
+ |useProfileCredentialsProvider|Set whether the DDB client should expect to load credentials through a profile credentials provider.|false|boolean|
263
+ |useSessionCredentials|Set whether the DDB client should expect to use Session Credentials. This is useful in situation in which the user needs to assume a IAM role for doing operations in DDB.|false|boolean|
camel-aws2-ddbstream.md ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws2-ddbstream
2
+
3
+ **Since Camel 3.1**
4
+
5
+ **Only consumer is supported**
6
+
7
+ The AWS2 DynamoDB Stream component supports receiving messages from
8
+ Amazon DynamoDB Stream service.
9
+
10
+ Prerequisites
11
+
12
+ You must have a valid Amazon Web Services developer account, and be
13
+ signed up to use Amazon DynamoDB Streams. More information are available
14
+ at [AWS DynamoDB](https://aws.amazon.com/dynamodb/)
15
+
16
+ # URI Format
17
+
18
+ aws2-ddbstream://table-name[?options]
19
+
20
+ The stream needs to be created prior to it being used.
21
+ You can append query options to the URI in the following format,
22
+ ?options=value\&option2=value\&…
23
+
24
+ Required DynamoDBStream component options
25
+
26
+ You have to provide the DynamoDbStreamsClient in the Registry with
27
+ proxies and relevant credentials configured.
28
+
29
+ # Sequence Numbers
30
+
31
+ You can provide a literal string as the sequence number or provide a
32
+ bean in the registry. An example of using the bean would be to save your
33
+ current position in the change feed and restore it on Camel startup.
34
+
35
+ It is an error to provide a sequence number that is greater than the
36
+ largest sequence number in the describe-streams result, as this will
37
+ lead to the AWS call returning an HTTP 400.
38
+
39
+ # Usage
40
+
41
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
42
+
43
+ You have the possibility of avoiding the usage of explicit static
44
+ credentials, by specifying the useDefaultCredentialsProvider option and
45
+ set it to true.
46
+
47
+ The order of evaluation for Default Credentials Provider is the
48
+ following:
49
+
50
+ - Java system properties - aws.accessKeyId and aws.secretKey
51
+
52
+ - Environment variables - AWS\_ACCESS\_KEY\_ID and
53
+ AWS\_SECRET\_ACCESS\_KEY.
54
+
55
+ - Web Identity Token from AWS STS.
56
+
57
+ - The shared credentials and config files.
58
+
59
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
60
+ environment variable AWS\_CONTAINER\_CREDENTIALS\_RELATIVE\_URI is
61
+ set.
62
+
63
+ - Amazon EC2 Instance profile credentials.
64
+
65
+ You have also the possibility of using Profile Credentials Provider, by
66
+ specifying the useProfileCredentialsProvider option to true and
67
+ profileCredentialsName to the profile name.
68
+
69
+ Only one of static, default and profile credentials could be used at the
70
+ same time.
71
+
72
+ For more information about this you can look at [AWS credentials
73
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
74
+
75
+ # Coping with Downtime
76
+
77
+ ## AWS DynamoDB Streams outage of less than 24 hours
78
+
79
+ The consumer will resume from the last seen sequence number (as
80
+ implemented for
81
+ [CAMEL-9515](https://issues.apache.org/jira/browse/CAMEL-9515)), so you
82
+ should receive a flood of events in quick succession, as long as the
83
+ outage did not also include DynamoDB itself.
84
+
85
+ ## AWS DynamoDB Streams outage of more than 24 hours
86
+
87
+ Given that AWS only retain 24 hours worth of changes, you will have
88
+ missed change events no matter what mitigations are in place.
89
+
90
+ ## Message Body
91
+
92
+ The Message body is instance of
93
+ "software.amazon.awssdk.services.dynamodb.model.Record", for more
94
+ information about it, have a look at the [related
95
+ javadoc](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/dynamodb/model/Record.html)
96
+
97
+ # Dependencies
98
+
99
+ Maven users will need to add the following dependency to their pom.xml.
100
+
101
+ **pom.xml**
102
+
103
+ <dependency>
104
+ <groupId>org.apache.camel</groupId>
105
+ <artifactId>camel-aws2-ddb</artifactId>
106
+ <version>${camel-version}</version>
107
+ </dependency>
108
+
109
+ where `${camel-version}` must be replaced by the actual version of
110
+ Camel.
111
+
112
+ ## Component Configurations
113
+
114
+
115
+ |Name|Description|Default|Type|
116
+ |---|---|---|---|
117
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
118
+ |configuration|The component configuration||object|
119
+ |maxResultsPerRequest|Maximum number of records that will be fetched in each poll||integer|
120
+ |overrideEndpoint|Set the need for overidding the endpoint. This option needs to be used in combination with uriEndpointOverride option|false|boolean|
121
+ |region|The region in which DDBStreams client needs to work||string|
122
+ |streamIteratorType|Defines where in the DynamoDB stream to start getting records. Note that using FROM\_START can cause a significant delay before the stream has caught up to real-time.|FROM\_LATEST|object|
123
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
124
+ |amazonDynamoDbStreamsClient|Amazon DynamoDB client to use for all requests for this endpoint||object|
125
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
126
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
127
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
128
+ |proxyHost|To define a proxy host when instantiating the DDBStreams client||string|
129
+ |proxyPort|To define a proxy port when instantiating the DDBStreams client||integer|
130
+ |proxyProtocol|To define a proxy protocol when instantiating the DDBStreams client|HTTPS|object|
131
+ |accessKey|Amazon AWS Access Key||string|
132
+ |profileCredentialsName|If using a profile credentials provider this parameter will set the profile name.||string|
133
+ |secretKey|Amazon AWS Secret Key||string|
134
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume a IAM role||string|
135
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
136
+ |useDefaultCredentialsProvider|Set whether the DynamoDB Streams client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
137
+ |useProfileCredentialsProvider|Set whether the Cloudtrail client should expect to load credentials through a profile credentials provider.|false|boolean|
138
+ |useSessionCredentials|Set whether the DDB Streams client should expect to use Session Credentials. This is useful in situation in which the user needs to assume a IAM role for doing operations in DDB.|false|boolean|
139
+
140
+ ## Endpoint Configurations
141
+
142
+
143
+ |Name|Description|Default|Type|
144
+ |---|---|---|---|
145
+ |tableName|Name of the dynamodb table||string|
146
+ |maxResultsPerRequest|Maximum number of records that will be fetched in each poll||integer|
147
+ |overrideEndpoint|Set the need for overidding the endpoint. This option needs to be used in combination with uriEndpointOverride option|false|boolean|
148
+ |region|The region in which DDBStreams client needs to work||string|
149
+ |sendEmptyMessageWhenIdle|If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead.|false|boolean|
150
+ |streamIteratorType|Defines where in the DynamoDB stream to start getting records. Note that using FROM\_START can cause a significant delay before the stream has caught up to real-time.|FROM\_LATEST|object|
151
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
152
+ |amazonDynamoDbStreamsClient|Amazon DynamoDB client to use for all requests for this endpoint||object|
153
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
154
+ |exceptionHandler|To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.||object|
155
+ |exchangePattern|Sets the exchange pattern when the consumer creates an exchange.||object|
156
+ |pollStrategy|A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel.||object|
157
+ |proxyHost|To define a proxy host when instantiating the DDBStreams client||string|
158
+ |proxyPort|To define a proxy port when instantiating the DDBStreams client||integer|
159
+ |proxyProtocol|To define a proxy protocol when instantiating the DDBStreams client|HTTPS|object|
160
+ |backoffErrorThreshold|The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in.||integer|
161
+ |backoffIdleThreshold|The number of subsequent idle polls that should happen before the backoffMultipler should kick-in.||integer|
162
+ |backoffMultiplier|To let the scheduled polling consumer backoff if there has been a number of subsequent idles/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and/or backoffErrorThreshold must also be configured.||integer|
163
+ |delay|Milliseconds before the next poll.|500|integer|
164
+ |greedy|If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages.|false|boolean|
165
+ |initialDelay|Milliseconds before the first poll starts.|1000|integer|
166
+ |repeatCount|Specifies a maximum limit of number of fires. So if you set it to 1, the scheduler will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever.|0|integer|
167
+ |runLoggingLevel|The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that.|TRACE|object|
168
+ |scheduledExecutorService|Allows for configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool.||object|
169
+ |scheduler|To use a cron scheduler from either camel-spring or camel-quartz component. Use value spring or quartz for built in scheduler|none|object|
170
+ |schedulerProperties|To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler.||object|
171
+ |startScheduler|Whether the scheduler should be auto started.|true|boolean|
172
+ |timeUnit|Time unit for initialDelay and delay options.|MILLISECONDS|object|
173
+ |useFixedDelay|Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details.|true|boolean|
174
+ |accessKey|Amazon AWS Access Key||string|
175
+ |profileCredentialsName|If using a profile credentials provider this parameter will set the profile name.||string|
176
+ |secretKey|Amazon AWS Secret Key||string|
177
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume a IAM role||string|
178
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
179
+ |useDefaultCredentialsProvider|Set whether the DynamoDB Streams client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
180
+ |useProfileCredentialsProvider|Set whether the Cloudtrail client should expect to load credentials through a profile credentials provider.|false|boolean|
181
+ |useSessionCredentials|Set whether the DDB Streams client should expect to use Session Credentials. This is useful in situation in which the user needs to assume a IAM role for doing operations in DDB.|false|boolean|
camel-aws2-ec2.md ADDED
@@ -0,0 +1,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws2-ec2
2
+
3
+ **Since Camel 3.1**
4
+
5
+ **Only producer is supported**
6
+
7
+ The AWS2 EC2 component supports the ability to create, run, start, stop
8
+ and terminate [AWS EC2](https://aws.amazon.com/ec2/) instances.
9
+
10
+ Prerequisites
11
+
12
+ You must have a valid Amazon Web Services developer account, and be
13
+ signed up to use Amazon EC2. More information is available at [Amazon
14
+ EC2](https://aws.amazon.com/ec2/).
15
+
16
+ # URI Format
17
+
18
+ aws2-ec2://label[?options]
19
+
20
+ You can append query options to the URI in the following format:
21
+
22
+ `?options=value&option2=value&...`
23
+
24
+ Required EC2 component options
25
+
26
+ You have to provide the amazonEc2Client in the Registry or your
27
+ accessKey and secretKey to access the [Amazon
28
+ EC2](https://aws.amazon.com/ec2/) service.
29
+
30
+ # Usage
31
+
32
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
33
+
34
+ You have the possibility of avoiding the usage of explicit static
35
+ credentials by specifying the useDefaultCredentialsProvider option and
36
+ set it to true.
37
+
38
+ The order of evaluation for Default Credentials Provider is the
39
+ following:
40
+
41
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
42
+
43
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
44
+ `AWS_SECRET_ACCESS_KEY`.
45
+
46
+ - Web Identity Token from AWS STS.
47
+
48
+ - The shared credentials and config files.
49
+
50
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
51
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
52
+ set.
53
+
54
+ - Amazon EC2 Instance profile credentials.
55
+
56
+ You have also the possibility of using Profile Credentials Provider, by
57
+ specifying the useProfileCredentialsProvider option to true and
58
+ profileCredentialsName to the profile name.
59
+
60
+ Only one of static, default and profile credentials could be used at the
61
+ same time.
62
+
63
+ For more information about this you can look at [AWS credentials
64
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
65
+
66
+ # Supported producer operations
67
+
68
+ - createAndRunInstances
69
+
70
+ - startInstances
71
+
72
+ - stopInstances
73
+
74
+ - terminateInstances
75
+
76
+ - describeInstances
77
+
78
+ - describeInstancesStatus
79
+
80
+ - rebootInstances
81
+
82
+ - monitorInstances
83
+
84
+ - unmonitorInstances
85
+
86
+ - createTags
87
+
88
+ - deleteTags
89
+
90
+ # Examples
91
+
92
+ ## Producer Examples
93
+
94
+ - createAndRunInstances: this operation will create an EC2 instance
95
+ and run it
96
+
97
+ <!-- -->
98
+
99
+ from("direct:createAndRun")
100
+ .setHeader(EC2Constants.IMAGE_ID, constant("ami-fd65ba94"))
101
+ .setHeader(EC2Constants.INSTANCE_TYPE, constant(InstanceType.T2Micro))
102
+ .setHeader(EC2Constants.INSTANCE_MIN_COUNT, constant("1"))
103
+ .setHeader(EC2Constants.INSTANCE_MAX_COUNT, constant("1"))
104
+ .to("aws2-ec2://TestDomain?accessKey=xxxx&secretKey=xxxx&operation=createAndRunInstances");
105
+
106
+ - startInstances: this operation will start a list of EC2 instances
107
+
108
+ <!-- -->
109
+
110
+ from("direct:start")
111
+ .process(new Processor() {
112
+ @Override
113
+ public void process(Exchange exchange) throws Exception {
114
+ Collection<String> l = new ArrayList<>();
115
+ l.add("myinstance");
116
+ exchange.getIn().setHeader(AWS2EC2Constants.INSTANCES_IDS, l);
117
+ }
118
+ })
119
+ .to("aws2-ec2://TestDomain?accessKey=xxxx&secretKey=xxxx&operation=startInstances");
120
+
121
+ - stopInstances: this operation will stop a list of EC2 instances
122
+
123
+ <!-- -->
124
+
125
+ from("direct:stop")
126
+ .process(new Processor() {
127
+ @Override
128
+ public void process(Exchange exchange) throws Exception {
129
+ Collection<String> l = new ArrayList<>();
130
+ l.add("myinstance");
131
+ exchange.getIn().setHeader(AWS2EC2Constants.INSTANCES_IDS, l);
132
+ }
133
+ })
134
+ .to("aws2-ec2://TestDomain?accessKey=xxxx&secretKey=xxxx&operation=stopInstances");
135
+
136
+ - terminateInstances: this operation will terminate a list of EC2
137
+ instances
138
+
139
+ <!-- -->
140
+
141
+ from("direct:stop")
142
+ .process(new Processor() {
143
+ @Override
144
+ public void process(Exchange exchange) throws Exception {
145
+ Collection<String> l = new ArrayList<>();
146
+ l.add("myinstance");
147
+ exchange.getIn().setHeader(AWS2EC2Constants.INSTANCES_IDS, l);
148
+ }
149
+ })
150
+ .to("aws2-ec2://TestDomain?accessKey=xxxx&secretKey=xxxx&operation=terminateInstances");
151
+
152
+ # Using a POJO as body
153
+
154
+ Sometimes building an AWS Request can be complex because of multiple
155
+ options. We introduce the possibility to use a POJO as a body. In AWS
156
+ EC2 there are multiple operations you can submit, as an example for
157
+ Create and run an instance, you can do something like:
158
+
159
+ from("direct:start")
160
+ .setBody(RunInstancesRequest.builder().imageId("test-1").instanceType(InstanceType.T2_MICRO).build())
161
+ .to("aws2-ec2://TestDomain?accessKey=xxxx&secretKey=xxxx&operation=createAndRunInstances&pojoRequest=true");
162
+
163
+ In this way, you’ll pass the request directly without the need of
164
+ passing headers and options specifically related to this operation.
165
+
166
+ # Dependencies
167
+
168
+ Maven users will need to add the following dependency to their pom.xml.
169
+
170
+ **pom.xml**
171
+
172
+ <dependency>
173
+ <groupId>org.apache.camel</groupId>
174
+ <artifactId>camel-aws2-ec2</artifactId>
175
+ <version>${camel-version}</version>
176
+ </dependency>
177
+
178
+ where `${camel-version}` must be replaced by the actual version of
179
+ Camel.
180
+
181
+ ## Component Configurations
182
+
183
+
184
+ |Name|Description|Default|Type|
185
+ |---|---|---|---|
186
+ |amazonEc2Client|To use an existing configured AmazonEC2Client client||object|
187
+ |configuration|The component configuration||object|
188
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
189
+ |operation|The operation to perform. It can be createAndRunInstances, startInstances, stopInstances, terminateInstances, describeInstances, describeInstancesStatus, rebootInstances, monitorInstances, unmonitorInstances, createTags or deleteTags||object|
190
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
191
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
192
+ |region|The region in which EC2 client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
193
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
194
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
195
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
196
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
197
+ |proxyHost|To define a proxy host when instantiating the EC2 client||string|
198
+ |proxyPort|To define a proxy port when instantiating the EC2 client||integer|
199
+ |proxyProtocol|To define a proxy protocol when instantiating the EC2 client|HTTPS|object|
200
+ |accessKey|Amazon AWS Access Key||string|
201
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
202
+ |secretKey|Amazon AWS Secret Key||string|
203
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
204
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
205
+ |useDefaultCredentialsProvider|Set whether the EC2 client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
206
+ |useProfileCredentialsProvider|Set whether the EC2 client should expect to load credentials through a profile credentials provider.|false|boolean|
207
+ |useSessionCredentials|Set whether the EC2 client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in EC2.|false|boolean|
208
+
209
+ ## Endpoint Configurations
210
+
211
+
212
+ |Name|Description|Default|Type|
213
+ |---|---|---|---|
214
+ |label|Logical name||string|
215
+ |amazonEc2Client|To use an existing configured AmazonEC2Client client||object|
216
+ |operation|The operation to perform. It can be createAndRunInstances, startInstances, stopInstances, terminateInstances, describeInstances, describeInstancesStatus, rebootInstances, monitorInstances, unmonitorInstances, createTags or deleteTags||object|
217
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
218
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
219
+ |region|The region in which EC2 client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
220
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
221
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
222
+ |proxyHost|To define a proxy host when instantiating the EC2 client||string|
223
+ |proxyPort|To define a proxy port when instantiating the EC2 client||integer|
224
+ |proxyProtocol|To define a proxy protocol when instantiating the EC2 client|HTTPS|object|
225
+ |accessKey|Amazon AWS Access Key||string|
226
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
227
+ |secretKey|Amazon AWS Secret Key||string|
228
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
229
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
230
+ |useDefaultCredentialsProvider|Set whether the EC2 client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
231
+ |useProfileCredentialsProvider|Set whether the EC2 client should expect to load credentials through a profile credentials provider.|false|boolean|
232
+ |useSessionCredentials|Set whether the EC2 client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in EC2.|false|boolean|
camel-aws2-ecs.md ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws2-ecs
2
+
3
+ **Since Camel 3.1**
4
+
5
+ **Only producer is supported**
6
+
7
+ The AWS2 ECS component supports create, delete, describe and list
8
+ clusters [AWS ECS](https://aws.amazon.com/ecs/) clusters instances.
9
+
10
+ Prerequisites
11
+
12
+ You must have a valid Amazon Web Services developer account, and be
13
+ signed up to use Amazon ECS. More information is available at [Amazon
14
+ ECS](https://aws.amazon.com/ecs/).
15
+
16
+ # URI Format
17
+
18
+ aws2-ecs://label[?options]
19
+
20
+ You can append query options to the URI in the following format:
21
+
22
+ `?options=value&option2=value&...`
23
+
24
+ Required ECS component options
25
+
26
+ You have to provide the amazonECSClient in the Registry or your
27
+ accessKey and secretKey to access the [Amazon
28
+ ECS](https://aws.amazon.com/ecs/) service.
29
+
30
+ # Usage
31
+
32
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
33
+
34
+ You have the possibility of avoiding the usage of explicit static
35
+ credentials by specifying the useDefaultCredentialsProvider option and
36
+ set it to true.
37
+
38
+ The order of evaluation for Default Credentials Provider is the
39
+ following:
40
+
41
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
42
+
43
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
44
+ `AWS_SECRET_ACCESS_KEY`.
45
+
46
+ - Web Identity Token from AWS STS.
47
+
48
+ - The shared credentials and config files.
49
+
50
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
51
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
52
+ set.
53
+
54
+ - Amazon EC2 Instance profile credentials.
55
+
56
+ You have also the possibility of using Profile Credentials Provider, by
57
+ specifying the useProfileCredentialsProvider option to true and
58
+ profileCredentialsName to the profile name.
59
+
60
+ Only one of static, default and profile credentials could be used at the
61
+ same time.
62
+
63
+ For more information about this you can look at [AWS credentials
64
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
65
+
66
+ ## ECS Producer operations
67
+
68
+ Camel-AWS ECS component provides the following operation on the producer
69
+ side:
70
+
71
+ - listClusters
72
+
73
+ - createCluster
74
+
75
+ - describeCluster
76
+
77
+ - deleteCluster
78
+
79
+ # Producer Examples
80
+
81
+ - listClusters: this operation will list the available clusters in ECS
82
+
83
+ <!-- -->
84
+
85
+ from("direct:listClusters")
86
+ .to("aws2-ecs://test?ecsClient=#amazonEcsClient&operation=listClusters")
87
+
88
+ # Using a POJO as body
89
+
90
+ Sometimes building an AWS Request can be complex because of multiple
91
+ options. We introduce the possibility to use a POJO as a body. In AWS
92
+ ECS there are multiple operations you can submit, as an example for List
93
+ cluster request, you can do something like:
94
+
95
+ from("direct:start")
96
+ .setBody(ListClustersRequest.builder().maxResults(10).build())
97
+ .to("aws2-ecs://test?ecsClient=#amazonEcsClient&operation=listClusters&pojoRequest=true")
98
+
99
+ In this way, you’ll pass the request directly without the need of
100
+ passing headers and options specifically related to this operation.
101
+
102
+ # Dependencies
103
+
104
+ Maven users will need to add the following dependency to their pom.xml.
105
+
106
+ **pom.xml**
107
+
108
+ <dependency>
109
+ <groupId>org.apache.camel</groupId>
110
+ <artifactId>camel-aws2-ecs</artifactId>
111
+ <version>${camel-version}</version>
112
+ </dependency>
113
+
114
+ where `${camel-version}` must be replaced by the actual version of
115
+ Camel.
116
+
117
+ ## Component Configurations
118
+
119
+
120
+ |Name|Description|Default|Type|
121
+ |---|---|---|---|
122
+ |configuration|Component configuration||object|
123
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
124
+ |operation|The operation to perform||object|
125
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
126
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
127
+ |region|The region in which the ECS client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
128
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
129
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
130
+ |ecsClient|To use an existing configured AWS ECS client||object|
131
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
132
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
133
+ |proxyHost|To define a proxy host when instantiating the ECS client||string|
134
+ |proxyPort|To define a proxy port when instantiating the ECS client||integer|
135
+ |proxyProtocol|To define a proxy protocol when instantiating the ECS client|HTTPS|object|
136
+ |accessKey|Amazon AWS Access Key||string|
137
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
138
+ |secretKey|Amazon AWS Secret Key||string|
139
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
140
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
141
+ |useDefaultCredentialsProvider|Set whether the ECS client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
142
+ |useProfileCredentialsProvider|Set whether the ECS client should expect to load credentials through a profile credentials provider.|false|boolean|
143
+ |useSessionCredentials|Set whether the ECS client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in ECS.|false|boolean|
144
+
145
+ ## Endpoint Configurations
146
+
147
+
148
+ |Name|Description|Default|Type|
149
+ |---|---|---|---|
150
+ |label|Logical name||string|
151
+ |operation|The operation to perform||object|
152
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
153
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
154
+ |region|The region in which the ECS client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
155
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
156
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
157
+ |ecsClient|To use an existing configured AWS ECS client||object|
158
+ |proxyHost|To define a proxy host when instantiating the ECS client||string|
159
+ |proxyPort|To define a proxy port when instantiating the ECS client||integer|
160
+ |proxyProtocol|To define a proxy protocol when instantiating the ECS client|HTTPS|object|
161
+ |accessKey|Amazon AWS Access Key||string|
162
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
163
+ |secretKey|Amazon AWS Secret Key||string|
164
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
165
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
166
+ |useDefaultCredentialsProvider|Set whether the ECS client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
167
+ |useProfileCredentialsProvider|Set whether the ECS client should expect to load credentials through a profile credentials provider.|false|boolean|
168
+ |useSessionCredentials|Set whether the ECS client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in ECS.|false|boolean|
camel-aws2-eks.md ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws2-eks
2
+
3
+ **Since Camel 3.1**
4
+
5
+ **Only producer is supported**
6
+
7
+ The AWS2 EKS component supports create, delete, describe and list
8
+ clusters [AWS EKS](https://aws.amazon.com/eks/) clusters instances.
9
+
10
+ Prerequisites
11
+
12
+ You must have a valid Amazon Web Services developer account, and be
13
+ signed up to use Amazon EKS. More information is available at [Amazon
14
+ EKS](https://aws.amazon.com/eks/).
15
+
16
+ # URI Format
17
+
18
+ aws2-eks://label[?options]
19
+
20
+ You can append query options to the URI in the following format:
21
+
22
+ `?options=value&option2=value&...`
23
+
24
+ Required EKS component options
25
+
26
+ You have to provide the amazonEKSClient in the Registry or your
27
+ accessKey and secretKey to access the [Amazon
28
+ EKS](https://aws.amazon.com/eks/) service.
29
+
30
+ # Usage
31
+
32
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
33
+
34
+ You have the possibility of avoiding the usage of explicit static
35
+ credentials by specifying the useDefaultCredentialsProvider option and
36
+ set it to true.
37
+
38
+ The order of evaluation for Default Credentials Provider is the
39
+ following:
40
+
41
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
42
+
43
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
44
+ `AWS_SECRET_ACCESS_KEY`.
45
+
46
+ - Web Identity Token from AWS STS.
47
+
48
+ - The shared credentials and config files.
49
+
50
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
51
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
52
+ set.
53
+
54
+ - Amazon EC2 Instance profile credentials.
55
+
56
+ You have also the possibility of using Profile Credentials Provider, by
57
+ specifying the useProfileCredentialsProvider option to true and
58
+ profileCredentialsName to the profile name.
59
+
60
+ Only one of static, default and profile credentials could be used at the
61
+ same time.
62
+
63
+ For more information about this you can look at [AWS credentials
64
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
65
+
66
+ ## EKS Producer operations
67
+
68
+ Camel-AWS EKS component provides the following operation on the producer
69
+ side:
70
+
71
+ - listClusters
72
+
73
+ - createCluster
74
+
75
+ - describeCluster
76
+
77
+ - deleteCluster
78
+
79
+ # Producer Examples
80
+
81
+ - listClusters: this operation will list the available clusters in EKS
82
+
83
+ <!-- -->
84
+
85
+ from("direct:listClusters")
86
+ .to("aws2-eks://test?eksClient=#amazonEksClient&operation=listClusters")
87
+
88
+ # Using a POJO as body
89
+
90
+ Sometimes building an AWS Request can be complex because of multiple
91
+ options. We introduce the possibility to use a POJO as a body. In AWS
92
+ EKS there are multiple operations you can submit, as an example for List
93
+ cluster request, you can do something like:
94
+
95
+ from("direct:start")
96
+ .setBody(ListClustersRequest.builder().maxResults(12).build())
97
+ .to("aws2-eks://test?eksClient=#amazonEksClient&operation=listClusters&pojoRequest=true")
98
+
99
+ In this way, you’ll pass the request directly without the need of
100
+ passing headers and options specifically related to this operation.
101
+
102
+ # Dependencies
103
+
104
+ Maven users will need to add the following dependency to their pom.xml.
105
+
106
+ **pom.xml**
107
+
108
+ <dependency>
109
+ <groupId>org.apache.camel</groupId>
110
+ <artifactId>camel-aws2-eks</artifactId>
111
+ <version>${camel-version}</version>
112
+ </dependency>
113
+
114
+ where `${camel-version}` must be replaced by the actual version of
115
+ Camel.
116
+
117
+ ## Component Configurations
118
+
119
+
120
+ |Name|Description|Default|Type|
121
+ |---|---|---|---|
122
+ |configuration|Component configuration||object|
123
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
124
+ |operation|The operation to perform||object|
125
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
126
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
127
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name|false|string|
128
+ |region|The region in which EKS client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
129
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
130
+ |useDefaultCredentialsProvider|Set whether the EKS client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
131
+ |useProfileCredentialsProvider|Set whether the EKS client should expect to load credentials through a profile credentials provider.|false|boolean|
132
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
133
+ |eksClient|To use an existing configured AWS EKS client||object|
134
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
135
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
136
+ |proxyHost|To define a proxy host when instantiating the EKS client||string|
137
+ |proxyPort|To define a proxy port when instantiating the EKS client||integer|
138
+ |proxyProtocol|To define a proxy protocol when instantiating the EKS client|HTTPS|object|
139
+ |accessKey|Amazon AWS Access Key||string|
140
+ |secretKey|Amazon AWS Secret Key||string|
141
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
142
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
143
+ |useSessionCredentials|Set whether the EKS client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in EKS.|false|boolean|
144
+
145
+ ## Endpoint Configurations
146
+
147
+
148
+ |Name|Description|Default|Type|
149
+ |---|---|---|---|
150
+ |label|Logical name||string|
151
+ |operation|The operation to perform||object|
152
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
153
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
154
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name|false|string|
155
+ |region|The region in which EKS client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
156
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
157
+ |useDefaultCredentialsProvider|Set whether the EKS client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
158
+ |useProfileCredentialsProvider|Set whether the EKS client should expect to load credentials through a profile credentials provider.|false|boolean|
159
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
160
+ |eksClient|To use an existing configured AWS EKS client||object|
161
+ |proxyHost|To define a proxy host when instantiating the EKS client||string|
162
+ |proxyPort|To define a proxy port when instantiating the EKS client||integer|
163
+ |proxyProtocol|To define a proxy protocol when instantiating the EKS client|HTTPS|object|
164
+ |accessKey|Amazon AWS Access Key||string|
165
+ |secretKey|Amazon AWS Secret Key||string|
166
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
167
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
168
+ |useSessionCredentials|Set whether the EKS client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in EKS.|false|boolean|
camel-aws2-eventbridge.md ADDED
@@ -0,0 +1,365 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws2-eventbridge
2
+
3
+ **Since Camel 3.6**
4
+
5
+ **Only producer is supported**
6
+
7
+ The AWS2 Eventbridge component supports assumeRole operation. [AWS
8
+ Eventbridge](https://aws.amazon.com/eventbridge/).
9
+
10
+ Prerequisites
11
+
12
+ You must have a valid Amazon Web Services developer account, and be
13
+ signed up to use Amazon Eventbridge. More information is available at
14
+ [Amazon Eventbridge](https://aws.amazon.com/eventbridge/).
15
+
16
+ To create a rule that triggers on an action by an AWS service that does
17
+ not emit events, you can base the rule on API calls made by that
18
+ service. The API calls are recorded by AWS CloudTrail, so you’ll need to
19
+ have CloudTrail enabled. For more information, check [Services Supported
20
+ by CloudTrail Event
21
+ History](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events.html).
22
+
23
+ # URI Format
24
+
25
+ aws2-eventbridge://label[?options]
26
+
27
+ You can append query options to the URI in the following format:
28
+
29
+ `?options=value&option2=value&...`
30
+
31
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
32
+
33
+ You have the possibility of avoiding the usage of explicit static
34
+ credentials by specifying the useDefaultCredentialsProvider option and
35
+ set it to true.
36
+
37
+ The order of evaluation for Default Credentials Provider is the
38
+ following:
39
+
40
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
41
+
42
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
43
+ `AWS_SECRET_ACCESS_KEY`.
44
+
45
+ - Web Identity Token from AWS STS.
46
+
47
+ - The shared credentials and config files.
48
+
49
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
50
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
51
+ set.
52
+
53
+ - Amazon EC2 Instance profile credentials.
54
+
55
+ You have also the possibility of using Profile Credentials Provider, by
56
+ specifying the useProfileCredentialsProvider option to true and
57
+ profileCredentialsName to the profile name.
58
+
59
+ Only one of static, default and profile credentials could be used at the
60
+ same time.
61
+
62
+ For more information about this you can look at [AWS credentials
63
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
64
+
65
+ ## AWS2-Eventbridge Producer operations
66
+
67
+ Camel-AWS2-Eventbridge component provides the following operation on the
68
+ producer side:
69
+
70
+ - putRule
71
+
72
+ - putTargets
73
+
74
+ - removeTargets
75
+
76
+ - deleteRule
77
+
78
+ - enableRule
79
+
80
+ - disableRule
81
+
82
+ - listRules
83
+
84
+ - describeRule
85
+
86
+ - listTargetsByRule
87
+
88
+ - listRuleNamesByTarget
89
+
90
+ - putEvent
91
+
92
+ - PutRule: this operation creates a rule related to an eventbus
93
+
94
+ <!-- -->
95
+
96
+ from("direct:putRule").process(new Processor() {
97
+
98
+ @Override
99
+ public void process(Exchange exchange) throws Exception {
100
+ exchange.getIn().setHeader(EventbridgeConstants.RULE_NAME, "firstrule");
101
+ }
102
+ })
103
+ .to("aws2-eventbridge://test?operation=putRule&eventPatternFile=file:src/test/resources/eventpattern.json")
104
+ .to("mock:result");
105
+
106
+ This operation will create a rule named *firstrule*, and it will use a
107
+ json file for defining the EventPattern.
108
+
109
+ - PutTargets: this operation will add a target to the rule
110
+
111
+ <!-- -->
112
+
113
+ from("direct:start").process(new Processor() {
114
+
115
+ @Override
116
+ public void process(Exchange exchange) throws Exception {
117
+ exchange.getIn().setHeader(EventbridgeConstants.RULE_NAME, "firstrule");
118
+ Target target = Target.builder().id("sqs-queue").arn("arn:aws:sqs:eu-west-1:780410022472:camel-connector-test")
119
+ .build();
120
+ List<Target> targets = new ArrayList<Target>();
121
+ targets.add(target);
122
+ exchange.getIn().setHeader(EventbridgeConstants.TARGETS, targets);
123
+ }
124
+ })
125
+ .to("aws2-eventbridge://test?operation=putTargets")
126
+ .to("mock:result");
127
+
128
+ This operation will add the target sqs-queue with the arn reported to
129
+ the targets of the *firstrule* rule.
130
+
131
+ - RemoveTargets: this operation will remove a collection of targets
132
+ from the rule
133
+
134
+ <!-- -->
135
+
136
+ from("direct:start").process(new Processor() {
137
+
138
+ @Override
139
+ public void process(Exchange exchange) throws Exception {
140
+ exchange.getIn().setHeader(EventbridgeConstants.RULE_NAME, "firstrule");
141
+ List<String> ids = new ArrayList<String>();
142
+ targets.add("sqs-queue");
143
+ exchange.getIn().setHeader(EventbridgeConstants.TARGETS_IDS, targets);
144
+ }
145
+ })
146
+ .to("aws2-eventbridge://test?operation=removeTargets")
147
+ .to("mock:result");
148
+
149
+ This operation will remove the target sqs-queue from the *firstrule*
150
+ rule.
151
+
152
+ - DeleteRule: this operation will delete a rule related to an eventbus
153
+
154
+ <!-- -->
155
+
156
+ from("direct:start").process(new Processor() {
157
+
158
+ @Override
159
+ public void process(Exchange exchange) throws Exception {
160
+ exchange.getIn().setHeader(EventbridgeConstants.RULE_NAME, "firstrule");
161
+ }
162
+ })
163
+ .to("aws2-eventbridge://test?operation=deleteRule")
164
+ .to("mock:result");
165
+
166
+ This operation will remove the *firstrule* rule from the test eventbus.
167
+
168
+ - EnableRule: this operation will enable a rule related to an eventbus
169
+
170
+ <!-- -->
171
+
172
+ from("direct:start").process(new Processor() {
173
+
174
+ @Override
175
+ public void process(Exchange exchange) throws Exception {
176
+ exchange.getIn().setHeader(EventbridgeConstants.RULE_NAME, "firstrule");
177
+ }
178
+ })
179
+ .to("aws2-eventbridge://test?operation=enableRule")
180
+ .to("mock:result");
181
+
182
+ This operation will enable the *firstrule* rule from the test eventbus.
183
+
184
+ - DisableRule: this operation will disable a rule related to an
185
+ eventbus
186
+
187
+ <!-- -->
188
+
189
+ from("direct:start").process(new Processor() {
190
+
191
+ @Override
192
+ public void process(Exchange exchange) throws Exception {
193
+ exchange.getIn().setHeader(EventbridgeConstants.RULE_NAME, "firstrule");
194
+ }
195
+ })
196
+ .to("aws2-eventbridge://test?operation=disableRule")
197
+ .to("mock:result");
198
+
199
+ This operation will disable the *firstrule* rule from the test eventbus.
200
+
201
+ - ListRules: this operation will list all the rules related to an
202
+ eventbus with prefix first
203
+
204
+ <!-- -->
205
+
206
+ from("direct:start").process(new Processor() {
207
+
208
+ @Override
209
+ public void process(Exchange exchange) throws Exception {
210
+ exchange.getIn().setHeader(EventbridgeConstants.RULE_NAME_PREFIX, "first");
211
+ }
212
+ })
213
+ .to("aws2-eventbridge://test?operation=listRules")
214
+ .to("mock:result");
215
+
216
+ This operation will list all the rules with prefix first from the test
217
+ eventbus.
218
+
219
+ - DescribeRule: this operation will describe a specified rule related
220
+ to an eventbus
221
+
222
+ <!-- -->
223
+
224
+ from("direct:start").process(new Processor() {
225
+
226
+ @Override
227
+ public void process(Exchange exchange) throws Exception {
228
+ exchange.getIn().setHeader(EventbridgeConstants.RULE_NAME, "firstrule");
229
+ }
230
+ })
231
+ .to("aws2-eventbridge://test?operation=describeRule")
232
+ .to("mock:result");
233
+
234
+ This operation will describe the *firstrule* rule from the test
235
+ eventbus.
236
+
237
+ - ListTargetsByRule: this operation will return a list of targets
238
+ associated with a rule
239
+
240
+ <!-- -->
241
+
242
+ from("direct:start").process(new Processor() {
243
+
244
+ @Override
245
+ public void process(Exchange exchange) throws Exception {
246
+ exchange.getIn().setHeader(EventbridgeConstants.RULE_NAME, "firstrule");
247
+ }
248
+ })
249
+ .to("aws2-eventbridge://test?operation=listTargetsByRule")
250
+ .to("mock:result");
251
+
252
+ this operation will return a list of targets associated with the
253
+ *firstrule* rule.
254
+
255
+ - ListRuleNamesByTarget: this operation will return a list of rules
256
+ associated with a target
257
+
258
+ <!-- -->
259
+
260
+ from("direct:start").process(new Processor() {
261
+
262
+ @Override
263
+ public void process(Exchange exchange) throws Exception {
264
+ exchange.getIn().setHeader(EventbridgeConstants.TARGET_ARN, "firstrule");
265
+ }
266
+ })
267
+ .to("aws2-eventbridge://test?operation=listRuleNamesByTarget")
268
+ .to("mock:result");
269
+
270
+ this operation will return a list of rules associated with a target.
271
+
272
+ - PutEvent: this operation will send an event to the Servicebus
273
+
274
+ <!-- -->
275
+
276
+ from("direct:start").process(new Processor() {
277
+
278
+ @Override
279
+ public void process(Exchange exchange) throws Exception {
280
+ exchange.getIn().setHeader(EventbridgeConstants.EVENT_RESOURCES_ARN, "arn:aws:sqs:eu-west-1:780410022472:camel-connector-test");
281
+ exchange.getIn().setHeader(EventbridgeConstants.EVENT_SOURCE, "com.pippo");
282
+ exchange.getIn().setHeader(EventbridgeConstants.EVENT_DETAIL_TYPE, "peppe");
283
+ exchange.getIn().setBody("Test Event");
284
+ }
285
+ })
286
+ .to("aws2-eventbridge://test?operation=putEvent")
287
+ .to("mock:result");
288
+
289
+ this operation will return a list of entries with related ID sent to
290
+ servicebus.
291
+
292
+ # Updating the rule
293
+
294
+ To update a rule, you’ll need to perform the putRule operation again.
295
+ There is no explicit update rule operation in the Java SDK.
296
+
297
+ # Dependencies
298
+
299
+ Maven users will need to add the following dependency to their pom.xml.
300
+
301
+ **pom.xml**
302
+
303
+ <dependency>
304
+ <groupId>org.apache.camel</groupId>
305
+ <artifactId>camel-aws2-eventbridge</artifactId>
306
+ <version>${camel-version}</version>
307
+ </dependency>
308
+
309
+ where `${camel-version}` must be replaced by the actual version of
310
+ Camel.
311
+
312
+ ## Component Configurations
313
+
314
+
315
+ |Name|Description|Default|Type|
316
+ |---|---|---|---|
317
+ |configuration|Component configuration||object|
318
+ |eventPatternFile|EventPattern File||string|
319
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
320
+ |operation|The operation to perform|putRule|object|
321
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
322
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
323
+ |region|The region in which the Eventbridge client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
324
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
325
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
326
+ |eventbridgeClient|To use an existing configured AWS Eventbridge client||object|
327
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
328
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
329
+ |proxyHost|To define a proxy host when instantiating the Eventbridge client||string|
330
+ |proxyPort|To define a proxy port when instantiating the Eventbridge client||integer|
331
+ |proxyProtocol|To define a proxy protocol when instantiating the Eventbridge client|HTTPS|object|
332
+ |accessKey|Amazon AWS Access Key||string|
333
+ |profileCredentialsName|If using a profile credentials provider this parameter will set the profile name||string|
334
+ |secretKey|Amazon AWS Secret Key||string|
335
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
336
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
337
+ |useDefaultCredentialsProvider|Set whether the Eventbridge client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
338
+ |useProfileCredentialsProvider|Set whether the Eventbridge client should expect to load credentials through a profile credentials provider.|false|boolean|
339
+ |useSessionCredentials|Set whether the Eventbridge client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in Eventbridge.|false|boolean|
340
+
341
+ ## Endpoint Configurations
342
+
343
+
344
+ |Name|Description|Default|Type|
345
+ |---|---|---|---|
346
+ |eventbusNameOrArn|Event bus name or ARN||string|
347
+ |eventPatternFile|EventPattern File||string|
348
+ |operation|The operation to perform|putRule|object|
349
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
350
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
351
+ |region|The region in which the Eventbridge client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
352
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
353
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
354
+ |eventbridgeClient|To use an existing configured AWS Eventbridge client||object|
355
+ |proxyHost|To define a proxy host when instantiating the Eventbridge client||string|
356
+ |proxyPort|To define a proxy port when instantiating the Eventbridge client||integer|
357
+ |proxyProtocol|To define a proxy protocol when instantiating the Eventbridge client|HTTPS|object|
358
+ |accessKey|Amazon AWS Access Key||string|
359
+ |profileCredentialsName|If using a profile credentials provider this parameter will set the profile name||string|
360
+ |secretKey|Amazon AWS Secret Key||string|
361
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
362
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
363
+ |useDefaultCredentialsProvider|Set whether the Eventbridge client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
364
+ |useProfileCredentialsProvider|Set whether the Eventbridge client should expect to load credentials through a profile credentials provider.|false|boolean|
365
+ |useSessionCredentials|Set whether the Eventbridge client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in Eventbridge.|false|boolean|
camel-aws2-iam.md ADDED
@@ -0,0 +1,228 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws2-iam
2
+
3
+ **Since Camel 3.1**
4
+
5
+ **Only producer is supported**
6
+
7
+ The AWS2 IAM component supports create, run, start, stop and terminate
8
+ [AWS IAM](https://aws.amazon.com/iam/) instances.
9
+
10
+ Prerequisites
11
+
12
+ You must have a valid Amazon Web Services developer account, and be
13
+ signed up to use Amazon IAM. More information is available at [Amazon
14
+ IAM](https://aws.amazon.com/iam/).
15
+
16
+ # URI Format
17
+
18
+ aws2-iam://label[?options]
19
+
20
+ You can append query options to the URI in the following format:
21
+
22
+ `?options=value&option2=value&...`
23
+
24
+ The AWS2 IAM component works on the aws-global region, and it has
25
+ aws-global as the default region
26
+
27
+ Required IAM component options
28
+
29
+ You have to provide the amazonKmsClient in the Registry or your
30
+ accessKey and secretKey to access the [Amazon
31
+ IAM](https://aws.amazon.com/iam/) service.
32
+
33
+ # Usage
34
+
35
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
36
+
37
+ You have the possibility of avoiding the usage of explicit static
38
+ credentials by specifying the useDefaultCredentialsProvider option and
39
+ set it to true.
40
+
41
+ The order of evaluation for Default Credentials Provider is the
42
+ following:
43
+
44
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
45
+
46
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
47
+ `AWS_SECRET_ACCESS_KEY`.
48
+
49
+ - Web Identity Token from AWS STS.
50
+
51
+ - The shared credentials and config files.
52
+
53
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
54
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
55
+ set.
56
+
57
+ - Amazon EC2 Instance profile credentials.
58
+
59
+ You have also the possibility of using Profile Credentials Provider, by
60
+ specifying the useProfileCredentialsProvider option to true and
61
+ profileCredentialsName to the profile name.
62
+
63
+ Only one of static, default and profile credentials could be used at the
64
+ same time.
65
+
66
+ For more information about this you can look at [AWS credentials
67
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
68
+
69
+ ## IAM Producer operations
70
+
71
+ Camel-AWS2 IAM component provides the following operation on the
72
+ producer side:
73
+
74
+ - listAccessKeys
75
+
76
+ - createUser
77
+
78
+ - deleteUser
79
+
80
+ - listUsers
81
+
82
+ - getUser
83
+
84
+ - createAccessKey
85
+
86
+ - deleteAccessKey
87
+
88
+ - updateAccessKey
89
+
90
+ - createGroup
91
+
92
+ - deleteGroup
93
+
94
+ - listGroups
95
+
96
+ - addUserToGroup
97
+
98
+ - removeUserFromGroup
99
+
100
+ # Producer Examples
101
+
102
+ - createUser: this operation will create a user in IAM
103
+
104
+ <!-- -->
105
+
106
+ from("direct:createUser")
107
+ .setHeader(IAM2Constants.USERNAME, constant("camel"))
108
+ .to("aws2-iam://test?iamClient=#amazonIAMClient&operation=createUser")
109
+
110
+ - deleteUser: this operation will delete a user in IAM
111
+
112
+ <!-- -->
113
+
114
+ from("direct:deleteUser")
115
+ .setHeader(IAM2Constants.USERNAME, constant("camel"))
116
+ .to("aws2-iam://test?iamClient=#amazonIAMClient&operation=deleteUser")
117
+
118
+ - listUsers: this operation will list the users in IAM
119
+
120
+ <!-- -->
121
+
122
+ from("direct:listUsers")
123
+ .to("aws2-iam://test?iamClient=#amazonIAMClient&operation=listUsers")
124
+
125
+ - createGroup: this operation will add a group in IAM
126
+
127
+ <!-- -->
128
+
129
+ from("direct:deleteUser")
130
+ .setHeader(IAM2Constants.GROUP_NAME, constant("camel"))
131
+ .to("aws2-iam://test?iamClient=#amazonIAMClient&operation=createGroup")
132
+
133
+ - deleteGroup: this operation will delete a group in IAM
134
+
135
+ <!-- -->
136
+
137
+ from("direct:deleteUser")
138
+ .setHeader(IAM2Constants.GROUP_NAME, constant("camel"))
139
+ .to("aws2-iam://test?iamClient=#amazonIAMClient&operation=deleteGroup")
140
+
141
+ - listGroups: this operation will list the groups in IAM
142
+
143
+ <!-- -->
144
+
145
+ from("direct:listUsers")
146
+ .to("aws2-iam://test?iamClient=#amazonIAMClient&operation=listGroups")
147
+
148
+ # Using a POJO as body
149
+
150
+ Sometimes building an AWS Request can be complex because of multiple
151
+ options. We introduce the possibility to use a POJO as a body. In AWS
152
+ IAM, there are multiple operations you can submit, as an example for
153
+ Create User request, you can do something like:
154
+
155
+ from("direct:createUser")
156
+ .setBody(CreateUserRequest.builder().userName("camel").build())
157
+ .to("aws2-iam://test?iamClient=#amazonIAMClient&operation=createUser&pojoRequest=true")
158
+
159
+ In this way, you’ll pass the request directly without the need of
160
+ passing headers and options specifically related to this operation.
161
+
162
+ # Dependencies
163
+
164
+ Maven users will need to add the following dependency to their pom.xml.
165
+
166
+ **pom.xml**
167
+
168
+ <dependency>
169
+ <groupId>org.apache.camel</groupId>
170
+ <artifactId>camel-aws2-iam</artifactId>
171
+ <version>${camel-version}</version>
172
+ </dependency>
173
+
174
+ where `${camel-version}` must be replaced by the actual version of
175
+ Camel.
176
+
177
+ ## Component Configurations
178
+
179
+
180
+ |Name|Description|Default|Type|
181
+ |---|---|---|---|
182
+ |configuration|Component configuration||object|
183
+ |iamClient|To use an existing configured AWS IAM client||object|
184
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
185
+ |operation|The operation to perform. You can configure a default operation on the component level, or the operation as part of the endpoint, or via a message header with the key CamelAwsIAMOperation.||object|
186
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
187
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
188
+ |region|The region in which IAM client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()|aws-global|string|
189
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
190
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
191
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
192
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
193
+ |proxyHost|To define a proxy host when instantiating the IAM client||string|
194
+ |proxyPort|To define a proxy port when instantiating the IAM client||integer|
195
+ |proxyProtocol|To define a proxy protocol when instantiating the IAM client|HTTPS|object|
196
+ |accessKey|Amazon AWS Access Key||string|
197
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
198
+ |secretKey|Amazon AWS Secret Key||string|
199
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
200
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
201
+ |useDefaultCredentialsProvider|Set whether the IAM client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
202
+ |useProfileCredentialsProvider|Set whether the IAM client should expect to load credentials through a profile credentials provider.|false|boolean|
203
+ |useSessionCredentials|Set whether the IAM client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume a IAM role for doing operations in IAM.|false|boolean|
204
+
205
+ ## Endpoint Configurations
206
+
207
+
208
+ |Name|Description|Default|Type|
209
+ |---|---|---|---|
210
+ |label|Logical name||string|
211
+ |iamClient|To use an existing configured AWS IAM client||object|
212
+ |operation|The operation to perform. You can configure a default operation on the component level, or the operation as part of the endpoint, or via a message header with the key CamelAwsIAMOperation.||object|
213
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
214
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
215
+ |region|The region in which IAM client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()|aws-global|string|
216
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
217
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
218
+ |proxyHost|To define a proxy host when instantiating the IAM client||string|
219
+ |proxyPort|To define a proxy port when instantiating the IAM client||integer|
220
+ |proxyProtocol|To define a proxy protocol when instantiating the IAM client|HTTPS|object|
221
+ |accessKey|Amazon AWS Access Key||string|
222
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
223
+ |secretKey|Amazon AWS Secret Key||string|
224
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
225
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
226
+ |useDefaultCredentialsProvider|Set whether the IAM client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
227
+ |useProfileCredentialsProvider|Set whether the IAM client should expect to load credentials through a profile credentials provider.|false|boolean|
228
+ |useSessionCredentials|Set whether the IAM client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume a IAM role for doing operations in IAM.|false|boolean|
camel-aws2-kinesis-firehose.md ADDED
@@ -0,0 +1,192 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws2-kinesis-firehose
2
+
3
+ **Since Camel 3.2**
4
+
5
+ **Only producer is supported**
6
+
7
+ The AWS2 Kinesis Firehose component supports sending messages to Amazon
8
+ Kinesis Firehose service (Batch not supported).
9
+
10
+ Prerequisites
11
+
12
+ You must have a valid Amazon Web Services developer account, and be
13
+ signed up to use Amazon Kinesis Firehose. More information is available
14
+ at [AWS Kinesis Firehose](https://aws.amazon.com/kinesis/firehose/)
15
+
16
+ The AWS2 Kinesis Firehose component is not supported in OSGI
17
+
18
+ # URI Format
19
+
20
+ aws2-kinesis-firehose://delivery-stream-name[?options]
21
+
22
+ The stream needs to be created prior to it being used.
23
+
24
+ You can append query options to the URI in the following format:
25
+
26
+ `?options=value&option2=value&...`
27
+
28
+ # URI Options
29
+
30
+ Required Kinesis Firehose component options
31
+
32
+ You have to provide the FirehoseClient in the Registry with proxies and
33
+ relevant credentials configured.
34
+
35
+ # Usage
36
+
37
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
38
+
39
+ You have the possibility of avoiding the usage of explicit static
40
+ credentials by specifying the useDefaultCredentialsProvider option and
41
+ set it to true.
42
+
43
+ The order of evaluation for Default Credentials Provider is the
44
+ following:
45
+
46
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`
47
+
48
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
49
+ `AWS_SECRET_ACCESS_KEY`.
50
+
51
+ - Web Identity Token from AWS STS.
52
+
53
+ - The shared credentials and config files.
54
+
55
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
56
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
57
+ set.
58
+
59
+ - Amazon EC2 Instance profile credentials.
60
+
61
+ You have also the possibility of using Profile Credentials Provider, by
62
+ specifying the useProfileCredentialsProvider option to true and
63
+ profileCredentialsName to the profile name.
64
+
65
+ Only one of static, default and profile credentials could be used at the
66
+ same time.
67
+
68
+ For more information about this you can look at [AWS credentials
69
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
70
+
71
+ ## Amazon Kinesis Firehose configuration
72
+
73
+ You then have to reference the FirehoseClient in the
74
+ `amazonKinesisFirehoseClient` URI option.
75
+
76
+ from("aws2-kinesis-firehose://mykinesisdeliverystream?amazonKinesisFirehoseClient=#kinesisClient")
77
+ .to("log:out?showAll=true");
78
+
79
+ ## Providing AWS Credentials
80
+
81
+ It is recommended that the credentials are obtained by using the
82
+ [DefaultAWSCredentialsProviderChain](http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/DefaultAWSCredentialsProviderChain.html)
83
+ that is the default when creating a new ClientConfiguration instance,
84
+ however, a different
85
+ [AWSCredentialsProvider](http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/AWSCredentialsProvider.html)
86
+ can be specified when calling createClient(…).
87
+
88
+ ## Kinesis Firehose Producer operations
89
+
90
+ Camel-AWS s3 component provides the following operation on the producer
91
+ side:
92
+
93
+ - SendBatchRecord
94
+
95
+ - CreateDeliveryStream
96
+
97
+ - DeleteDeliveryStream
98
+
99
+ - DescribeDeliveryStream
100
+
101
+ - UpdateDestination
102
+
103
+ ## Send Batch Records Example
104
+
105
+ You can send an iterable of Kinesis Record (as the following example
106
+ shows), or you can send directly a PutRecordBatchRequest POJO instance
107
+ in the body.
108
+
109
+ @Test
110
+ public void testFirehoseBatchRouting() throws Exception {
111
+ Exchange exchange = template.send("direct:start", ExchangePattern.InOnly, new Processor() {
112
+ public void process(Exchange exchange) throws Exception {
113
+ List<Record> recs = new ArrayList<Record>();
114
+ Record rec = Record.builder().data(SdkBytes.fromString("Test1", Charset.defaultCharset())).build();
115
+ Record rec1 = Record.builder().data(SdkBytes.fromString("Test2", Charset.defaultCharset())).build();
116
+ recs.add(rec);
117
+ recs.add(rec1);
118
+ exchange.getIn().setBody(recs);
119
+ }
120
+ });
121
+ assertNotNull(exchange.getIn().getBody());
122
+ }
123
+
124
+ from("direct:start").to("aws2-kinesis-firehose://cc?amazonKinesisFirehoseClient=#FirehoseClient&operation=sendBatchRecord");
125
+
126
+ In the deliveryStream you’ll find "Test1Test2".
127
+
128
+ # Dependencies
129
+
130
+ Maven users will need to add the following dependency to their pom.xml.
131
+
132
+ **pom.xml**
133
+
134
+ <dependency>
135
+ <groupId>org.apache.camel</groupId>
136
+ <artifactId>camel-aws2-kinesis</artifactId>
137
+ <version>${camel-version}</version>
138
+ </dependency>
139
+
140
+ where `${camel-version}` must be replaced by the actual version of
141
+ Camel.
142
+
143
+ ## Component Configurations
144
+
145
+
146
+ |Name|Description|Default|Type|
147
+ |---|---|---|---|
148
+ |cborEnabled|This option will set the CBOR\_ENABLED property during the execution|true|boolean|
149
+ |configuration|Component configuration||object|
150
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with uriEndpointOverride option|false|boolean|
151
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
152
+ |operation|The operation to do in case the user don't want to send only a record||object|
153
+ |region|The region in which Kinesis Firehose client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
154
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
155
+ |useDefaultCredentialsProvider|Set whether the Kinesis Firehose client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
156
+ |amazonKinesisFirehoseClient|Amazon Kinesis Firehose client to use for all requests for this endpoint||object|
157
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
158
+ |proxyHost|To define a proxy host when instantiating the Kinesis Firehose client||string|
159
+ |proxyPort|To define a proxy port when instantiating the Kinesis Firehose client||integer|
160
+ |proxyProtocol|To define a proxy protocol when instantiating the Kinesis Firehose client|HTTPS|object|
161
+ |accessKey|Amazon AWS Access Key||string|
162
+ |profileCredentialsName|If using a profile credentials provider this parameter will set the profile name.||string|
163
+ |secretKey|Amazon AWS Secret Key||string|
164
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume a IAM role||string|
165
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
166
+ |useProfileCredentialsProvider|Set whether the Kinesis Firehose client should expect to load credentials through a profile credentials provider.|false|boolean|
167
+ |useSessionCredentials|Set whether the Kinesis Firehose client should expect to use Session Credentials. This is useful in situation in which the user needs to assume a IAM role for doing operations in Kinesis Firehose.|false|boolean|
168
+
169
+ ## Endpoint Configurations
170
+
171
+
172
+ |Name|Description|Default|Type|
173
+ |---|---|---|---|
174
+ |streamName|Name of the stream||string|
175
+ |cborEnabled|This option will set the CBOR\_ENABLED property during the execution|true|boolean|
176
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with uriEndpointOverride option|false|boolean|
177
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
178
+ |operation|The operation to do in case the user don't want to send only a record||object|
179
+ |region|The region in which Kinesis Firehose client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
180
+ |useDefaultCredentialsProvider|Set whether the Kinesis Firehose client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
181
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
182
+ |amazonKinesisFirehoseClient|Amazon Kinesis Firehose client to use for all requests for this endpoint||object|
183
+ |proxyHost|To define a proxy host when instantiating the Kinesis Firehose client||string|
184
+ |proxyPort|To define a proxy port when instantiating the Kinesis Firehose client||integer|
185
+ |proxyProtocol|To define a proxy protocol when instantiating the Kinesis Firehose client|HTTPS|object|
186
+ |accessKey|Amazon AWS Access Key||string|
187
+ |profileCredentialsName|If using a profile credentials provider this parameter will set the profile name.||string|
188
+ |secretKey|Amazon AWS Secret Key||string|
189
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume a IAM role||string|
190
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
191
+ |useProfileCredentialsProvider|Set whether the Kinesis Firehose client should expect to load credentials through a profile credentials provider.|false|boolean|
192
+ |useSessionCredentials|Set whether the Kinesis Firehose client should expect to use Session Credentials. This is useful in situation in which the user needs to assume a IAM role for doing operations in Kinesis Firehose.|false|boolean|
camel-aws2-kinesis.md ADDED
@@ -0,0 +1,242 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws2-kinesis
2
+
3
+ **Since Camel 3.2**
4
+
5
+ **Both producer and consumer are supported**
6
+
7
+ The AWS2 Kinesis component supports consuming messages from and
8
+ producing messages to Amazon Kinesis service.
9
+
10
+ The AWS2 Kinesis component also supports Synchronous and Asynchronous
11
+ Client, which means you choose what fits best your requirements, so if
12
+ you need the connection (client) to be async, there’s a property of
13
+ *asyncClient* (in DSL also can be found) needs to be turned true.
14
+
15
+ Prerequisites
16
+
17
+ You must have a valid Amazon Web Services developer account, and be
18
+ signed up to use Amazon Kinesis. More information is available at [AWS
19
+ Kinesis](https://aws.amazon.com/kinesis/)
20
+
21
+ # URI Format
22
+
23
+ aws2-kinesis://stream-name[?options]
24
+
25
+ The stream needs to be created prior to it being used.
26
+
27
+ You can append query options to the URI in the following format:
28
+
29
+ `?options=value&option2=value&...`
30
+
31
+ Required Kinesis component options
32
+
33
+ You have to provide the KinesisClient in the Registry with proxies and
34
+ relevant credentials configured.
35
+
36
+ # Batch Consumer
37
+
38
+ This component implements the Batch Consumer.
39
+
40
+ This allows you, for instance, to know how many messages exist in this
41
+ batch and for instance, let the Aggregator aggregate this number of
42
+ messages.
43
+
44
+ The consumer is able to consume either from a single specific shard or
45
+ all available shards (multiple shards consumption) of Amazon Kinesis,
46
+ therefore, if you leave the *shardId* property in the DSL configuration
47
+ empty, then it’ll consume all available shards otherwise only the
48
+ specified shard corresponding to the shardId will be consumed.
49
+
50
+ # Batch Producer
51
+
52
+ This component implements the Batch Producer.
53
+
54
+ This allows you to send multiple messages in a single request to Amazon
55
+ Kinesis. Messages with batch size more than 500 is allowed. Producer
56
+ will split them into multiple requests.
57
+
58
+ The batch type needs to implement the `Iterable` interface. For example,
59
+ it can be a `List`, `Set` or any other collection type. The message type
60
+ can be one or more of types `byte[]`, `ByteBuffer`, UTF-8 `String`, or
61
+ `InputStream`. Other types are not supported.
62
+
63
+ # Usage
64
+
65
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
66
+
67
+ You have the possibility of avoiding the usage of explicit static
68
+ credentials by specifying the useDefaultCredentialsProvider option and
69
+ set it to true.
70
+
71
+ The order of evaluation for Default Credentials Provider is the
72
+ following:
73
+
74
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
75
+
76
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
77
+ `AWS_SECRET_ACCESS_KEY`.
78
+
79
+ - Web Identity Token from AWS STS.
80
+
81
+ - The shared credentials and config files.
82
+
83
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
84
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
85
+ set.
86
+
87
+ - Amazon EC2 Instance profile credentials.
88
+
89
+ You have also the possibility of using Profile Credentials Provider, by
90
+ specifying the useProfileCredentialsProvider option to true and
91
+ profileCredentialsName to the profile name.
92
+
93
+ Only one of static, default and profile credentials could be used at the
94
+ same time.
95
+
96
+ For more information about this you can look at [AWS credentials
97
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
98
+
99
+ ## AmazonKinesis configuration
100
+
101
+ You then have to reference the KinesisClient in the
102
+ `amazonKinesisClient` URI option.
103
+
104
+ from("aws2-kinesis://mykinesisstream?amazonKinesisClient=#kinesisClient")
105
+ .to("log:out?showAll=true");
106
+
107
+ ## Providing AWS Credentials
108
+
109
+ It is recommended that the credentials are obtained by using the
110
+ [DefaultAWSCredentialsProviderChain](http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/DefaultAWSCredentialsProviderChain.html)
111
+ that is the default when creating a new ClientConfiguration instance,
112
+ however, a different
113
+ [AWSCredentialsProvider](http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/AWSCredentialsProvider.html)
114
+ can be specified when calling createClient(…).
115
+
116
+ ## AWS Kinesis KCL Consumer
117
+
118
+ The component supports also the KCL (Kinesis Client Library) for
119
+ consuming from a Kinesis Data Stream.
120
+
121
+ To enable this feature you’ll need to set two different parameter in
122
+ your endpoint:
123
+
124
+ from("aws2-kinesis://mykinesisstream?asyncClient=true&useDefaultCredentialsProvider=true&useKclConsumers=true")
125
+ .to("log:out?showAll=true");
126
+
127
+ This feature will make possible to automatically checkpointing the Shard
128
+ Iterations by combining the usage of KCL, DynamoDB Table and CloudWatch
129
+ alarms.
130
+
131
+ Everything will work out of the box, by simply using your AWS
132
+ Credentials.
133
+
134
+ In the beginning the consumer will require 60/70 seconds for preparing
135
+ everything, listing the shards, creating/querying the Lease table on
136
+ Dynamo DB. Keep it in mind while working with the KCL consumer.
137
+
138
+ # Dependencies
139
+
140
+ Maven users will need to add the following dependency to their pom.xml.
141
+
142
+ **pom.xml**
143
+
144
+ <dependency>
145
+ <groupId>org.apache.camel</groupId>
146
+ <artifactId>camel-aws2-kinesis</artifactId>
147
+ <version>${camel-version}</version>
148
+ </dependency>
149
+
150
+ where `${camel-version}` must be replaced by the actual version of
151
+ Camel.
152
+
153
+ ## Component Configurations
154
+
155
+
156
+ |Name|Description|Default|Type|
157
+ |---|---|---|---|
158
+ |cborEnabled|This option will set the CBOR\_ENABLED property during the execution|true|boolean|
159
+ |configuration|Component configuration||object|
160
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with uriEndpointOverride option|false|boolean|
161
+ |region|The region in which Kinesis Firehose client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
162
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
163
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
164
+ |iteratorType|Defines where in the Kinesis stream to start getting records|TRIM\_HORIZON|object|
165
+ |maxResultsPerRequest|Maximum number of records that will be fetched in each poll|1|integer|
166
+ |sequenceNumber|The sequence number to start polling from. Required if iteratorType is set to AFTER\_SEQUENCE\_NUMBER or AT\_SEQUENCE\_NUMBER||string|
167
+ |shardClosed|Define what will be the behavior in case of shard closed. Possible value are ignore, silent and fail. In case of ignore a message will be logged and the consumer will restart from the beginning,in case of silent there will be no logging and the consumer will start from the beginning,in case of fail a ReachedClosedStateException will be raised|ignore|object|
168
+ |shardId|Defines which shardId in the Kinesis stream to get records from||string|
169
+ |shardMonitorInterval|The interval in milliseconds to wait between shard polling|10000|integer|
170
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
171
+ |amazonKinesisClient|Amazon Kinesis client to use for all requests for this endpoint||object|
172
+ |asyncClient|If we want to a KinesisAsyncClient instance set it to true|false|boolean|
173
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
174
+ |cloudWatchAsyncClient|If we want to a KCL Consumer, we can pass an instance of CloudWatchAsyncClient||object|
175
+ |dynamoDbAsyncClient|If we want to a KCL Consumer, we can pass an instance of DynamoDbAsyncClient||object|
176
+ |useKclConsumers|If we want to a KCL Consumer set it to true|false|boolean|
177
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
178
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
179
+ |proxyHost|To define a proxy host when instantiating the Kinesis client||string|
180
+ |proxyPort|To define a proxy port when instantiating the Kinesis client||integer|
181
+ |proxyProtocol|To define a proxy protocol when instantiating the Kinesis client|HTTPS|object|
182
+ |accessKey|Amazon AWS Access Key||string|
183
+ |profileCredentialsName|If using a profile credentials provider this parameter will set the profile name.||string|
184
+ |secretKey|Amazon AWS Secret Key||string|
185
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume a IAM role||string|
186
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
187
+ |useDefaultCredentialsProvider|Set whether the Kinesis client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
188
+ |useProfileCredentialsProvider|Set whether the Kinesis client should expect to load credentials through a profile credentials provider.|false|boolean|
189
+ |useSessionCredentials|Set whether the Kinesis client should expect to use Session Credentials. This is useful in situation in which the user needs to assume a IAM role for doing operations in Kinesis.|false|boolean|
190
+
191
+ ## Endpoint Configurations
192
+
193
+
194
+ |Name|Description|Default|Type|
195
+ |---|---|---|---|
196
+ |streamName|Name of the stream||string|
197
+ |cborEnabled|This option will set the CBOR\_ENABLED property during the execution|true|boolean|
198
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with uriEndpointOverride option|false|boolean|
199
+ |region|The region in which Kinesis Firehose client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
200
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
201
+ |iteratorType|Defines where in the Kinesis stream to start getting records|TRIM\_HORIZON|object|
202
+ |maxResultsPerRequest|Maximum number of records that will be fetched in each poll|1|integer|
203
+ |sendEmptyMessageWhenIdle|If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead.|false|boolean|
204
+ |sequenceNumber|The sequence number to start polling from. Required if iteratorType is set to AFTER\_SEQUENCE\_NUMBER or AT\_SEQUENCE\_NUMBER||string|
205
+ |shardClosed|Define what will be the behavior in case of shard closed. Possible value are ignore, silent and fail. In case of ignore a message will be logged and the consumer will restart from the beginning,in case of silent there will be no logging and the consumer will start from the beginning,in case of fail a ReachedClosedStateException will be raised|ignore|object|
206
+ |shardId|Defines which shardId in the Kinesis stream to get records from||string|
207
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
208
+ |exceptionHandler|To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.||object|
209
+ |exchangePattern|Sets the exchange pattern when the consumer creates an exchange.||object|
210
+ |pollStrategy|A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel.||object|
211
+ |shardMonitorInterval|The interval in milliseconds to wait between shard polling|10000|integer|
212
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
213
+ |amazonKinesisClient|Amazon Kinesis client to use for all requests for this endpoint||object|
214
+ |asyncClient|If we want to a KinesisAsyncClient instance set it to true|false|boolean|
215
+ |cloudWatchAsyncClient|If we want to a KCL Consumer, we can pass an instance of CloudWatchAsyncClient||object|
216
+ |dynamoDbAsyncClient|If we want to a KCL Consumer, we can pass an instance of DynamoDbAsyncClient||object|
217
+ |useKclConsumers|If we want to a KCL Consumer set it to true|false|boolean|
218
+ |proxyHost|To define a proxy host when instantiating the Kinesis client||string|
219
+ |proxyPort|To define a proxy port when instantiating the Kinesis client||integer|
220
+ |proxyProtocol|To define a proxy protocol when instantiating the Kinesis client|HTTPS|object|
221
+ |backoffErrorThreshold|The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in.||integer|
222
+ |backoffIdleThreshold|The number of subsequent idle polls that should happen before the backoffMultipler should kick-in.||integer|
223
+ |backoffMultiplier|To let the scheduled polling consumer backoff if there has been a number of subsequent idles/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and/or backoffErrorThreshold must also be configured.||integer|
224
+ |delay|Milliseconds before the next poll.|500|integer|
225
+ |greedy|If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages.|false|boolean|
226
+ |initialDelay|Milliseconds before the first poll starts.|1000|integer|
227
+ |repeatCount|Specifies a maximum limit of number of fires. So if you set it to 1, the scheduler will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever.|0|integer|
228
+ |runLoggingLevel|The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that.|TRACE|object|
229
+ |scheduledExecutorService|Allows for configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool.||object|
230
+ |scheduler|To use a cron scheduler from either camel-spring or camel-quartz component. Use value spring or quartz for built in scheduler|none|object|
231
+ |schedulerProperties|To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler.||object|
232
+ |startScheduler|Whether the scheduler should be auto started.|true|boolean|
233
+ |timeUnit|Time unit for initialDelay and delay options.|MILLISECONDS|object|
234
+ |useFixedDelay|Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details.|true|boolean|
235
+ |accessKey|Amazon AWS Access Key||string|
236
+ |profileCredentialsName|If using a profile credentials provider this parameter will set the profile name.||string|
237
+ |secretKey|Amazon AWS Secret Key||string|
238
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume a IAM role||string|
239
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
240
+ |useDefaultCredentialsProvider|Set whether the Kinesis client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
241
+ |useProfileCredentialsProvider|Set whether the Kinesis client should expect to load credentials through a profile credentials provider.|false|boolean|
242
+ |useSessionCredentials|Set whether the Kinesis client should expect to use Session Credentials. This is useful in situation in which the user needs to assume a IAM role for doing operations in Kinesis.|false|boolean|
camel-aws2-kms.md ADDED
@@ -0,0 +1,193 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws2-kms
2
+
3
+ **Since Camel 3.1**
4
+
5
+ **Only producer is supported**
6
+
7
+ The AWS2 KMS component supports the ability to work with keys stored in
8
+ [AWS KMS](https://aws.amazon.com/kms/) instances.
9
+
10
+ Prerequisites
11
+
12
+ You must have a valid Amazon Web Services developer account, and be
13
+ signed up to use Amazon KMS. More information is available at [Amazon
14
+ KMS](https://aws.amazon.com/kms/).
15
+
16
+ # URI Format
17
+
18
+ aws2-kms://label[?options]
19
+
20
+ You can append query options to the URI in the following format:
21
+
22
+ `?options=value&option2=value&...`
23
+
24
+ Required KMS component options
25
+
26
+ You have to provide the amazonKmsClient in the Registry or your
27
+ accessKey and secretKey to access the [Amazon
28
+ KMS](https://aws.amazon.com/kms/) service.
29
+
30
+ # Usage
31
+
32
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
33
+
34
+ You have the possibility of avoiding the usage of explicit static
35
+ credentials by specifying the useDefaultCredentialsProvider option and
36
+ set it to true.
37
+
38
+ The order of evaluation for Default Credentials Provider is the
39
+ following:
40
+
41
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
42
+
43
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
44
+ `AWS_SECRET_ACCESS_KEY`.
45
+
46
+ - Web Identity Token from AWS STS.
47
+
48
+ - The shared credentials and config files.
49
+
50
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
51
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
52
+ set.
53
+
54
+ - Amazon EC2 Instance profile credentials.
55
+
56
+ You have also the possibility of using Profile Credentials Provider, by
57
+ specifying the useProfileCredentialsProvider option to true and
58
+ profileCredentialsName to the profile name.
59
+
60
+ Only one of static, default and profile credentials could be used at the
61
+ same time.
62
+
63
+ For more information about this you can look at [AWS credentials
64
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
65
+
66
+ ## KMS Producer operations
67
+
68
+ Camel-AWS KMS component provides the following operation on the producer
69
+ side:
70
+
71
+ - listKeys
72
+
73
+ - createKey
74
+
75
+ - disableKey
76
+
77
+ - scheduleKeyDeletion
78
+
79
+ - describeKey
80
+
81
+ - enableKey
82
+
83
+ # Producer Examples
84
+
85
+ - listKeys: this operation will list the available keys in KMS
86
+
87
+ <!-- -->
88
+
89
+ from("direct:listKeys")
90
+ .to("aws2-kms://test?kmsClient=#amazonKmsClient&operation=listKeys")
91
+
92
+ - createKey: this operation will create a key in KMS
93
+
94
+ <!-- -->
95
+
96
+ from("direct:createKey")
97
+ .to("aws2-kms://test?kmsClient=#amazonKmsClient&operation=createKey")
98
+
99
+ - disableKey: this operation will disable a key in KMS
100
+
101
+ <!-- -->
102
+
103
+ from("direct:disableKey")
104
+ .setHeader(KMS2Constants.KEY_ID, constant("123")
105
+ .to("aws2-kms://test?kmsClient=#amazonKmsClient&operation=disableKey")
106
+
107
+ - enableKey: this operation will enable a key in KMS
108
+
109
+ <!-- -->
110
+
111
+ from("direct:enableKey")
112
+ .setHeader(KMS2Constants.KEY_ID, constant("123")
113
+ .to("aws2-kms://test?kmsClient=#amazonKmsClient&operation=enableKey")
114
+
115
+ # Using a POJO as body
116
+
117
+ Sometimes building an AWS Request can be complex because of multiple
118
+ options. We introduce the possibility to use a POJO as the body. In AWS
119
+ KMS there are multiple operations you can submit, as an example for List
120
+ keys request, you can do something like:
121
+
122
+ from("direct:createUser")
123
+ .setBody(ListKeysRequest.builder().limit(10).build())
124
+ .to("aws2-kms://test?kmsClient=#amazonKmsClient&operation=listKeys&pojoRequest=true")
125
+
126
+ In this way, you’ll pass the request directly without the need of
127
+ passing headers and options specifically related to this operation.
128
+
129
+ # Dependencies
130
+
131
+ Maven users will need to add the following dependency to their pom.xml.
132
+
133
+ **pom.xml**
134
+
135
+ <dependency>
136
+ <groupId>org.apache.camel</groupId>
137
+ <artifactId>camel-aws2-kms</artifactId>
138
+ <version>${camel-version}</version>
139
+ </dependency>
140
+
141
+ where `${camel-version}` must be replaced by the actual version of
142
+ Camel.
143
+
144
+ ## Component Configurations
145
+
146
+
147
+ |Name|Description|Default|Type|
148
+ |---|---|---|---|
149
+ |configuration|Component configuration||object|
150
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
151
+ |operation|The operation to perform||object|
152
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
153
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
154
+ |region|The region in which EKS client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
155
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
156
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
157
+ |kmsClient|To use an existing configured AWS KMS client||object|
158
+ |proxyHost|To define a proxy host when instantiating the KMS client||string|
159
+ |proxyPort|To define a proxy port when instantiating the KMS client||integer|
160
+ |proxyProtocol|To define a proxy protocol when instantiating the KMS client|HTTPS|object|
161
+ |accessKey|Amazon AWS Access Key||string|
162
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
163
+ |secretKey|Amazon AWS Secret Key||string|
164
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
165
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
166
+ |useDefaultCredentialsProvider|Set whether the KMS client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
167
+ |useProfileCredentialsProvider|Set whether the KMS client should expect to load credentials through a profile credentials provider.|false|boolean|
168
+ |useSessionCredentials|Set whether the KMS client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume a IAM role for doing operations in KMS.|false|boolean|
169
+
170
+ ## Endpoint Configurations
171
+
172
+
173
+ |Name|Description|Default|Type|
174
+ |---|---|---|---|
175
+ |label|Logical name||string|
176
+ |operation|The operation to perform||object|
177
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
178
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
179
+ |region|The region in which EKS client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
180
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
181
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
182
+ |kmsClient|To use an existing configured AWS KMS client||object|
183
+ |proxyHost|To define a proxy host when instantiating the KMS client||string|
184
+ |proxyPort|To define a proxy port when instantiating the KMS client||integer|
185
+ |proxyProtocol|To define a proxy protocol when instantiating the KMS client|HTTPS|object|
186
+ |accessKey|Amazon AWS Access Key||string|
187
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
188
+ |secretKey|Amazon AWS Secret Key||string|
189
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
190
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
191
+ |useDefaultCredentialsProvider|Set whether the KMS client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
192
+ |useProfileCredentialsProvider|Set whether the KMS client should expect to load credentials through a profile credentials provider.|false|boolean|
193
+ |useSessionCredentials|Set whether the KMS client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume a IAM role for doing operations in KMS.|false|boolean|
camel-aws2-lambda.md ADDED
@@ -0,0 +1,225 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws2-lambda
2
+
3
+ **Since Camel 3.2**
4
+
5
+ **Only producer is supported**
6
+
7
+ The AWS2 Lambda component supports create, get, list, delete, and invoke
8
+ [AWS Lambda](https://aws.amazon.com/lambda/) functions.
9
+
10
+ **Prerequisites**
11
+
12
+ You must have a valid Amazon Web Services developer account, and be
13
+ signed up to use Amazon Lambda. More information is available at [AWS
14
+ Lambda](https://aws.amazon.com/lambda/).
15
+
16
+ When creating a Lambda function, you need to specify an IAM role which
17
+ has at least the AWSLambdaBasicExecuteRole policy attached.
18
+
19
+ # URI Format
20
+
21
+ aws2-lambda://functionName[?options]
22
+
23
+ You can append query options to the URI in the following format:
24
+
25
+ `?options=value&option2=value&...`
26
+
27
+ Required Lambda component options
28
+
29
+ You have to provide the awsLambdaClient in the Registry or your
30
+ accessKey and secretKey to access the [Amazon
31
+ Lambda](https://aws.amazon.com/lambda/) service.
32
+
33
+ # Usage
34
+
35
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
36
+
37
+ You have the possibility of avoiding the usage of explicit static
38
+ credentials by specifying the useDefaultCredentialsProvider option and
39
+ set it to true.
40
+
41
+ The order of evaluation for Default Credentials Provider is the
42
+ following:
43
+
44
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
45
+
46
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
47
+ `AWS_SECRET_ACCESS_KEY`.
48
+
49
+ - Web Identity Token from AWS STS.
50
+
51
+ - The shared credentials and config files.
52
+
53
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
54
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
55
+ set.
56
+
57
+ - Amazon EC2 Instance profile credentials.
58
+
59
+ You have also the possibility of using Profile Credentials Provider, by
60
+ specifying the useProfileCredentialsProvider option to true and
61
+ profileCredentialsName to the profile name.
62
+
63
+ Only one of static, default and profile credentials could be used at the
64
+ same time.
65
+
66
+ For more information about this you can look at [AWS credentials
67
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
68
+
69
+ # List of Available Operations
70
+
71
+ - listFunctions
72
+
73
+ - getFunction
74
+
75
+ - createFunction
76
+
77
+ - deleteFunction
78
+
79
+ - invokeFunction
80
+
81
+ - updateFunction
82
+
83
+ - createEventSourceMapping
84
+
85
+ - deleteEventSourceMapping
86
+
87
+ - listEventSourceMapping
88
+
89
+ - listTags
90
+
91
+ - tagResource
92
+
93
+ - untagResource
94
+
95
+ - publishVersion
96
+
97
+ - listVersions
98
+
99
+ - createAlias
100
+
101
+ - deleteAlias
102
+
103
+ - getAlias
104
+
105
+ - listAliases
106
+
107
+ # Examples
108
+
109
+ ## Producer Example
110
+
111
+ To have a full understanding of how the component works, you may have a
112
+ look at these [integration
113
+ tests](https://github.com/apache/camel/tree/main/components/camel-aws/camel-aws2-lambda/src/test/java/org/apache/camel/component/aws2/lambda/integration)
114
+
115
+ ## Producer Examples
116
+
117
+ - CreateFunction: this operation will create a function for you in AWS
118
+ Lambda
119
+
120
+ <!-- -->
121
+
122
+ from("direct:createFunction").to("aws2-lambda://GetHelloWithName?operation=createFunction").to("mock:result");
123
+
124
+ and by sending
125
+
126
+ template.send("direct:createFunction", ExchangePattern.InOut, new Processor() {
127
+ @Override
128
+ public void process(Exchange exchange) throws Exception {
129
+ exchange.getIn().setHeader(Lambda2Constants.RUNTIME, "nodejs6.10");
130
+ exchange.getIn().setHeader(Lambda2Constants.HANDLER, "GetHelloWithName.handler");
131
+ exchange.getIn().setHeader(Lambda2Constants.DESCRIPTION, "Hello with node.js on Lambda");
132
+ exchange.getIn().setHeader(Lambda2Constants.ROLE,
133
+ "arn:aws:iam::643534317684:role/lambda-execution-role");
134
+
135
+ ClassLoader classLoader = getClass().getClassLoader();
136
+ File file = new File(
137
+ classLoader
138
+ .getResource("org/apache/camel/component/aws2/lambda/function/node/GetHelloWithName.zip")
139
+ .getFile());
140
+ FileInputStream inputStream = new FileInputStream(file);
141
+ exchange.getIn().setBody(inputStream);
142
+ }
143
+ });
144
+
145
+ # Using a POJO as body
146
+
147
+ Sometimes building an AWS Request can be complex because of multiple
148
+ options. We introduce the possibility to use a POJO as the body. In AWS
149
+ Lambda there are multiple operations you can submit, as an example for
150
+ Get Function request, you can do something like:
151
+
152
+ from("direct:getFunction")
153
+ .setBody(GetFunctionRequest.builder().functionName("test").build())
154
+ .to("aws2-lambda://GetHelloWithName?awsLambdaClient=#awsLambdaClient&operation=getFunction&pojoRequest=true")
155
+
156
+ In this way, you’ll pass the request directly without the need of
157
+ passing headers and options specifically related to this operation.
158
+
159
+ # Dependencies
160
+
161
+ Maven users will need to add the following dependency to their pom.xml.
162
+
163
+ **pom.xml**
164
+
165
+ <dependency>
166
+ <groupId>org.apache.camel</groupId>
167
+ <artifactId>camel-aws2-lambda</artifactId>
168
+ <version>${camel-version}</version>
169
+ </dependency>
170
+
171
+ where `${camel-version}` must be replaced by the actual version of
172
+ Camel.
173
+
174
+ ## Component Configurations
175
+
176
+
177
+ |Name|Description|Default|Type|
178
+ |---|---|---|---|
179
+ |configuration|Component configuration||object|
180
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
181
+ |operation|The operation to perform. It can be listFunctions, getFunction, createFunction, deleteFunction or invokeFunction|invokeFunction|object|
182
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
183
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
184
+ |region|The region in which the Lambda client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
185
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
186
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
187
+ |awsLambdaClient|To use an existing configured AwsLambdaClient client||object|
188
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
189
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
190
+ |proxyHost|To define a proxy host when instantiating the Lambda client||string|
191
+ |proxyPort|To define a proxy port when instantiating the Lambda client||integer|
192
+ |proxyProtocol|To define a proxy protocol when instantiating the Lambda client|HTTPS|object|
193
+ |accessKey|Amazon AWS Access Key||string|
194
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
195
+ |secretKey|Amazon AWS Secret Key||string|
196
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
197
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
198
+ |useDefaultCredentialsProvider|Set whether the Lambda client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
199
+ |useProfileCredentialsProvider|Set whether the Lambda client should expect to load credentials through a profile credentials provider.|false|boolean|
200
+ |useSessionCredentials|Set whether the Lambda client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in Lambda.|false|boolean|
201
+
202
+ ## Endpoint Configurations
203
+
204
+
205
+ |Name|Description|Default|Type|
206
+ |---|---|---|---|
207
+ |function|Name of the Lambda function.||string|
208
+ |operation|The operation to perform. It can be listFunctions, getFunction, createFunction, deleteFunction or invokeFunction|invokeFunction|object|
209
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
210
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
211
+ |region|The region in which the Lambda client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
212
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
213
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
214
+ |awsLambdaClient|To use an existing configured AwsLambdaClient client||object|
215
+ |proxyHost|To define a proxy host when instantiating the Lambda client||string|
216
+ |proxyPort|To define a proxy port when instantiating the Lambda client||integer|
217
+ |proxyProtocol|To define a proxy protocol when instantiating the Lambda client|HTTPS|object|
218
+ |accessKey|Amazon AWS Access Key||string|
219
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
220
+ |secretKey|Amazon AWS Secret Key||string|
221
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
222
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
223
+ |useDefaultCredentialsProvider|Set whether the Lambda client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
224
+ |useProfileCredentialsProvider|Set whether the Lambda client should expect to load credentials through a profile credentials provider.|false|boolean|
225
+ |useSessionCredentials|Set whether the Lambda client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in Lambda.|false|boolean|
camel-aws2-mq.md ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws2-mq
2
+
3
+ **Since Camel 3.1**
4
+
5
+ **Only producer is supported**
6
+
7
+ The AWS2 MQ component supports create, run, start, stop and terminate
8
+ [AWS MQ](https://aws.amazon.com/amazon-mq/) instances.
9
+
10
+ Prerequisites
11
+
12
+ You must have a valid Amazon Web Services developer account, and be
13
+ signed up to use Amazon MQ. More information is available at [Amazon
14
+ MQ](https://aws.amazon.com/amazon-mq/).
15
+
16
+ # URI Format
17
+
18
+ aws2-mq://label[?options]
19
+
20
+ You can append query options to the URI in the following format:
21
+
22
+ `?options=value&option2=value&...`
23
+
24
+ Required MQ component options
25
+
26
+ You have to provide the amazonMqClient in the Registry or your accessKey
27
+ and secretKey to access the [Amazon
28
+ MQ](https://aws.amazon.com/amazon-mq/) service.
29
+
30
+ # Usage
31
+
32
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
33
+
34
+ You have the possibility of avoiding the usage of explicit static
35
+ credentials by specifying the useDefaultCredentialsProvider option and
36
+ set it to true.
37
+
38
+ The order of evaluation for Default Credentials Provider is the
39
+ following:
40
+
41
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
42
+
43
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
44
+ `AWS_SECRET_ACCESS_KEY`.
45
+
46
+ - Web Identity Token from AWS STS.
47
+
48
+ - The shared credentials and config files.
49
+
50
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
51
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
52
+ set.
53
+
54
+ - Amazon EC2 Instance profile credentials.
55
+
56
+ You have also the possibility of using Profile Credentials Provider, by
57
+ specifying the useProfileCredentialsProvider option to true and
58
+ profileCredentialsName to the profile name.
59
+
60
+ Only one of static, default and profile credentials could be used at the
61
+ same time.
62
+
63
+ For more information about this you can look at [AWS credentials
64
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
65
+
66
+ ## MQ Producer operations
67
+
68
+ Camel-AWS MQ component provides the following operation on the producer
69
+ side:
70
+
71
+ - listBrokers
72
+
73
+ - createBroker
74
+
75
+ - deleteBroker
76
+
77
+ - rebootBroker
78
+
79
+ - updateBroker
80
+
81
+ - describeBroker
82
+
83
+ # Examples
84
+
85
+ ## Producer Examples
86
+
87
+ - listBrokers: this operation will list the available MQ Brokers in
88
+ AWS
89
+
90
+ <!-- -->
91
+
92
+ from("direct:listBrokers")
93
+ .to("aws2-mq://test?amazonMqClient=#amazonMqClient&operation=listBrokers")
94
+
95
+ - createBroker: this operation will create an MQ Broker in AWS
96
+
97
+ <!-- -->
98
+
99
+ from("direct:createBroker")
100
+ .process(new Processor() {
101
+ @Override
102
+ public void process(Exchange exchange) throws Exception {
103
+ exchange.getIn().setHeader(MQ2Constants.BROKER_NAME, "test");
104
+ exchange.getIn().setHeader(MQ2Constants.BROKER_DEPLOYMENT_MODE, DeploymentMode.SINGLE_INSTANCE);
105
+ exchange.getIn().setHeader(MQ2Constants.BROKER_INSTANCE_TYPE, "mq.t2.micro");
106
+ exchange.getIn().setHeader(MQ2Constants.BROKER_ENGINE, EngineType.ACTIVEMQ.name());
107
+ exchange.getIn().setHeader(MQ2Constants.BROKER_ENGINE_VERSION, "5.15.6");
108
+ exchange.getIn().setHeader(MQ2Constants.BROKER_PUBLICLY_ACCESSIBLE, false);
109
+ List<User> users = new ArrayList<>();
110
+ User.Builder user = User.builder();
111
+ user.username("camel");
112
+ user.password("camelpwd");
113
+ users.add(user.build());
114
+ exchange.getIn().setHeader(MQ2Constants.BROKER_USERS, users);
115
+
116
+ }
117
+ })
118
+ .to("aws2-mq://test?amazonMqClient=#amazonMqClient&operation=createBroker")
119
+
120
+ - deleteBroker: this operation will delete an MQ Broker in AWS
121
+
122
+ <!-- -->
123
+
124
+ from("direct:listBrokers")
125
+ .setHeader(MQ2Constants.BROKER_ID, constant("123")
126
+ .to("aws2-mq://test?amazonMqClient=#amazonMqClient&operation=deleteBroker")
127
+
128
+ - rebootBroker: this operation will delete an MQ Broker in AWS
129
+
130
+ <!-- -->
131
+
132
+ from("direct:listBrokers")
133
+ .setHeader(MQ2Constants.BROKER_ID, constant("123")
134
+ .to("aws2-mq://test?amazonMqClient=#amazonMqClient&operation=rebootBroker")
135
+
136
+ # Using a POJO as body
137
+
138
+ Sometimes building an AWS Request can be complex because of multiple
139
+ options. We introduce the possibility to use a POJO as the body. In AWS
140
+ MQ, there are multiple operations you can submit, as an example for List
141
+ brokers request, you can do something like:
142
+
143
+ from("direct:aws2-mq")
144
+ .setBody(ListBrokersRequest.builder().maxResults(10).build())
145
+ .to("aws2-mq://test?amazonMqClient=#amazonMqClient&operation=listBrokers&pojoRequest=true")
146
+
147
+ In this way, you’ll pass the request directly without the need of
148
+ passing headers and options specifically related to this operation.
149
+
150
+ # Dependencies
151
+
152
+ Maven users will need to add the following dependency to their pom.xml.
153
+
154
+ **pom.xml**
155
+
156
+ <dependency>
157
+ <groupId>org.apache.camel</groupId>
158
+ <artifactId>camel-aws2-mq</artifactId>
159
+ <version>${camel-version}</version>
160
+ </dependency>
161
+
162
+ where `${camel-version}` must be replaced by the actual version of
163
+ Camel.
164
+
165
+ ## Component Configurations
166
+
167
+
168
+ |Name|Description|Default|Type|
169
+ |---|---|---|---|
170
+ |configuration|Component configuration||object|
171
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
172
+ |operation|The operation to perform. It can be listBrokers, createBroker, deleteBroker||object|
173
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
174
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
175
+ |region|The region in which MQ client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
176
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
177
+ |amazonMqClient|To use a existing configured AmazonMQClient client||object|
178
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
179
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
180
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
181
+ |proxyHost|To define a proxy host when instantiating the MQ client||string|
182
+ |proxyPort|To define a proxy port when instantiating the MQ client||integer|
183
+ |proxyProtocol|To define a proxy protocol when instantiating the MQ client|HTTPS|object|
184
+ |accessKey|Amazon AWS Access Key||string|
185
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
186
+ |secretKey|Amazon AWS Secret Key||string|
187
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
188
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
189
+ |useDefaultCredentialsProvider|Set whether the MQ client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
190
+ |useProfileCredentialsProvider|Set whether the MQ client should expect to load credentials through a profile credentials provider.|false|boolean|
191
+ |useSessionCredentials|Set whether the MQ client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in MQ.|false|boolean|
192
+
193
+ ## Endpoint Configurations
194
+
195
+
196
+ |Name|Description|Default|Type|
197
+ |---|---|---|---|
198
+ |label|Logical name||string|
199
+ |operation|The operation to perform. It can be listBrokers, createBroker, deleteBroker||object|
200
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
201
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
202
+ |region|The region in which MQ client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
203
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
204
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
205
+ |amazonMqClient|To use a existing configured AmazonMQClient client||object|
206
+ |proxyHost|To define a proxy host when instantiating the MQ client||string|
207
+ |proxyPort|To define a proxy port when instantiating the MQ client||integer|
208
+ |proxyProtocol|To define a proxy protocol when instantiating the MQ client|HTTPS|object|
209
+ |accessKey|Amazon AWS Access Key||string|
210
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
211
+ |secretKey|Amazon AWS Secret Key||string|
212
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
213
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
214
+ |useDefaultCredentialsProvider|Set whether the MQ client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
215
+ |useProfileCredentialsProvider|Set whether the MQ client should expect to load credentials through a profile credentials provider.|false|boolean|
216
+ |useSessionCredentials|Set whether the MQ client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in MQ.|false|boolean|
camel-aws2-msk.md ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws2-msk
2
+
3
+ **Since Camel 3.1**
4
+
5
+ **Only producer is supported**
6
+
7
+ The AWS2 MSK component supports create, run, start, stop and terminate
8
+ [AWS MSK](https://aws.amazon.com/msk/) instances.
9
+
10
+ Prerequisites
11
+
12
+ You must have a valid Amazon Web Services developer account, and be
13
+ signed up to use Amazon MSK. More information is available at [Amazon
14
+ MSK](https://aws.amazon.com/msk/).
15
+
16
+ # URI Format
17
+
18
+ aws2-msk://label[?options]
19
+
20
+ You can append query options to the URI in the following format:
21
+
22
+ `?options=value&option2=value&...`
23
+
24
+ Required MSK component options
25
+
26
+ You have to provide the amazonMskClient in the Registry or your
27
+ accessKey and secretKey to access the [Amazon
28
+ MSK](https://aws.amazon.com/msk/) service.
29
+
30
+ # Usage
31
+
32
+ ## Static credentials vs Default Credential Provider
33
+
34
+ You have the possibility of avoiding the usage of explicit static
35
+ credentials by specifying the useDefaultCredentialsProvider option and
36
+ set it to true.
37
+
38
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
39
+
40
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
41
+ `AWS_SECRET_ACCESS_KEY`.
42
+
43
+ - Web Identity Token from AWS STS.
44
+
45
+ - The shared credentials and config files.
46
+
47
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
48
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
49
+ set.
50
+
51
+ - Amazon EC2 Instance profile credentials.
52
+
53
+ For more information about this you can look at [AWS credentials
54
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
55
+
56
+ ## MSK Producer operations
57
+
58
+ Camel-AWS MSK component provides the following operation on the producer
59
+ side:
60
+
61
+ - listClusters
62
+
63
+ - createCluster
64
+
65
+ - deleteCluster
66
+
67
+ - describeCluster
68
+
69
+ # Examples
70
+
71
+ ## Producer Examples
72
+
73
+ - listClusters: this operation will list the available MSK Brokers in
74
+ AWS
75
+
76
+ <!-- -->
77
+
78
+ from("direct:listClusters")
79
+ .to("aws2-msk://test?mskClient=#amazonMskClient&operation=listClusters")
80
+
81
+ - createCluster: this operation will create an MSK Cluster in AWS
82
+
83
+ <!-- -->
84
+
85
+ from("direct:createCluster")
86
+ .process(new Processor() {
87
+ @Override
88
+ public void process(Exchange exchange) throws Exception {
89
+ exchange.getIn().setHeader(MSK2Constants.CLUSTER_NAME, "test-kafka");
90
+ exchange.getIn().setHeader(MSK2Constants.CLUSTER_KAFKA_VERSION, "2.1.1");
91
+ exchange.getIn().setHeader(MSK2Constants.BROKER_NODES_NUMBER, 2);
92
+ BrokerNodeGroupInfo groupInfo = BrokerNodeGroupInfo.builder().build();
93
+ exchange.getIn().setHeader(MSK2Constants.BROKER_NODES_GROUP_INFO, groupInfo);
94
+ }
95
+ })
96
+ .to("aws2-msk://test?mskClient=#amazonMskClient&operation=createCluster")
97
+
98
+ - deleteCluster: this operation will delete an MSK Cluster in AWS
99
+
100
+ <!-- -->
101
+
102
+ from("direct:deleteCluster")
103
+ .setHeader(MSK2Constants.CLUSTER_ARN, constant("test-kafka"));
104
+ .to("aws2-msk://test?mskClient=#amazonMskClient&operation=deleteCluster")
105
+
106
+ from("direct:createCluster")
107
+ .process(new Processor() {
108
+ @Override
109
+ public void process(Exchange exchange) throws Exception {
110
+ exchange.getIn().setHeader(MSK2Constants.CLUSTER_NAME, "test-kafka");
111
+ exchange.getIn().setHeader(MSK2Constants.CLUSTER_KAFKA_VERSION, "2.1.1");
112
+ exchange.getIn().setHeader(MSK2Constants.BROKER_NODES_NUMBER, 2);
113
+ BrokerNodeGroupInfo groupInfo = BrokerNodeGroupInfo.builder().build();
114
+ exchange.getIn().setHeader(MSK2Constants.BROKER_NODES_GROUP_INFO, groupInfo);
115
+ }
116
+ })
117
+ .to("aws2-msk://test?mskClient=#amazonMskClient&operation=deleteCluster")
118
+
119
+ # Using a POJO as body
120
+
121
+ Sometimes building an AWS Request can be complex because of multiple
122
+ options. We introduce the possibility to use a POJO as the body. In AWS
123
+ MSK, there are multiple operations you can submit, as an example for
124
+ List clusters request, you can do something like:
125
+
126
+ from("direct:aws2-msk")
127
+ .setBody(ListClustersRequest.builder().maxResults(10).build())
128
+ .to("aws2-msk://test?mskClient=#amazonMskClient&operation=listClusters&pojoRequest=true")
129
+
130
+ In this way, you’ll pass the request directly without the need of
131
+ passing headers and options specifically related to this operation.
132
+
133
+ # Dependencies
134
+
135
+ Maven users will need to add the following dependency to their pom.xml.
136
+
137
+ **pom.xml**
138
+
139
+ <dependency>
140
+ <groupId>org.apache.camel</groupId>
141
+ <artifactId>camel-aws2-msk</artifactId>
142
+ <version>${camel-version}</version>
143
+ </dependency>
144
+
145
+ where `${camel-version}` must be replaced by the actual version of
146
+ Camel.
147
+
148
+ ## Component Configurations
149
+
150
+
151
+ |Name|Description|Default|Type|
152
+ |---|---|---|---|
153
+ |configuration|Component configuration||object|
154
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
155
+ |operation|The operation to perform||object|
156
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
157
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
158
+ |region|The region in which the MSK client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
159
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
160
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
161
+ |mskClient|To use an existing configured AWS MSK client||object|
162
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
163
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
164
+ |proxyHost|To define a proxy host when instantiating the MSK client||string|
165
+ |proxyPort|To define a proxy port when instantiating the MSK client||integer|
166
+ |proxyProtocol|To define a proxy protocol when instantiating the MSK client|HTTPS|object|
167
+ |accessKey|Amazon AWS Access Key||string|
168
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
169
+ |secretKey|Amazon AWS Secret Key||string|
170
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
171
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
172
+ |useDefaultCredentialsProvider|Set whether the Kafka client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
173
+ |useProfileCredentialsProvider|Set whether the MSK client should expect to load credentials through a profile credentials provider.|false|boolean|
174
+ |useSessionCredentials|Set whether the MSK client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in MSK.|false|boolean|
175
+
176
+ ## Endpoint Configurations
177
+
178
+
179
+ |Name|Description|Default|Type|
180
+ |---|---|---|---|
181
+ |label|Logical name||string|
182
+ |operation|The operation to perform||object|
183
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
184
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
185
+ |region|The region in which the MSK client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
186
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
187
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
188
+ |mskClient|To use an existing configured AWS MSK client||object|
189
+ |proxyHost|To define a proxy host when instantiating the MSK client||string|
190
+ |proxyPort|To define a proxy port when instantiating the MSK client||integer|
191
+ |proxyProtocol|To define a proxy protocol when instantiating the MSK client|HTTPS|object|
192
+ |accessKey|Amazon AWS Access Key||string|
193
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
194
+ |secretKey|Amazon AWS Secret Key||string|
195
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
196
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
197
+ |useDefaultCredentialsProvider|Set whether the Kafka client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
198
+ |useProfileCredentialsProvider|Set whether the MSK client should expect to load credentials through a profile credentials provider.|false|boolean|
199
+ |useSessionCredentials|Set whether the MSK client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in MSK.|false|boolean|
camel-aws2-redshift-data.md ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws2-redshift-data
2
+
3
+ **Since Camel 4.1**
4
+
5
+ **Only producer is supported**
6
+
7
+ The AWS2 Redshift Data component supports the following operations on
8
+ [AWS Redshift](https://aws.amazon.com/redshift/):
9
+
10
+ - listDatabases, listSchemas, listStatements, listTables,
11
+ describeTable, executeStatement, batchExecuteStatement,
12
+ cancelStatement, describeStatement, getStatementResult
13
+
14
+ Prerequisites
15
+
16
+ You must have a valid Amazon Web Services developer account, and be
17
+ signed up to use Amazon Redshift. More information is available at [AWS
18
+ Redshift](https://aws.amazon.com/redshift/).
19
+
20
+ # URI Format
21
+
22
+ aws2-redshift-data://label[?options]
23
+
24
+ You can append query options to the URI in the following format:
25
+
26
+ `?options=value&option2=value&...`
27
+
28
+ Required Redshift Data component options
29
+
30
+ You have to provide the awsRedshiftDataClient in the Registry or your
31
+ accessKey and secretKey to access the [AWS
32
+ Redshift](https://aws.amazon.com/redshift/) service.
33
+
34
+ # Usage
35
+
36
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
37
+
38
+ You have the possibility of avoiding the usage of explicit static
39
+ credentials by specifying the useDefaultCredentialsProvider option and
40
+ set it to true.
41
+
42
+ The order of evaluation for Default Credentials Provider is the
43
+ following:
44
+
45
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`
46
+
47
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
48
+ `AWS_SECRET_ACCESS_KEY`.
49
+
50
+ - Web Identity Token from AWS STS.
51
+
52
+ - The shared credentials and config files.
53
+
54
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
55
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
56
+ set.
57
+
58
+ - Amazon EC2 Instance profile credentials.
59
+
60
+ You have also the possibility of using Profile Credentials Provider, by
61
+ specifying the useProfileCredentialsProvider option to true and
62
+ profileCredentialsName to the profile name.
63
+
64
+ Only one of static, default and profile credentials could be used at the
65
+ same time.
66
+
67
+ For more information about this you can look at [AWS credentials
68
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
69
+
70
+ ## Redshift Producer operations
71
+
72
+ Camel-AWS Redshift Data component provides the following operation on
73
+ the producer side:
74
+
75
+ - listDatabases
76
+
77
+ - listSchemas
78
+
79
+ - listStatements
80
+
81
+ - listTables
82
+
83
+ - describeTable
84
+
85
+ - executeStatement
86
+
87
+ - batchExecuteStatement
88
+
89
+ - cancelStatement
90
+
91
+ - describeStatement
92
+
93
+ - getStatementResult
94
+
95
+ # Producer Examples
96
+
97
+ - listDatabases: this operation will list redshift databases
98
+
99
+ <!-- -->
100
+
101
+ from("direct:listDatabases")
102
+ .to("aws2-redshift-data://test?awsRedshiftDataClient=#awsRedshiftDataClient&operation=listDatabases")
103
+
104
+ # Using a POJO as body
105
+
106
+ Sometimes building an AWS Request can be complex because of multiple
107
+ options. We introduce the possibility to use a POJO as body. In AWS
108
+ Redshift Data there are multiple operations you can submit, as an
109
+ example for List Databases request, you can do something like:
110
+
111
+ from("direct:start")
112
+ .setBody(ListDatabases.builder().database("database1").build())
113
+ .to("aws2-redshift-data://test?awsRedshiftDataClient=#awsRedshiftDataClient&operation=listDatabases&pojoRequest=true")
114
+
115
+ In this way you’ll pass the request directly without the need of passing
116
+ headers and options specifically related to this operation.
117
+
118
+ # Dependencies
119
+
120
+ Maven users will need to add the following dependency to their pom.xml.
121
+
122
+ **pom.xml**
123
+
124
+ <dependency>
125
+ <groupId>org.apache.camel</groupId>
126
+ <artifactId>camel-redshift-data</artifactId>
127
+ <version>${camel-version}</version>
128
+ </dependency>
129
+
130
+ where `${camel-version}` must be replaced by the actual version of
131
+ Camel.
132
+
133
+ ## Component Configurations
134
+
135
+
136
+ |Name|Description|Default|Type|
137
+ |---|---|---|---|
138
+ |configuration|Component configuration||object|
139
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
140
+ |operation|The operation to perform. It can be batchExecuteStatement, cancelStatement, describeStatement, describeTable, executeStatement, getStatementResult, listDatabases, listSchemas, listStatements or listTables||object|
141
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
142
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
143
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
144
+ |region|The region in which RedshiftData client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
145
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
146
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
147
+ |useDefaultCredentialsProvider|Set whether the RedshiftData client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
148
+ |useProfileCredentialsProvider|Set whether the RedshiftData client should expect to load credentials through a profile credentials provider.|false|boolean|
149
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
150
+ |awsRedshiftDataClient|To use an existing configured AwsRedshiftDataClient client||object|
151
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
152
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
153
+ |proxyHost|To define a proxy host when instantiating the RedshiftData client||string|
154
+ |proxyPort|To define a proxy port when instantiating the RedshiftData client||integer|
155
+ |proxyProtocol|To define a proxy protocol when instantiating the RedshiftData client|HTTPS|object|
156
+ |accessKey|Amazon AWS Access Key||string|
157
+ |secretKey|Amazon AWS Secret Key||string|
158
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
159
+ |useSessionCredentials|Set whether the Redshift client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in Redshift.|false|boolean|
160
+
161
+ ## Endpoint Configurations
162
+
163
+
164
+ |Name|Description|Default|Type|
165
+ |---|---|---|---|
166
+ |label|Logical name||string|
167
+ |operation|The operation to perform. It can be batchExecuteStatement, cancelStatement, describeStatement, describeTable, executeStatement, getStatementResult, listDatabases, listSchemas, listStatements or listTables||object|
168
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
169
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
170
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
171
+ |region|The region in which RedshiftData client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
172
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
173
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
174
+ |useDefaultCredentialsProvider|Set whether the RedshiftData client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
175
+ |useProfileCredentialsProvider|Set whether the RedshiftData client should expect to load credentials through a profile credentials provider.|false|boolean|
176
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
177
+ |awsRedshiftDataClient|To use an existing configured AwsRedshiftDataClient client||object|
178
+ |proxyHost|To define a proxy host when instantiating the RedshiftData client||string|
179
+ |proxyPort|To define a proxy port when instantiating the RedshiftData client||integer|
180
+ |proxyProtocol|To define a proxy protocol when instantiating the RedshiftData client|HTTPS|object|
181
+ |accessKey|Amazon AWS Access Key||string|
182
+ |secretKey|Amazon AWS Secret Key||string|
183
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
184
+ |useSessionCredentials|Set whether the Redshift client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in Redshift.|false|boolean|
camel-aws2-s3.md ADDED
@@ -0,0 +1,644 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws2-s3
2
+
3
+ **Since Camel 3.2**
4
+
5
+ **Both producer and consumer are supported**
6
+
7
+ The AWS2 S3 component supports storing and retrieving objects from/to
8
+ [Amazon’s S3](https://aws.amazon.com/s3) service.
9
+
10
+ Prerequisites
11
+
12
+ You must have a valid Amazon Web Services developer account, and be
13
+ signed up to use Amazon S3. More information is available at [Amazon
14
+ S3](https://aws.amazon.com/s3).
15
+
16
+ # URI Format
17
+
18
+ aws2-s3://bucketNameOrArn[?options]
19
+
20
+ The bucket will be created if it doesn’t already exist.
21
+
22
+ You can append query options to the URI in the following format:
23
+
24
+ `?options=value&option2=value&...`
25
+
26
+ Required S3 component options
27
+
28
+ You have to provide the amazonS3Client in the Registry or your accessKey
29
+ and secretKey to access the [Amazon’s S3](https://aws.amazon.com/s3).
30
+
31
+ # Batch Consumer
32
+
33
+ This component implements the Batch Consumer.
34
+
35
+ This allows you, for instance, to know how many messages exist in this
36
+ batch and for instance, let the Aggregator aggregate this number of
37
+ messages.
38
+
39
+ # Usage
40
+
41
+ For example, to read file `hello.txt` from bucket `helloBucket`, use the
42
+ following snippet:
43
+
44
+ from("aws2-s3://helloBucket?accessKey=yourAccessKey&secretKey=yourSecretKey&prefix=hello.txt")
45
+ .to("file:/var/downloaded");
46
+
47
+ ## S3 Producer operations
48
+
49
+ Camel-AWS2-S3 component provides the following operation on the producer
50
+ side:
51
+
52
+ - copyObject
53
+
54
+ - deleteObject
55
+
56
+ - listBuckets
57
+
58
+ - deleteBucket
59
+
60
+ - listObjects
61
+
62
+ - getObject (this will return an S3Object instance)
63
+
64
+ - getObjectRange (this will return an S3Object instance)
65
+
66
+ - createDownloadLink
67
+
68
+ If you don’t specify an operation, explicitly the producer will do:
69
+
70
+ - a single file upload
71
+
72
+ - a multipart upload if multiPartUpload option is enabled
73
+
74
+ ## Advanced AmazonS3 configuration
75
+
76
+ If your Camel Application is running behind a firewall or if you need to
77
+ have more control over the `S3Client` instance configuration, you can
78
+ create your own instance and refer to it in your Camel aws2-s3 component
79
+ configuration:
80
+
81
+ from("aws2-s3://MyBucket?amazonS3Client=#client&delay=5000&maxMessagesPerPoll=5")
82
+ .to("mock:result");
83
+
84
+ ## Use KMS with the S3 component
85
+
86
+ To use AWS KMS to encrypt/decrypt data by using AWS infrastructure, you
87
+ can use the options introduced in 2.21.x like in the following example
88
+
89
+ from("file:tmp/test?fileName=test.txt")
90
+ .setHeader(AWS2S3Constants.KEY, constant("testFile"))
91
+ .to("aws2-s3://mybucket?amazonS3Client=#client&useAwsKMS=true&awsKMSKeyId=3f0637ad-296a-3dfe-a796-e60654fb128c");
92
+
93
+ In this way, you’ll ask S3 to use the KMS key
94
+ 3f0637ad-296a-3dfe-a796-e60654fb128c, to encrypt the file test.txt. When
95
+ you ask to download this file, the decryption will be done directly
96
+ before the download.
97
+
98
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
99
+
100
+ You have the possibility of avoiding the usage of explicit static
101
+ credentials by specifying the useDefaultCredentialsProvider option and
102
+ set it to true.
103
+
104
+ The order of evaluation for Default Credentials Provider is the
105
+ following:
106
+
107
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
108
+
109
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
110
+ `AWS_SECRET_ACCESS_KEY`.
111
+
112
+ - Web Identity Token from AWS STS.
113
+
114
+ - The shared credentials and config files.
115
+
116
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
117
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
118
+ set.
119
+
120
+ - Amazon EC2 Instance profile credentials.
121
+
122
+ You have also the possibility of using Profile Credentials Provider, by
123
+ specifying the useProfileCredentialsProvider option to true and
124
+ profileCredentialsName to the profile name.
125
+
126
+ Only one of static, default and profile credentials could be used at the
127
+ same time.
128
+
129
+ For more information about this you can look at [AWS credentials
130
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
131
+
132
+ ## S3 Producer Operation examples
133
+
134
+ - Single Upload: This operation will upload a file to S3 based on the
135
+ body content
136
+
137
+ <!-- -->
138
+
139
+ from("direct:start").process(new Processor() {
140
+
141
+ @Override
142
+ public void process(Exchange exchange) throws Exception {
143
+ exchange.getIn().setHeader(AWS2S3Constants.KEY, "camel.txt");
144
+ exchange.getIn().setBody("Camel rocks!");
145
+ }
146
+ })
147
+ .to("aws2-s3://mycamelbucket?amazonS3Client=#amazonS3Client")
148
+ .to("mock:result");
149
+
150
+ This operation will upload the file camel.txt with the content "Camel
151
+ rocks!" in the *mycamelbucket* bucket
152
+
153
+ - Multipart Upload: This operation will perform a multipart upload of
154
+ a file to S3 based on the body content
155
+
156
+ <!-- -->
157
+
158
+ from("direct:start").process(new Processor() {
159
+
160
+ @Override
161
+ public void process(Exchange exchange) throws Exception {
162
+ exchange.getIn().setHeader(AWS2S3Constants.KEY, "empty.txt");
163
+ exchange.getIn().setBody(new File("src/empty.txt"));
164
+ }
165
+ })
166
+ .to("aws2-s3://mycamelbucket?amazonS3Client=#amazonS3Client&multiPartUpload=true&autoCreateBucket=true&partSize=1048576")
167
+ .to("mock:result");
168
+
169
+ This operation will perform a multipart upload of the file empty.txt
170
+ with based on the content the file src/empty.txt in the *mycamelbucket*
171
+ bucket
172
+
173
+ - CopyObject: this operation copies an object from one bucket to a
174
+ different one
175
+
176
+ <!-- -->
177
+
178
+ from("direct:start").process(new Processor() {
179
+
180
+ @Override
181
+ public void process(Exchange exchange) throws Exception {
182
+ exchange.getIn().setHeader(AWS2S3Constants.BUCKET_DESTINATION_NAME, "camelDestinationBucket");
183
+ exchange.getIn().setHeader(AWS2S3Constants.KEY, "camelKey");
184
+ exchange.getIn().setHeader(AWS2S3Constants.DESTINATION_KEY, "camelDestinationKey");
185
+ }
186
+ })
187
+ .to("aws2-s3://mycamelbucket?amazonS3Client=#amazonS3Client&operation=copyObject")
188
+ .to("mock:result");
189
+
190
+ This operation will copy the object with the name expressed in the
191
+ header camelDestinationKey to the camelDestinationBucket bucket, from
192
+ the bucket *mycamelbucket*.
193
+
194
+ - DeleteObject: this operation deletes an object from a bucket
195
+
196
+ <!-- -->
197
+
198
+ from("direct:start").process(new Processor() {
199
+
200
+ @Override
201
+ public void process(Exchange exchange) throws Exception {
202
+ exchange.getIn().setHeader(AWS2S3Constants.KEY, "camelKey");
203
+ }
204
+ })
205
+ .to("aws2-s3://mycamelbucket?amazonS3Client=#amazonS3Client&operation=deleteObject")
206
+ .to("mock:result");
207
+
208
+ This operation will delete the object camelKey from the bucket
209
+ *mycamelbucket*.
210
+
211
+ - ListBuckets: this operation lists the buckets for this account in
212
+ this region
213
+
214
+ <!-- -->
215
+
216
+ from("direct:start")
217
+ .to("aws2-s3://mycamelbucket?amazonS3Client=#amazonS3Client&operation=listBuckets")
218
+ .to("mock:result");
219
+
220
+ This operation will list the buckets for this account
221
+
222
+ - DeleteBucket: this operation deletes the bucket specified as URI
223
+ parameter or header
224
+
225
+ <!-- -->
226
+
227
+ from("direct:start")
228
+ .to("aws2-s3://mycamelbucket?amazonS3Client=#amazonS3Client&operation=deleteBucket")
229
+ .to("mock:result");
230
+
231
+ This operation will delete the bucket *mycamelbucket*
232
+
233
+ - ListObjects: this operation list object in a specific bucket
234
+
235
+ <!-- -->
236
+
237
+ from("direct:start")
238
+ .to("aws2-s3://mycamelbucket?amazonS3Client=#amazonS3Client&operation=listObjects")
239
+ .to("mock:result");
240
+
241
+ This operation will list the objects in the *mycamelbucket* bucket
242
+
243
+ - GetObject: this operation gets a single object in a specific bucket
244
+
245
+ <!-- -->
246
+
247
+ from("direct:start").process(new Processor() {
248
+
249
+ @Override
250
+ public void process(Exchange exchange) throws Exception {
251
+ exchange.getIn().setHeader(AWS2S3Constants.KEY, "camelKey");
252
+ }
253
+ })
254
+ .to("aws2-s3://mycamelbucket?amazonS3Client=#amazonS3Client&operation=getObject")
255
+ .to("mock:result");
256
+
257
+ This operation will return an S3Object instance related to the camelKey
258
+ object in *mycamelbucket* bucket.
259
+
260
+ - GetObjectRange: this operation gets a single object range in a
261
+ specific bucket
262
+
263
+ <!-- -->
264
+
265
+ from("direct:start").process(new Processor() {
266
+
267
+ @Override
268
+ public void process(Exchange exchange) throws Exception {
269
+ exchange.getIn().setHeader(AWS2S3Constants.KEY, "camelKey");
270
+ exchange.getIn().setHeader(AWS2S3Constants.RANGE_START, "0");
271
+ exchange.getIn().setHeader(AWS2S3Constants.RANGE_END, "9");
272
+ }
273
+ })
274
+ .to("aws2-s3://mycamelbucket?amazonS3Client=#amazonS3Client&operation=getObjectRange")
275
+ .to("mock:result");
276
+
277
+ This operation will return an S3Object instance related to the camelKey
278
+ object in *mycamelbucket* bucket, containing the bytes from 0 to 9.
279
+
280
+ - CreateDownloadLink: this operation will return a download link
281
+ through S3 Presigner
282
+
283
+ <!-- -->
284
+
285
+ from("direct:start").process(new Processor() {
286
+
287
+ @Override
288
+ public void process(Exchange exchange) throws Exception {
289
+ exchange.getIn().setHeader(AWS2S3Constants.KEY, "camelKey");
290
+ }
291
+ })
292
+ .to("aws2-s3://mycamelbucket?accessKey=xxx&secretKey=yyy&region=region&operation=createDownloadLink")
293
+ .to("mock:result");
294
+
295
+ This operation will return a download link url for the file camel-key in
296
+ the bucket *mycamelbucket* and region *region*. Parameters (`accessKey`,
297
+ `secretKey` and `region`) are mandatory for this operation, if S3 client
298
+ is autowired from the registry.
299
+
300
+ If checksum validations are enabled, the url will no longer be browser
301
+ compatible because it adds a signed header that must be included in the
302
+ HTTP request.
303
+
304
+ # Streaming Upload mode
305
+
306
+ With the stream mode enabled, users will be able to upload data to S3
307
+ without knowing ahead of time the dimension of the data, by leveraging
308
+ multipart upload. The upload will be completed when the batchSize has
309
+ been completed or the batchMessageNumber has been reached. There are two
310
+ possible naming strategies: progressive and random. With the progressive
311
+ strategy, each file will have the name composed by keyName option and a
312
+ progressive counter, and eventually the file extension (if any), while
313
+ with the random strategy a UUID will be added after keyName and
314
+ eventually the file extension will be appended.
315
+
316
+ As an example:
317
+
318
+ from(kafka("topic1").brokers("localhost:9092"))
319
+ .log("Kafka Message is: ${body}")
320
+ .to(aws2S3("camel-bucket").streamingUploadMode(true).batchMessageNumber(25).namingStrategy(AWS2S3EndpointBuilderFactory.AWSS3NamingStrategyEnum.progressive).keyName("{{kafkaTopic1}}/{{kafkaTopic1}}.txt"));
321
+
322
+ from(kafka("topic2").brokers("localhost:9092"))
323
+ .log("Kafka Message is: ${body}")
324
+ .to(aws2S3("camel-bucket").streamingUploadMode(true).batchMessageNumber(25).namingStrategy(AWS2S3EndpointBuilderFactory.AWSS3NamingStrategyEnum.random).keyName("{{kafkaTopic2}}/{{kafkaTopic2}}.txt"));
325
+
326
+ The default size for a batch is 1 Mb, but you can adjust it according to
327
+ your requirements.
328
+
329
+ When you stop your producer route, the producer will take care of
330
+ flushing the remaining buffered message and complete the upload.
331
+
332
+ In Streaming upload, you’ll be able to restart the producer from the
333
+ point where it left. It’s important to note that this feature is
334
+ critical only when using the progressive naming strategy.
335
+
336
+ By setting the restartingPolicy to lastPart, you will restart uploading
337
+ files and contents from the last part number the producer left.
338
+
339
+ As example: - Start the route with progressive naming strategy and
340
+ keyname equals to camel.txt, with batchMessageNumber equals to 20, and
341
+ restartingPolicy equals to lastPart - Send 70 messages. - Stop the
342
+ route - On your S3 bucket you should now see four files: camel.txt,
343
+ camel-1.txt, camel-2.txt and camel-3.txt, the first three will have 20
344
+ messages, while the last one is only 10. - Restart the route - Send 25
345
+ messages - Stop the route - You’ll now have two other files in your
346
+ bucket: camel-5.txt and camel-6.txt, the first with 20 messages and the
347
+ second with 5 messages. - Go ahead
348
+
349
+ This won’t be needed when using the random naming strategy.
350
+
351
+ On the opposite, you can specify the override restartingPolicy. In that
352
+ case, you’ll be able to override whatever you written before (for that
353
+ particular keyName) in your bucket.
354
+
355
+ In Streaming upload mode, the only keyName option that will be taken
356
+ into account is the endpoint option. Using the header will throw an NPE
357
+ and this is done by design. Setting the header means potentially change
358
+ the file name on each exchange, and this is against the aim of the
359
+ streaming upload producer. The keyName needs to be fixed and static. The
360
+ selected naming strategy will do the rest of the work.
361
+
362
+ Another possibility is specifying a streamingUploadTimeout with
363
+ batchMessageNumber and batchSize options. With this option, the user
364
+ will be able to complete the upload of a file after a certain time
365
+ passed. In this way, the upload completion will be passed on three
366
+ tiers: the timeout, the number of messages and the batch size.
367
+
368
+ As an example:
369
+
370
+ from(kafka("topic1").brokers("localhost:9092"))
371
+ .log("Kafka Message is: ${body}")
372
+ .to(aws2S3("camel-bucket").streamingUploadMode(true).batchMessageNumber(25).streamingUploadTimeout(10000).namingStrategy(AWS2S3EndpointBuilderFactory.AWSS3NamingStrategyEnum.progressive).keyName("{{kafkaTopic1}}/{{kafkaTopic1}}.txt"));
373
+
374
+ In this case, the upload will be completed after 10 seconds.
375
+
376
+ # Bucket Auto-creation
377
+
378
+ With the option `autoCreateBucket` users are able to avoid the
379
+ auto-creation of an S3 Bucket in case it doesn’t exist. The default for
380
+ this option is `false`. If set to false, any operation on a not-existent
381
+ bucket in AWS won’t be successful and an error will be returned.
382
+
383
+ # Moving stuff between a bucket and another bucket
384
+
385
+ Some users like to consume stuff from a bucket and move the content in a
386
+ different one without using the copyObject feature of this component. If
387
+ this is case for you, remember to remove the bucketName header from the
388
+ incoming exchange of the consumer, otherwise the file will always be
389
+ overwritten on the same original bucket.
390
+
391
+ # MoveAfterRead consumer option
392
+
393
+ In addition to deleteAfterRead, it has been added another option,
394
+ moveAfterRead. With this option enabled, the consumed object will be
395
+ moved to a target destinationBucket instead of being only deleted. This
396
+ will require specifying the destinationBucket option. As example:
397
+
398
+ from("aws2-s3://mycamelbucket?amazonS3Client=#amazonS3Client&moveAfterRead=true&destinationBucket=myothercamelbucket")
399
+ .to("mock:result");
400
+
401
+ In this case, the objects consumed will be moved to *myothercamelbucket*
402
+ bucket and deleted from the original one (because of deleteAfterRead set
403
+ to true as default).
404
+
405
+ You have also the possibility of using a key prefix/suffix while moving
406
+ the file to a different bucket. The options are destinationBucketPrefix
407
+ and destinationBucketSuffix.
408
+
409
+ Taking the above example, you could do something like:
410
+
411
+ from("aws2-s3://mycamelbucket?amazonS3Client=#amazonS3Client&moveAfterRead=true&destinationBucket=myothercamelbucket&destinationBucketPrefix=RAW(pre-)&destinationBucketSuffix=RAW(-suff)")
412
+ .to("mock:result");
413
+
414
+ In this case, the objects consumed will be moved to *myothercamelbucket*
415
+ bucket and deleted from the original one (because of deleteAfterRead set
416
+ to true as default).
417
+
418
+ So if the file name is test, in the *myothercamelbucket* you should see
419
+ a file called pre-test-suff.
420
+
421
+ # Using customer key as encryption
422
+
423
+ We introduced also the customer key support (an alternative of using
424
+ KMS). The following code shows an example.
425
+
426
+ String key = UUID.randomUUID().toString();
427
+ byte[] secretKey = generateSecretKey();
428
+ String b64Key = Base64.getEncoder().encodeToString(secretKey);
429
+ String b64KeyMd5 = Md5Utils.md5AsBase64(secretKey);
430
+
431
+ String awsEndpoint = "aws2-s3://mycamel?autoCreateBucket=false&useCustomerKey=true&customerKeyId=RAW(" + b64Key + ")&customerKeyMD5=RAW(" + b64KeyMd5 + ")&customerAlgorithm=" + AES256.name();
432
+
433
+ from("direct:putObject")
434
+ .setHeader(AWS2S3Constants.KEY, constant("test.txt"))
435
+ .setBody(constant("Test"))
436
+ .to(awsEndpoint);
437
+
438
+ # Using a POJO as body
439
+
440
+ Sometimes building an AWS Request can be complex because of multiple
441
+ options. We introduce the possibility to use a POJO as the body. In AWS
442
+ S3 there are multiple operations you can submit, as an example for List
443
+ brokers request, you can do something like:
444
+
445
+ from("direct:aws2-s3")
446
+ .setBody(ListObjectsRequest.builder().bucket(bucketName).build())
447
+ .to("aws2-s3://test?amazonS3Client=#amazonS3Client&operation=listObjects&pojoRequest=true")
448
+
449
+ In this way, you’ll pass the request directly without the need of
450
+ passing headers and options specifically related to this operation.
451
+
452
+ # Create S3 client and add component to registry
453
+
454
+ Sometimes you would want to perform some advanced configuration using
455
+ AWS2S3Configuration, which also allows to set the S3 client. You can
456
+ create and set the S3 client in the component configuration as shown in
457
+ the following example
458
+
459
+ String awsBucketAccessKey = "your_access_key";
460
+ String awsBucketSecretKey = "your_secret_key";
461
+
462
+ S3Client s3Client = S3Client.builder().credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create(awsBucketAccessKey, awsBucketSecretKey)))
463
+ .region(Region.US_EAST_1).build();
464
+
465
+ AWS2S3Configuration configuration = new AWS2S3Configuration();
466
+ configuration.setAmazonS3Client(s3Client);
467
+ configuration.setAutoDiscoverClient(true);
468
+ configuration.setBucketName("s3bucket2020");
469
+ configuration.setRegion("us-east-1");
470
+
471
+ Now you can configure the S3 component (using the configuration object
472
+ created above) and add it to the registry in the configure method before
473
+ initialization of routes.
474
+
475
+ AWS2S3Component s3Component = new AWS2S3Component(getContext());
476
+ s3Component.setConfiguration(configuration);
477
+ s3Component.setLazyStartProducer(true);
478
+ camelContext.addComponent("aws2-s3", s3Component);
479
+
480
+ Now your component will be used for all the operations implemented in
481
+ camel routes.
482
+
483
+ # Dependencies
484
+
485
+ Maven users will need to add the following dependency to their pom.xml.
486
+
487
+ **pom.xml**
488
+
489
+ <dependency>
490
+ <groupId>org.apache.camel</groupId>
491
+ <artifactId>camel-aws2-s3</artifactId>
492
+ <version>${camel-version}</version>
493
+ </dependency>
494
+
495
+ where `${camel-version}` must be replaced by the actual version of
496
+ Camel.
497
+
498
+ ## Component Configurations
499
+
500
+
501
+ |Name|Description|Default|Type|
502
+ |---|---|---|---|
503
+ |autoCreateBucket|Setting the autocreation of the S3 bucket bucketName. This will apply also in case of moveAfterRead option enabled, and it will create the destinationBucket if it doesn't exist already.|false|boolean|
504
+ |configuration|The component configuration||object|
505
+ |delimiter|The delimiter which is used in the com.amazonaws.services.s3.model.ListObjectsRequest to only consume objects we are interested in.||string|
506
+ |forcePathStyle|Set whether the S3 client should use path-style URL instead of virtual-hosted-style|false|boolean|
507
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
508
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
509
+ |policy|The policy for this queue to set in the com.amazonaws.services.s3.AmazonS3#setBucketPolicy() method.||string|
510
+ |prefix|The prefix which is used in the com.amazonaws.services.s3.model.ListObjectsRequest to only consume objects we are interested in.||string|
511
+ |region|The region in which the S3 client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
512
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
513
+ |customerAlgorithm|Define the customer algorithm to use in case CustomerKey is enabled||string|
514
+ |customerKeyId|Define the id of the Customer key to use in case CustomerKey is enabled||string|
515
+ |customerKeyMD5|Define the MD5 of Customer key to use in case CustomerKey is enabled||string|
516
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
517
+ |deleteAfterRead|Delete objects from S3 after they have been retrieved. The deleting is only performed if the Exchange is committed. If a rollback occurs, the object is not deleted. If this option is false, then the same objects will be retrieved over and over again in the polls. Therefore, you need to use the Idempotent Consumer EIP in the route to filter out duplicates. You can filter using the AWS2S3Constants#BUCKET\_NAME and AWS2S3Constants#KEY headers, or only the AWS2S3Constants#KEY header.|true|boolean|
518
+ |destinationBucket|Define the destination bucket where an object must be moved when moveAfterRead is set to true.||string|
519
+ |destinationBucketPrefix|Define the destination bucket prefix to use when an object must be moved, and moveAfterRead is set to true.||string|
520
+ |destinationBucketSuffix|Define the destination bucket suffix to use when an object must be moved, and moveAfterRead is set to true.||string|
521
+ |doneFileName|If provided, Camel will only consume files if a done file exists.||string|
522
+ |fileName|To get the object from the bucket with the given file name||string|
523
+ |ignoreBody|If it is true, the S3 Object Body will be ignored completely if it is set to false, the S3 Object will be put in the body. Setting this to true will override any behavior defined by includeBody option.|false|boolean|
524
+ |includeBody|If it is true, the S3Object exchange will be consumed and put into the body and closed. If false, the S3Object stream will be put raw into the body and the headers will be set with the S3 object metadata. This option is strongly related to the autocloseBody option. In case of setting includeBody to true because the S3Object stream will be consumed then it will also be closed, while in case of includeBody false then it will be up to the caller to close the S3Object stream. However, setting autocloseBody to true when includeBody is false it will schedule to close the S3Object stream automatically on exchange completion.|true|boolean|
525
+ |includeFolders|If it is true, the folders/directories will be consumed. If it is false, they will be ignored, and Exchanges will not be created for those|true|boolean|
526
+ |moveAfterRead|Move objects from S3 bucket to a different bucket after they have been retrieved. To accomplish the operation, the destinationBucket option must be set. The copy bucket operation is only performed if the Exchange is committed. If a rollback occurs, the object is not moved.|false|boolean|
527
+ |autocloseBody|If this option is true and includeBody is false, then the S3Object.close() method will be called on exchange completion. This option is strongly related to includeBody option. In case of setting includeBody to false and autocloseBody to false, it will be up to the caller to close the S3Object stream. Setting autocloseBody to true, will close the S3Object stream automatically.|true|boolean|
528
+ |batchMessageNumber|The number of messages composing a batch in streaming upload mode|10|integer|
529
+ |batchSize|The batch size (in bytes) in streaming upload mode|1000000|integer|
530
+ |bufferSize|The buffer size (in bytes) in streaming upload mode|1000000|integer|
531
+ |deleteAfterWrite|Delete file object after the S3 file has been uploaded|false|boolean|
532
+ |keyName|Setting the key name for an element in the bucket through endpoint parameter||string|
533
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
534
+ |multiPartUpload|If it is true, camel will upload the file with multipart format. The part size is decided by the partSize option. Camel will only do multipart uploads for files that are larger than the part-size thresholds. Files that are smaller will be uploaded in a single operation.|false|boolean|
535
+ |namingStrategy|The naming strategy to use in streaming upload mode|progressive|object|
536
+ |operation|The operation to do in case the user don't want to do only an upload||object|
537
+ |partSize|Set up the partSize which is used in multipart upload, the default size is 25M. Camel will only do multipart uploads for files that are larger than the part-size thresholds. Files that are smaller will be uploaded in a single operation.|26214400|integer|
538
+ |restartingPolicy|The restarting policy to use in streaming upload mode|override|object|
539
+ |storageClass|The storage class to set in the com.amazonaws.services.s3.model.PutObjectRequest request.||string|
540
+ |streamingUploadMode|When stream mode is true, the upload to bucket will be done in streaming|false|boolean|
541
+ |streamingUploadTimeout|While streaming upload mode is true, this option set the timeout to complete upload||integer|
542
+ |awsKMSKeyId|Define the id of KMS key to use in case KMS is enabled||string|
543
+ |useAwsKMS|Define if KMS must be used or not|false|boolean|
544
+ |useCustomerKey|Define if Customer Key must be used or not|false|boolean|
545
+ |useSSES3|Define if SSE S3 must be used or not|false|boolean|
546
+ |amazonS3Client|Reference to a com.amazonaws.services.s3.AmazonS3 in the registry.||object|
547
+ |amazonS3Presigner|An S3 Presigner for Request, used mainly in createDownloadLink operation||object|
548
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
549
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
550
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
551
+ |proxyHost|To define a proxy host when instantiating the SQS client||string|
552
+ |proxyPort|Specify a proxy port to be used inside the client definition.||integer|
553
+ |proxyProtocol|To define a proxy protocol when instantiating the S3 client|HTTPS|object|
554
+ |accessKey|Amazon AWS Access Key||string|
555
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
556
+ |secretKey|Amazon AWS Secret Key||string|
557
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
558
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
559
+ |useDefaultCredentialsProvider|Set whether the S3 client should expect to load credentials through a default credentials provider.|false|boolean|
560
+ |useProfileCredentialsProvider|Set whether the S3 client should expect to load credentials through a profile credentials provider.|false|boolean|
561
+ |useSessionCredentials|Set whether the S3 client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in S3.|false|boolean|
562
+
563
+ ## Endpoint Configurations
564
+
565
+
566
+ |Name|Description|Default|Type|
567
+ |---|---|---|---|
568
+ |bucketNameOrArn|Bucket name or ARN||string|
569
+ |autoCreateBucket|Setting the autocreation of the S3 bucket bucketName. This will apply also in case of moveAfterRead option enabled, and it will create the destinationBucket if it doesn't exist already.|false|boolean|
570
+ |delimiter|The delimiter which is used in the com.amazonaws.services.s3.model.ListObjectsRequest to only consume objects we are interested in.||string|
571
+ |forcePathStyle|Set whether the S3 client should use path-style URL instead of virtual-hosted-style|false|boolean|
572
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
573
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
574
+ |policy|The policy for this queue to set in the com.amazonaws.services.s3.AmazonS3#setBucketPolicy() method.||string|
575
+ |prefix|The prefix which is used in the com.amazonaws.services.s3.model.ListObjectsRequest to only consume objects we are interested in.||string|
576
+ |region|The region in which the S3 client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
577
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
578
+ |customerAlgorithm|Define the customer algorithm to use in case CustomerKey is enabled||string|
579
+ |customerKeyId|Define the id of the Customer key to use in case CustomerKey is enabled||string|
580
+ |customerKeyMD5|Define the MD5 of Customer key to use in case CustomerKey is enabled||string|
581
+ |deleteAfterRead|Delete objects from S3 after they have been retrieved. The deleting is only performed if the Exchange is committed. If a rollback occurs, the object is not deleted. If this option is false, then the same objects will be retrieved over and over again in the polls. Therefore, you need to use the Idempotent Consumer EIP in the route to filter out duplicates. You can filter using the AWS2S3Constants#BUCKET\_NAME and AWS2S3Constants#KEY headers, or only the AWS2S3Constants#KEY header.|true|boolean|
582
+ |destinationBucket|Define the destination bucket where an object must be moved when moveAfterRead is set to true.||string|
583
+ |destinationBucketPrefix|Define the destination bucket prefix to use when an object must be moved, and moveAfterRead is set to true.||string|
584
+ |destinationBucketSuffix|Define the destination bucket suffix to use when an object must be moved, and moveAfterRead is set to true.||string|
585
+ |doneFileName|If provided, Camel will only consume files if a done file exists.||string|
586
+ |fileName|To get the object from the bucket with the given file name||string|
587
+ |ignoreBody|If it is true, the S3 Object Body will be ignored completely if it is set to false, the S3 Object will be put in the body. Setting this to true will override any behavior defined by includeBody option.|false|boolean|
588
+ |includeBody|If it is true, the S3Object exchange will be consumed and put into the body and closed. If false, the S3Object stream will be put raw into the body and the headers will be set with the S3 object metadata. This option is strongly related to the autocloseBody option. In case of setting includeBody to true because the S3Object stream will be consumed then it will also be closed, while in case of includeBody false then it will be up to the caller to close the S3Object stream. However, setting autocloseBody to true when includeBody is false it will schedule to close the S3Object stream automatically on exchange completion.|true|boolean|
589
+ |includeFolders|If it is true, the folders/directories will be consumed. If it is false, they will be ignored, and Exchanges will not be created for those|true|boolean|
590
+ |maxConnections|Set the maxConnections parameter in the S3 client configuration|60|integer|
591
+ |maxMessagesPerPoll|Gets the maximum number of messages as a limit to poll at each polling. Gets the maximum number of messages as a limit to poll at each polling. The default value is 10. Use 0 or a negative number to set it as unlimited.|10|integer|
592
+ |moveAfterRead|Move objects from S3 bucket to a different bucket after they have been retrieved. To accomplish the operation, the destinationBucket option must be set. The copy bucket operation is only performed if the Exchange is committed. If a rollback occurs, the object is not moved.|false|boolean|
593
+ |sendEmptyMessageWhenIdle|If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead.|false|boolean|
594
+ |autocloseBody|If this option is true and includeBody is false, then the S3Object.close() method will be called on exchange completion. This option is strongly related to includeBody option. In case of setting includeBody to false and autocloseBody to false, it will be up to the caller to close the S3Object stream. Setting autocloseBody to true, will close the S3Object stream automatically.|true|boolean|
595
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
596
+ |exceptionHandler|To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.||object|
597
+ |exchangePattern|Sets the exchange pattern when the consumer creates an exchange.||object|
598
+ |inProgressRepository|A pluggable in-progress repository org.apache.camel.spi.IdempotentRepository. The in-progress repository is used to account the current in progress files being consumed. By default a memory based repository is used.||object|
599
+ |pollStrategy|A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel.||object|
600
+ |batchMessageNumber|The number of messages composing a batch in streaming upload mode|10|integer|
601
+ |batchSize|The batch size (in bytes) in streaming upload mode|1000000|integer|
602
+ |bufferSize|The buffer size (in bytes) in streaming upload mode|1000000|integer|
603
+ |deleteAfterWrite|Delete file object after the S3 file has been uploaded|false|boolean|
604
+ |keyName|Setting the key name for an element in the bucket through endpoint parameter||string|
605
+ |multiPartUpload|If it is true, camel will upload the file with multipart format. The part size is decided by the partSize option. Camel will only do multipart uploads for files that are larger than the part-size thresholds. Files that are smaller will be uploaded in a single operation.|false|boolean|
606
+ |namingStrategy|The naming strategy to use in streaming upload mode|progressive|object|
607
+ |operation|The operation to do in case the user don't want to do only an upload||object|
608
+ |partSize|Set up the partSize which is used in multipart upload, the default size is 25M. Camel will only do multipart uploads for files that are larger than the part-size thresholds. Files that are smaller will be uploaded in a single operation.|26214400|integer|
609
+ |restartingPolicy|The restarting policy to use in streaming upload mode|override|object|
610
+ |storageClass|The storage class to set in the com.amazonaws.services.s3.model.PutObjectRequest request.||string|
611
+ |streamingUploadMode|When stream mode is true, the upload to bucket will be done in streaming|false|boolean|
612
+ |streamingUploadTimeout|While streaming upload mode is true, this option set the timeout to complete upload||integer|
613
+ |awsKMSKeyId|Define the id of KMS key to use in case KMS is enabled||string|
614
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
615
+ |useAwsKMS|Define if KMS must be used or not|false|boolean|
616
+ |useCustomerKey|Define if Customer Key must be used or not|false|boolean|
617
+ |useSSES3|Define if SSE S3 must be used or not|false|boolean|
618
+ |amazonS3Client|Reference to a com.amazonaws.services.s3.AmazonS3 in the registry.||object|
619
+ |amazonS3Presigner|An S3 Presigner for Request, used mainly in createDownloadLink operation||object|
620
+ |proxyHost|To define a proxy host when instantiating the SQS client||string|
621
+ |proxyPort|Specify a proxy port to be used inside the client definition.||integer|
622
+ |proxyProtocol|To define a proxy protocol when instantiating the S3 client|HTTPS|object|
623
+ |backoffErrorThreshold|The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in.||integer|
624
+ |backoffIdleThreshold|The number of subsequent idle polls that should happen before the backoffMultipler should kick-in.||integer|
625
+ |backoffMultiplier|To let the scheduled polling consumer backoff if there has been a number of subsequent idles/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and/or backoffErrorThreshold must also be configured.||integer|
626
+ |delay|Milliseconds before the next poll.|500|integer|
627
+ |greedy|If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages.|false|boolean|
628
+ |initialDelay|Milliseconds before the first poll starts.|1000|integer|
629
+ |repeatCount|Specifies a maximum limit of number of fires. So if you set it to 1, the scheduler will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever.|0|integer|
630
+ |runLoggingLevel|The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that.|TRACE|object|
631
+ |scheduledExecutorService|Allows for configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool.||object|
632
+ |scheduler|To use a cron scheduler from either camel-spring or camel-quartz component. Use value spring or quartz for built in scheduler|none|object|
633
+ |schedulerProperties|To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler.||object|
634
+ |startScheduler|Whether the scheduler should be auto started.|true|boolean|
635
+ |timeUnit|Time unit for initialDelay and delay options.|MILLISECONDS|object|
636
+ |useFixedDelay|Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details.|true|boolean|
637
+ |accessKey|Amazon AWS Access Key||string|
638
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
639
+ |secretKey|Amazon AWS Secret Key||string|
640
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
641
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
642
+ |useDefaultCredentialsProvider|Set whether the S3 client should expect to load credentials through a default credentials provider.|false|boolean|
643
+ |useProfileCredentialsProvider|Set whether the S3 client should expect to load credentials through a profile credentials provider.|false|boolean|
644
+ |useSessionCredentials|Set whether the S3 client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in S3.|false|boolean|
camel-aws2-ses.md ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws2-ses
2
+
3
+ **Since Camel 3.1**
4
+
5
+ **Only producer is supported**
6
+
7
+ The AWS2 SES component supports sending emails with [Amazon’s
8
+ SES](https://aws.amazon.com/ses) service.
9
+
10
+ Prerequisites
11
+
12
+ You must have a valid Amazon Web Services developer account, and be
13
+ signed up to use Amazon SES. More information is available at [Amazon
14
+ SES](https://aws.amazon.com/ses).
15
+
16
+ # URI Format
17
+
18
+ aws2-ses://from[?options]
19
+
20
+ You can append query options to the URI in the following format:
21
+
22
+ `?options=value&option2=value&...`
23
+
24
+ Required SES component options
25
+
26
+ You have to provide the amazonSESClient in the Registry or your
27
+ accessKey and secretKey to access the [Amazon’s
28
+ SES](https://aws.amazon.com/ses).
29
+
30
+ # Usage
31
+
32
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
33
+
34
+ You have the possibility of avoiding the usage of explicit static
35
+ credentials by specifying the useDefaultCredentialsProvider option and
36
+ set it to true.
37
+
38
+ The order of evaluation for Default Credentials Provider is the
39
+ following:
40
+
41
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
42
+
43
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
44
+ `AWS_SECRET_ACCESS_KEY`.
45
+
46
+ - Web Identity Token from AWS STS.
47
+
48
+ - The shared credentials and config files.
49
+
50
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
51
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
52
+ set.
53
+
54
+ - Amazon EC2 Instance profile credentials.
55
+
56
+ You have also the possibility of using Profile Credentials Provider, by
57
+ specifying the useProfileCredentialsProvider option to true and
58
+ profileCredentialsName to the profile name.
59
+
60
+ Only one of static, default and profile credentials could be used at the
61
+ same time.
62
+
63
+ For more information about this you can look at [AWS credentials
64
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
65
+
66
+ ## Advanced SesClient configuration
67
+
68
+ If you need more control over the `SesClient` instance configuration you
69
+ can create your own instance and refer to it from the URI:
70
+
71
+ from("direct:start")
72
+ .to("aws2-ses://example@example.com?amazonSESClient=#client");
73
+
74
+ The `#client` refers to a `SesClient` in the Registry.
75
+
76
+ # Examples
77
+
78
+ ## Producer Examples
79
+
80
+ from("direct:start")
81
+ .setHeader(SesConstants.SUBJECT, constant("This is my subject"))
82
+ .setHeader(SesConstants.TO, constant(Collections.singletonList("to@example.com"))
83
+ .setBody(constant("This is my message text."))
84
+ .to("aws2-ses://from@example.com?accessKey=xxx&secretKey=yyy");
85
+
86
+ # Dependencies
87
+
88
+ Maven users will need to add the following dependency to their pom.xml.
89
+
90
+ **pom.xml**
91
+
92
+ <dependency>
93
+ <groupId>org.apache.camel</groupId>
94
+ <artifactId>camel-aws2-ses</artifactId>
95
+ <version>${camel-version}</version>
96
+ </dependency>
97
+
98
+ where `${camel-version}` must be replaced by the actual version of
99
+ Camel.
100
+
101
+ ## Component Configurations
102
+
103
+
104
+ |Name|Description|Default|Type|
105
+ |---|---|---|---|
106
+ |bcc|List of comma-separated destination blind carbon copy (bcc) email address. Can be overridden with 'CamelAwsSesBcc' header.||string|
107
+ |cc|List of comma-separated destination carbon copy (cc) email address. Can be overridden with 'CamelAwsSesCc' header.||string|
108
+ |configuration|component configuration||object|
109
+ |configurationSet|Set the configuration set to send with every request. Override it with 'CamelAwsSesConfigurationSet' header.||string|
110
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
111
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
112
+ |region|The region in which SES client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
113
+ |replyToAddresses|List of comma separated reply-to email address(es) for the message, override it using 'CamelAwsSesReplyToAddresses' header.||string|
114
+ |returnPath|The email address to which bounce notifications are to be forwarded, override it using 'CamelAwsSesReturnPath' header.||string|
115
+ |subject|The subject which is used if the message header 'CamelAwsSesSubject' is not present.||string|
116
+ |to|List of comma separated destination email address. Can be overridden with 'CamelAwsSesTo' header.||string|
117
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
118
+ |amazonSESClient|To use the AmazonSimpleEmailService as the client||object|
119
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
120
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
121
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
122
+ |proxyHost|To define a proxy host when instantiating the SES client||string|
123
+ |proxyPort|To define a proxy port when instantiating the SES client||integer|
124
+ |proxyProtocol|To define a proxy protocol when instantiating the SES client|HTTPS|object|
125
+ |accessKey|Amazon AWS Access Key||string|
126
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
127
+ |secretKey|Amazon AWS Secret Key||string|
128
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
129
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
130
+ |useDefaultCredentialsProvider|Set whether the Ses client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
131
+ |useProfileCredentialsProvider|Set whether the SES client should expect to load credentials through a profile credentials provider.|false|boolean|
132
+ |useSessionCredentials|Set whether the SES client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in SES.|false|boolean|
133
+
134
+ ## Endpoint Configurations
135
+
136
+
137
+ |Name|Description|Default|Type|
138
+ |---|---|---|---|
139
+ |from|The sender's email address.||string|
140
+ |bcc|List of comma-separated destination blind carbon copy (bcc) email address. Can be overridden with 'CamelAwsSesBcc' header.||string|
141
+ |cc|List of comma-separated destination carbon copy (cc) email address. Can be overridden with 'CamelAwsSesCc' header.||string|
142
+ |configurationSet|Set the configuration set to send with every request. Override it with 'CamelAwsSesConfigurationSet' header.||string|
143
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
144
+ |region|The region in which SES client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
145
+ |replyToAddresses|List of comma separated reply-to email address(es) for the message, override it using 'CamelAwsSesReplyToAddresses' header.||string|
146
+ |returnPath|The email address to which bounce notifications are to be forwarded, override it using 'CamelAwsSesReturnPath' header.||string|
147
+ |subject|The subject which is used if the message header 'CamelAwsSesSubject' is not present.||string|
148
+ |to|List of comma separated destination email address. Can be overridden with 'CamelAwsSesTo' header.||string|
149
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
150
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
151
+ |amazonSESClient|To use the AmazonSimpleEmailService as the client||object|
152
+ |proxyHost|To define a proxy host when instantiating the SES client||string|
153
+ |proxyPort|To define a proxy port when instantiating the SES client||integer|
154
+ |proxyProtocol|To define a proxy protocol when instantiating the SES client|HTTPS|object|
155
+ |accessKey|Amazon AWS Access Key||string|
156
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
157
+ |secretKey|Amazon AWS Secret Key||string|
158
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
159
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
160
+ |useDefaultCredentialsProvider|Set whether the Ses client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
161
+ |useProfileCredentialsProvider|Set whether the SES client should expect to load credentials through a profile credentials provider.|false|boolean|
162
+ |useSessionCredentials|Set whether the SES client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in SES.|false|boolean|
camel-aws2-sns.md ADDED
@@ -0,0 +1,253 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws2-sns
2
+
3
+ **Since Camel 3.1**
4
+
5
+ **Only producer is supported**
6
+
7
+ The AWS2 SNS component allows messages to be sent to an [Amazon Simple
8
+ Notification](https://aws.amazon.com/sns) Topic. The implementation of
9
+ the Amazon API is provided by the [AWS
10
+ SDK](https://aws.amazon.com/sdkforjava/).
11
+
12
+ Prerequisites
13
+
14
+ You must have a valid Amazon Web Services developer account, and be
15
+ signed up to use Amazon SNS. More information is available at [Amazon
16
+ SNS](https://aws.amazon.com/sns).
17
+
18
+ # URI Format
19
+
20
+ aws2-sns://topicNameOrArn[?options]
21
+
22
+ The topic will be created if they don’t already exist.
23
+
24
+ You can append query options to the URI in the following format:
25
+
26
+ `?options=value&option2=value&...`
27
+
28
+ # URI Options
29
+
30
+ Required SNS component options
31
+
32
+ You have to provide the amazonSNSClient in the Registry or your
33
+ accessKey and secretKey to access the [Amazon’s
34
+ SNS](https://aws.amazon.com/sns).
35
+
36
+ # Usage
37
+
38
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
39
+
40
+ You have the possibility of avoiding the usage of explicit static
41
+ credentials by specifying the useDefaultCredentialsProvider option and
42
+ set it to true.
43
+
44
+ The order of evaluation for Default Credentials Provider is the
45
+ following:
46
+
47
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
48
+
49
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
50
+ `AWS_SECRET_ACCESS_KEY`.
51
+
52
+ - Web Identity Token from AWS STS.
53
+
54
+ - The shared credentials and config files.
55
+
56
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
57
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
58
+ set.
59
+
60
+ - Amazon EC2 Instance profile credentials.
61
+
62
+ You have also the possibility of using Profile Credentials Provider, by
63
+ specifying the useProfileCredentialsProvider option to true and
64
+ profileCredentialsName to the profile name.
65
+
66
+ Only one of static, default and profile credentials could be used at the
67
+ same time.
68
+
69
+ For more information about this you can look at [AWS credentials
70
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
71
+
72
+ ## Advanced AmazonSNS configuration
73
+
74
+ If you need more control over the `SnsClient` instance configuration you
75
+ can create your own instance and refer to it from the URI:
76
+
77
+ from("direct:start")
78
+ .to("aws2-sns://MyTopic?amazonSNSClient=#client");
79
+
80
+ The `#client` refers to a `AmazonSNS` in the Registry.
81
+
82
+ ## Create a subscription between an AWS SNS Topic and an AWS SQS Queue
83
+
84
+ You can create a subscription of an SQS Queue to an SNS Topic in this
85
+ way:
86
+
87
+ from("direct:start")
88
+ .to("aws2-sns://test-camel-sns1?amazonSNSClient=#amazonSNSClient&subscribeSNStoSQS=true&queueArn=arn:aws:sqs:eu-central-1:123456789012:test_camel");
89
+
90
+ The `#amazonSNSClient` refers to a `SnsClient` in the Registry. By
91
+ specifying `subscribeSNStoSQS` to true and a `queueArn` of an existing
92
+ SQS Queue, you’ll be able to subscribe your SQS Queue to your SNS Topic.
93
+
94
+ At this point, you can consume messages coming from SNS Topic through
95
+ your SQS Queue
96
+
97
+ from("aws2-sqs://test-camel?amazonSQSClient=#amazonSQSClient&delay=50&maxMessagesPerPoll=5")
98
+ .to(...);
99
+
100
+ # Topic Autocreation
101
+
102
+ With the option `autoCreateTopic` users are able to avoid the
103
+ autocreation of an SNS Topic in case it doesn’t exist. The default for
104
+ this option is `false`. If set to false, any operation on a non-existent
105
+ topic in AWS won’t be successful and an error will be returned.
106
+
107
+ # SNS FIFO
108
+
109
+ SNS FIFO are supported. While creating the SQS queue, you will subscribe
110
+ to the SNS topic there is an important point to remember, you’ll need to
111
+ make possible for the SNS Topic to send the message to the SQS Queue.
112
+
113
+ This is clear with an example.
114
+
115
+ Suppose you created an SNS FIFO Topic called Order.fifo and an SQS Queue
116
+ called QueueSub.fifo.
117
+
118
+ In the access Policy of the QueueSub.fifo you should submit something
119
+ like this
120
+
121
+ {
122
+ "Version": "2008-10-17",
123
+ "Id": "__default_policy_ID",
124
+ "Statement": [
125
+ {
126
+ "Sid": "__owner_statement",
127
+ "Effect": "Allow",
128
+ "Principal": {
129
+ "AWS": "arn:aws:iam::780560123482:root"
130
+ },
131
+ "Action": "SQS:*",
132
+ "Resource": "arn:aws:sqs:eu-west-1:780560123482:QueueSub.fifo"
133
+ },
134
+ {
135
+ "Effect": "Allow",
136
+ "Principal": {
137
+ "Service": "sns.amazonaws.com"
138
+ },
139
+ "Action": "SQS:SendMessage",
140
+ "Resource": "arn:aws:sqs:eu-west-1:780560123482:QueueSub.fifo",
141
+ "Condition": {
142
+ "ArnLike": {
143
+ "aws:SourceArn": "arn:aws:sns:eu-west-1:780410022472:Order.fifo"
144
+ }
145
+ }
146
+ }
147
+ ]
148
+ }
149
+
150
+ This is a critical step to make the subscription work correctly.
151
+
152
+ ## SNS Fifo Topic Message group ID Strategy and message Deduplication ID Strategy
153
+
154
+ When sending something to the FIFO topic, you’ll need to always set up a
155
+ message group ID strategy.
156
+
157
+ If the content-based message deduplication has been enabled on the SNS
158
+ Fifo topic, where won’t be the need of setting a message deduplication
159
+ id strategy, otherwise you’ll have to set it.
160
+
161
+ # Examples
162
+
163
+ ## Producer Examples
164
+
165
+ Sending to a topic
166
+
167
+ from("direct:start")
168
+ .to("aws2-sns://camel-topic?subject=The+subject+message&autoCreateTopic=true");
169
+
170
+ # Dependencies
171
+
172
+ Maven users will need to add the following dependency to their pom.xml.
173
+
174
+ **pom.xml**
175
+
176
+ <dependency>
177
+ <groupId>org.apache.camel</groupId>
178
+ <artifactId>camel-aws2-sns</artifactId>
179
+ <version>${camel-version}</version>
180
+ </dependency>
181
+
182
+ where `${camel-version}` must be replaced by the actual version of
183
+ Camel.
184
+
185
+ ## Component Configurations
186
+
187
+
188
+ |Name|Description|Default|Type|
189
+ |---|---|---|---|
190
+ |autoCreateTopic|Setting the auto-creation of the topic|false|boolean|
191
+ |configuration|Component configuration||object|
192
+ |kmsMasterKeyId|The ID of an AWS-managed customer master key (CMK) for Amazon SNS or a custom CMK.||string|
193
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
194
+ |messageDeduplicationIdStrategy|Only for FIFO Topic. Strategy for setting the messageDeduplicationId on the message. It can be one of the following options: useExchangeId, useContentBasedDeduplication. For the useContentBasedDeduplication option, no messageDeduplicationId will be set on the message.|useExchangeId|string|
195
+ |messageGroupIdStrategy|Only for FIFO Topic. Strategy for setting the messageGroupId on the message. It can be one of the following options: useConstant, useExchangeId, usePropertyValue. For the usePropertyValue option, the value of property CamelAwsSnsMessageGroupId will be used.||string|
196
+ |messageStructure|The message structure to use such as json||string|
197
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
198
+ |policy|The policy for this topic. Is loaded by default from classpath, but you can prefix with classpath:, file:, or http: to load the resource from different systems.||string|
199
+ |queueArn|The ARN endpoint to subscribe to||string|
200
+ |region|The region in which the SNS client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
201
+ |serverSideEncryptionEnabled|Define if Server Side Encryption is enabled or not on the topic|false|boolean|
202
+ |subject|The subject which is used if the message header 'CamelAwsSnsSubject' is not present.||string|
203
+ |subscribeSNStoSQS|Define if the subscription between SNS Topic and SQS must be done or not|false|boolean|
204
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
205
+ |amazonSNSClient|To use the AmazonSNS as the client||object|
206
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
207
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
208
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
209
+ |proxyHost|To define a proxy host when instantiating the SNS client||string|
210
+ |proxyPort|To define a proxy port when instantiating the SNS client||integer|
211
+ |proxyProtocol|To define a proxy protocol when instantiating the SNS client|HTTPS|object|
212
+ |accessKey|Amazon AWS Access Key||string|
213
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
214
+ |secretKey|Amazon AWS Secret Key||string|
215
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
216
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
217
+ |useDefaultCredentialsProvider|Set whether the SNS client should expect to load credentials on an AWS infra instance or to expect static credentials to be passed in.|false|boolean|
218
+ |useProfileCredentialsProvider|Set whether the SNS client should expect to load credentials through a profile credentials provider.|false|boolean|
219
+ |useSessionCredentials|Set whether the SNS client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in SNS.|false|boolean|
220
+
221
+ ## Endpoint Configurations
222
+
223
+
224
+ |Name|Description|Default|Type|
225
+ |---|---|---|---|
226
+ |topicNameOrArn|Topic name or ARN||string|
227
+ |autoCreateTopic|Setting the auto-creation of the topic|false|boolean|
228
+ |headerFilterStrategy|To use a custom HeaderFilterStrategy to map headers to/from Camel.||object|
229
+ |kmsMasterKeyId|The ID of an AWS-managed customer master key (CMK) for Amazon SNS or a custom CMK.||string|
230
+ |messageDeduplicationIdStrategy|Only for FIFO Topic. Strategy for setting the messageDeduplicationId on the message. It can be one of the following options: useExchangeId, useContentBasedDeduplication. For the useContentBasedDeduplication option, no messageDeduplicationId will be set on the message.|useExchangeId|string|
231
+ |messageGroupIdStrategy|Only for FIFO Topic. Strategy for setting the messageGroupId on the message. It can be one of the following options: useConstant, useExchangeId, usePropertyValue. For the usePropertyValue option, the value of property CamelAwsSnsMessageGroupId will be used.||string|
232
+ |messageStructure|The message structure to use such as json||string|
233
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
234
+ |policy|The policy for this topic. Is loaded by default from classpath, but you can prefix with classpath:, file:, or http: to load the resource from different systems.||string|
235
+ |queueArn|The ARN endpoint to subscribe to||string|
236
+ |region|The region in which the SNS client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
237
+ |serverSideEncryptionEnabled|Define if Server Side Encryption is enabled or not on the topic|false|boolean|
238
+ |subject|The subject which is used if the message header 'CamelAwsSnsSubject' is not present.||string|
239
+ |subscribeSNStoSQS|Define if the subscription between SNS Topic and SQS must be done or not|false|boolean|
240
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
241
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
242
+ |amazonSNSClient|To use the AmazonSNS as the client||object|
243
+ |proxyHost|To define a proxy host when instantiating the SNS client||string|
244
+ |proxyPort|To define a proxy port when instantiating the SNS client||integer|
245
+ |proxyProtocol|To define a proxy protocol when instantiating the SNS client|HTTPS|object|
246
+ |accessKey|Amazon AWS Access Key||string|
247
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
248
+ |secretKey|Amazon AWS Secret Key||string|
249
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
250
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
251
+ |useDefaultCredentialsProvider|Set whether the SNS client should expect to load credentials on an AWS infra instance or to expect static credentials to be passed in.|false|boolean|
252
+ |useProfileCredentialsProvider|Set whether the SNS client should expect to load credentials through a profile credentials provider.|false|boolean|
253
+ |useSessionCredentials|Set whether the SNS client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in SNS.|false|boolean|
camel-aws2-sqs.md ADDED
@@ -0,0 +1,389 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws2-sqs
2
+
3
+ **Since Camel 3.1**
4
+
5
+ **Both producer and consumer are supported**
6
+
7
+ The AWS2 SQS component supports sending and receiving messages to
8
+ [Amazon’s SQS](https://aws.amazon.com/sqs) service.
9
+
10
+ Prerequisites
11
+
12
+ You must have a valid Amazon Web Services developer account, and be
13
+ signed up to use Amazon SQS. More information is available at [Amazon
14
+ SQS](https://aws.amazon.com/sqs).
15
+
16
+ # URI Format
17
+
18
+ aws2-sqs://queueNameOrArn[?options]
19
+
20
+ The queue will be created if they don’t already exist.
21
+
22
+ You can append query options to the URI in the following format:
23
+
24
+ `?options=value&option2=value&...`
25
+
26
+ Required SQS component options
27
+
28
+ You have to provide the amazonSQSClient in the Registry or your
29
+ accessKey and secretKey to access the [Amazon’s
30
+ SQS](https://aws.amazon.com/sqs).
31
+
32
+ # Batch Consumer
33
+
34
+ This component implements the Batch Consumer.
35
+
36
+ This allows you, for instance, to know how many messages exist in this
37
+ batch and for instance, let the Aggregator aggregate this number of
38
+ messages.
39
+
40
+ # Usage
41
+
42
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
43
+
44
+ You have the possibility of avoiding the usage of explicit static
45
+ credentials by specifying the useDefaultCredentialsProvider option and
46
+ set it to true.
47
+
48
+ The order of evaluation for Default Credentials Provider is the
49
+ following:
50
+
51
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
52
+
53
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
54
+ `AWS_SECRET_ACCESS_KEY`.
55
+
56
+ - Web Identity Token from AWS STS.
57
+
58
+ - The shared credentials and config files.
59
+
60
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
61
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
62
+ set.
63
+
64
+ - Amazon EC2 Instance profile credentials.
65
+
66
+ You have also the possibility of using Profile Credentials Provider, by
67
+ specifying the useProfileCredentialsProvider option to true and
68
+ profileCredentialsName to the profile name.
69
+
70
+ Only one of static, default and profile credentials could be used at the
71
+ same time.
72
+
73
+ For more information about this you can look at [AWS credentials
74
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
75
+
76
+ ## Advanced AmazonSQS configuration
77
+
78
+ If your Camel Application is running behind a firewall or if you need to
79
+ have more control over the SqsClient instance configuration, you can
80
+ create your own instance, and configure Camel to use your instance by
81
+ the bean id.
82
+
83
+ In the example below, we use *myClient* as the bean id:
84
+
85
+ // crate my own instance of SqsClient
86
+ SqsClient sqs = ...
87
+
88
+ // register the client into Camel registry
89
+ camelContext.getRegistry().bind("myClient", sqs);
90
+
91
+ // refer to the custom client via myClient as the bean id
92
+ from("aws2-sqs://MyQueue?amazonSQSClient=#m4yClient&delay=5000&maxMessagesPerPoll=5")
93
+ .to("mock:result");
94
+
95
+ ## DelayQueue VS Delay for Single message
96
+
97
+ When the option delayQueue is set to true, the SQS Queue will be a
98
+ DelayQueue with the DelaySeconds option as delay. For more information
99
+ about DelayQueue you can read the [AWS SQS
100
+ documentation](https://docs.aws.amazon.com/en_us/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-delay-queues.html).
101
+ One important information to take into account is the following:
102
+
103
+ - For standard queues, the per-queue delay setting is not
104
+ retroactively—changing the setting doesn’t affect the delay of
105
+ messages already in the queue.
106
+
107
+ - For FIFO queues, the per-queue delay setting is
108
+ retroactively—changing the setting affects the delay of messages
109
+ already in the queue.
110
+
111
+ as stated in the official documentation. If you want to specify a delay
112
+ on single messages, you can ignore the delayQueue option, while you can
113
+ set this option to true if you need to add a fixed delay to all messages
114
+ enqueued.
115
+
116
+ ## Server Side Encryption
117
+
118
+ There is a set of Server Side Encryption attributes for a queue. The
119
+ related option are: `serverSideEncryptionEnabled`, `keyMasterKeyId` and
120
+ `kmsDataKeyReusePeriod`. The SSE is disabled by default. You need to
121
+ explicitly set the option to true and set the related parameters as
122
+ queue attributes.
123
+
124
+ # JMS-style Selectors
125
+
126
+ SQS does not allow selectors, but you can effectively achieve this by
127
+ using the Camel Filter EIP and setting an appropriate
128
+ `visibilityTimeout`. When SQS dispatches a message, it will wait up to
129
+ the visibility timeout before it tries to dispatch the message to a
130
+ different consumer unless a DeleteMessage is received. By default, Camel
131
+ will always send the DeleteMessage at the end of the route, unless the
132
+ route ended in failure. To achieve appropriate filtering and not send
133
+ the DeleteMessage even on successful completion of the route, use a
134
+ Filter:
135
+
136
+ from("aws2-sqs://MyQueue?amazonSQSClient=#client&defaultVisibilityTimeout=5000&deleteIfFiltered=false&deleteAfterRead=false")
137
+ .filter("${header.login} == true")
138
+ .setProperty(Sqs2Constants.SQS_DELETE_FILTERED, constant(true))
139
+ .to("mock:filter");
140
+
141
+ In the above code, if an exchange doesn’t have an appropriate header, it
142
+ will not make it through the filter AND also not be deleted from the SQS
143
+ queue. After 5000 milliseconds, the message will become visible to other
144
+ consumers.
145
+
146
+ Note we must set the property `Sqs2Constants.SQS_DELETE_FILTERED` to
147
+ `true` to instruct Camel to send the DeleteMessage, if being filtered.
148
+
149
+ # Available Producer Operations
150
+
151
+ - single message (default)
152
+
153
+ - sendBatchMessage
154
+
155
+ - deleteMessage
156
+
157
+ - listQueues
158
+
159
+ # Send Message
160
+
161
+ from("direct:start")
162
+ .setBody(constant("Camel rocks!"))
163
+ .to("aws2-sqs://camel-1?accessKey=RAW(xxx)&secretKey=RAW(xxx)&region=eu-west-1");
164
+
165
+ # Send Batch Message
166
+
167
+ You can set a `SendMessageBatchRequest` or an `Iterable`
168
+
169
+ from("direct:start")
170
+ .setHeader(SqsConstants.SQS_OPERATION, constant("sendBatchMessage"))
171
+ .process(new Processor() {
172
+ @Override
173
+ public void process(Exchange exchange) throws Exception {
174
+ List c = new ArrayList();
175
+ c.add("team1");
176
+ c.add("team2");
177
+ c.add("team3");
178
+ c.add("team4");
179
+ exchange.getIn().setBody(c);
180
+ }
181
+ })
182
+ .to("aws2-sqs://camel-1?accessKey=RAW(xxx)&secretKey=RAW(xxx)&region=eu-west-1");
183
+
184
+ As result, you’ll get an exchange containing a
185
+ `SendMessageBatchResponse` instance, that you can examine to check what
186
+ messages were successful and what not. The id set on each message of the
187
+ batch will be a Random UUID.
188
+
189
+ # Delete single Message
190
+
191
+ Use deleteMessage operation to delete a single message. You’ll need to
192
+ set a receipt handle header for the message you want to delete.
193
+
194
+ from("direct:start")
195
+ .setHeader(SqsConstants.SQS_OPERATION, constant("deleteMessage"))
196
+ .setHeader(SqsConstants.RECEIPT_HANDLE, constant("123456"))
197
+ .to("aws2-sqs://camel-1?accessKey=RAW(xxx)&secretKey=RAW(xxx)&region=eu-west-1");
198
+
199
+ As result, you’ll get an exchange containing a `DeleteMessageResponse`
200
+ instance, that you can use to check if the message was deleted or not.
201
+
202
+ # List Queues
203
+
204
+ Use listQueues operation to list queues.
205
+
206
+ from("direct:start")
207
+ .setHeader(SqsConstants.SQS_OPERATION, constant("listQueues"))
208
+ .to("aws2-sqs://camel-1?accessKey=RAW(xxx)&secretKey=RAW(xxx)&region=eu-west-1");
209
+
210
+ As result, you’ll get an exchange containing a `ListQueuesResponse`
211
+ instance, that you can examine to check the actual queues.
212
+
213
+ # Purge Queue
214
+
215
+ Use purgeQueue operation to purge queue.
216
+
217
+ from("direct:start")
218
+ .setHeader(SqsConstants.SQS_OPERATION, constant("purgeQueue"))
219
+ .to("aws2-sqs://camel-1?accessKey=RAW(xxx)&secretKey=RAW(xxx)&region=eu-west-1");
220
+
221
+ As result you’ll get an exchange containing a `PurgeQueueResponse`
222
+ instance.
223
+
224
+ # Queue Auto-creation
225
+
226
+ With the option `autoCreateQueue` users are able to avoid the
227
+ autocreation of an SQS Queue in case it doesn’t exist. The default for
228
+ this option is `false`. If set to *false*, any operation on a
229
+ non-existent queue in AWS won’t be successful and an error will be
230
+ returned.
231
+
232
+ # Send Batch Message and Message Deduplication Strategy
233
+
234
+ In case you’re using a SendBatchMessage Operation, you can set two
235
+ different kinds of Message Deduplication Strategy: - useExchangeId -
236
+ useContentBasedDeduplication
237
+
238
+ The first one will use a ExchangeIdMessageDeduplicationIdStrategy, that
239
+ will use the Exchange ID as parameter The other one will use a
240
+ NullMessageDeduplicationIdStrategy, that will use the body as a
241
+ deduplication element.
242
+
243
+ In case of send batch message operation, you’ll need to use the
244
+ `useContentBasedDeduplication` and on the Queue you’re pointing you’ll
245
+ need to enable the `content based deduplication` option.
246
+
247
+ # Dependencies
248
+
249
+ Maven users will need to add the following dependency to their pom.xml.
250
+
251
+ **pom.xml**
252
+
253
+ <dependency>
254
+ <groupId>org.apache.camel</groupId>
255
+ <artifactId>camel-aws2-sqs</artifactId>
256
+ <version>${camel-version}</version>
257
+ </dependency>
258
+
259
+ where `${camel-version}` must be replaced by the actual version of
260
+ Camel.
261
+
262
+ ## Component Configurations
263
+
264
+
265
+ |Name|Description|Default|Type|
266
+ |---|---|---|---|
267
+ |amazonAWSHost|The hostname of the Amazon AWS cloud.|amazonaws.com|string|
268
+ |autoCreateQueue|Setting the auto-creation of the queue|false|boolean|
269
+ |configuration|The AWS SQS default configuration||object|
270
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
271
+ |protocol|The underlying protocol used to communicate with SQS|https|string|
272
+ |queueOwnerAWSAccountId|Specify the queue owner aws account id when you need to connect the queue with a different account owner.||string|
273
+ |region|The region in which SQS client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
274
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
275
+ |attributeNames|A list of attribute names to receive when consuming. Multiple names can be separated by comma.||string|
276
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
277
+ |concurrentConsumers|Allows you to use multiple threads to poll the sqs queue to increase throughput|1|integer|
278
+ |defaultVisibilityTimeout|The default visibility timeout (in seconds)||integer|
279
+ |deleteAfterRead|Delete message from SQS after it has been read|true|boolean|
280
+ |deleteIfFiltered|Whether to send the DeleteMessage to the SQS queue if the exchange has property with key Sqs2Constants#SQS\_DELETE\_FILTERED (CamelAwsSqsDeleteFiltered) set to true.|true|boolean|
281
+ |extendMessageVisibility|If enabled, then a scheduled background task will keep extending the message visibility on SQS. This is needed if it takes a long time to process the message. If set to true defaultVisibilityTimeout must be set. See details at Amazon docs.|false|boolean|
282
+ |kmsDataKeyReusePeriodSeconds|The length of time, in seconds, for which Amazon SQS can reuse a data key to encrypt or decrypt messages before calling AWS KMS again. An integer representing seconds, between 60 seconds (1 minute) and 86,400 seconds (24 hours). Default: 300 (5 minutes).||integer|
283
+ |kmsMasterKeyId|The ID of an AWS-managed customer master key (CMK) for Amazon SQS or a custom CMK.||string|
284
+ |messageAttributeNames|A list of message attribute names to receive when consuming. Multiple names can be separated by comma.||string|
285
+ |serverSideEncryptionEnabled|Define if Server Side Encryption is enabled or not on the queue|false|boolean|
286
+ |visibilityTimeout|The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a ReceiveMessage request to set in the com.amazonaws.services.sqs.model.SetQueueAttributesRequest. This only makes sense if it's different from defaultVisibilityTimeout. It changes the queue visibility timeout attribute permanently.||integer|
287
+ |waitTimeSeconds|Duration in seconds (0 to 20) that the ReceiveMessage action call will wait until a message is in the queue to include in the response.||integer|
288
+ |batchSeparator|Set the separator when passing a String to send batch message operation|,|string|
289
+ |delaySeconds|Delay sending messages for a number of seconds.||integer|
290
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
291
+ |messageDeduplicationIdStrategy|Only for FIFO queues. Strategy for setting the messageDeduplicationId on the message. It can be one of the following options: useExchangeId, useContentBasedDeduplication. For the useContentBasedDeduplication option, no messageDeduplicationId will be set on the message.|useExchangeId|string|
292
+ |messageGroupIdStrategy|Only for FIFO queues. Strategy for setting the messageGroupId on the message. It can be one of the following options: useConstant, useExchangeId, usePropertyValue. For the usePropertyValue option, the value of property CamelAwsMessageGroupId will be used.||string|
293
+ |messageHeaderExceededLimit|What to do if sending to AWS SQS has more messages than AWS allows (currently only maximum 10 message headers are allowed). WARN will log a WARN about the limit is for each additional header, so the message can be sent to AWS. WARN\_ONCE will only log one time a WARN about the limit is hit, and drop additional headers, so the message can be sent to AWS. IGNORE will ignore (no logging) and drop additional headers, so the message can be sent to AWS. FAIL will cause an exception to be thrown and the message is not sent to AWS.|WARN|string|
294
+ |operation|The operation to do in case the user don't want to send only a message||object|
295
+ |amazonSQSClient|To use the AmazonSQS client||object|
296
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
297
+ |delayQueue|Define if you want to apply delaySeconds option to the queue or on single messages|false|boolean|
298
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
299
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
300
+ |proxyHost|To define a proxy host when instantiating the SQS client||string|
301
+ |proxyPort|To define a proxy port when instantiating the SQS client||integer|
302
+ |proxyProtocol|To define a proxy protocol when instantiating the SQS client|HTTPS|object|
303
+ |maximumMessageSize|The maximumMessageSize (in bytes) an SQS message can contain for this queue.||integer|
304
+ |messageRetentionPeriod|The messageRetentionPeriod (in seconds) a message will be retained by SQS for this queue.||integer|
305
+ |policy|The policy for this queue. It can be loaded by default from classpath, but you can prefix with classpath:, file:, or http: to load the resource from different systems.||string|
306
+ |queueUrl|To define the queueUrl explicitly. All other parameters, which would influence the queueUrl, are ignored. This parameter is intended to be used to connect to a mock implementation of SQS, for testing purposes.||string|
307
+ |receiveMessageWaitTimeSeconds|If you do not specify WaitTimeSeconds in the request, the queue attribute ReceiveMessageWaitTimeSeconds is used to determine how long to wait.||integer|
308
+ |redrivePolicy|Specify the policy that send message to DeadLetter queue. See detail at Amazon docs.||string|
309
+ |accessKey|Amazon AWS Access Key||string|
310
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
311
+ |secretKey|Amazon AWS Secret Key||string|
312
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
313
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
314
+ |useDefaultCredentialsProvider|Set whether the SQS client should expect to load credentials on an AWS infra instance or to expect static credentials to be passed in.|false|boolean|
315
+ |useProfileCredentialsProvider|Set whether the SQS client should expect to load credentials through a profile credentials provider.|false|boolean|
316
+ |useSessionCredentials|Set whether the SQS client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in SQS.|false|boolean|
317
+
318
+ ## Endpoint Configurations
319
+
320
+
321
+ |Name|Description|Default|Type|
322
+ |---|---|---|---|
323
+ |queueNameOrArn|Queue name or ARN||string|
324
+ |amazonAWSHost|The hostname of the Amazon AWS cloud.|amazonaws.com|string|
325
+ |autoCreateQueue|Setting the auto-creation of the queue|false|boolean|
326
+ |headerFilterStrategy|To use a custom HeaderFilterStrategy to map headers to/from Camel.||object|
327
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
328
+ |protocol|The underlying protocol used to communicate with SQS|https|string|
329
+ |queueOwnerAWSAccountId|Specify the queue owner aws account id when you need to connect the queue with a different account owner.||string|
330
+ |region|The region in which SQS client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
331
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
332
+ |attributeNames|A list of attribute names to receive when consuming. Multiple names can be separated by comma.||string|
333
+ |concurrentConsumers|Allows you to use multiple threads to poll the sqs queue to increase throughput|1|integer|
334
+ |defaultVisibilityTimeout|The default visibility timeout (in seconds)||integer|
335
+ |deleteAfterRead|Delete message from SQS after it has been read|true|boolean|
336
+ |deleteIfFiltered|Whether to send the DeleteMessage to the SQS queue if the exchange has property with key Sqs2Constants#SQS\_DELETE\_FILTERED (CamelAwsSqsDeleteFiltered) set to true.|true|boolean|
337
+ |extendMessageVisibility|If enabled, then a scheduled background task will keep extending the message visibility on SQS. This is needed if it takes a long time to process the message. If set to true defaultVisibilityTimeout must be set. See details at Amazon docs.|false|boolean|
338
+ |kmsDataKeyReusePeriodSeconds|The length of time, in seconds, for which Amazon SQS can reuse a data key to encrypt or decrypt messages before calling AWS KMS again. An integer representing seconds, between 60 seconds (1 minute) and 86,400 seconds (24 hours). Default: 300 (5 minutes).||integer|
339
+ |kmsMasterKeyId|The ID of an AWS-managed customer master key (CMK) for Amazon SQS or a custom CMK.||string|
340
+ |maxMessagesPerPoll|Gets the maximum number of messages as a limit to poll at each polling. Is default unlimited, but use 0 or negative number to disable it as unlimited.||integer|
341
+ |messageAttributeNames|A list of message attribute names to receive when consuming. Multiple names can be separated by comma.||string|
342
+ |sendEmptyMessageWhenIdle|If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead.|false|boolean|
343
+ |serverSideEncryptionEnabled|Define if Server Side Encryption is enabled or not on the queue|false|boolean|
344
+ |visibilityTimeout|The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a ReceiveMessage request to set in the com.amazonaws.services.sqs.model.SetQueueAttributesRequest. This only makes sense if it's different from defaultVisibilityTimeout. It changes the queue visibility timeout attribute permanently.||integer|
345
+ |waitTimeSeconds|Duration in seconds (0 to 20) that the ReceiveMessage action call will wait until a message is in the queue to include in the response.||integer|
346
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
347
+ |exceptionHandler|To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.||object|
348
+ |exchangePattern|Sets the exchange pattern when the consumer creates an exchange.||object|
349
+ |pollStrategy|A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel.||object|
350
+ |batchSeparator|Set the separator when passing a String to send batch message operation|,|string|
351
+ |delaySeconds|Delay sending messages for a number of seconds.||integer|
352
+ |messageDeduplicationIdStrategy|Only for FIFO queues. Strategy for setting the messageDeduplicationId on the message. It can be one of the following options: useExchangeId, useContentBasedDeduplication. For the useContentBasedDeduplication option, no messageDeduplicationId will be set on the message.|useExchangeId|string|
353
+ |messageGroupIdStrategy|Only for FIFO queues. Strategy for setting the messageGroupId on the message. It can be one of the following options: useConstant, useExchangeId, usePropertyValue. For the usePropertyValue option, the value of property CamelAwsMessageGroupId will be used.||string|
354
+ |messageHeaderExceededLimit|What to do if sending to AWS SQS has more messages than AWS allows (currently only maximum 10 message headers are allowed). WARN will log a WARN about the limit is for each additional header, so the message can be sent to AWS. WARN\_ONCE will only log one time a WARN about the limit is hit, and drop additional headers, so the message can be sent to AWS. IGNORE will ignore (no logging) and drop additional headers, so the message can be sent to AWS. FAIL will cause an exception to be thrown and the message is not sent to AWS.|WARN|string|
355
+ |operation|The operation to do in case the user don't want to send only a message||object|
356
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
357
+ |amazonSQSClient|To use the AmazonSQS client||object|
358
+ |delayQueue|Define if you want to apply delaySeconds option to the queue or on single messages|false|boolean|
359
+ |proxyHost|To define a proxy host when instantiating the SQS client||string|
360
+ |proxyPort|To define a proxy port when instantiating the SQS client||integer|
361
+ |proxyProtocol|To define a proxy protocol when instantiating the SQS client|HTTPS|object|
362
+ |maximumMessageSize|The maximumMessageSize (in bytes) an SQS message can contain for this queue.||integer|
363
+ |messageRetentionPeriod|The messageRetentionPeriod (in seconds) a message will be retained by SQS for this queue.||integer|
364
+ |policy|The policy for this queue. It can be loaded by default from classpath, but you can prefix with classpath:, file:, or http: to load the resource from different systems.||string|
365
+ |queueUrl|To define the queueUrl explicitly. All other parameters, which would influence the queueUrl, are ignored. This parameter is intended to be used to connect to a mock implementation of SQS, for testing purposes.||string|
366
+ |receiveMessageWaitTimeSeconds|If you do not specify WaitTimeSeconds in the request, the queue attribute ReceiveMessageWaitTimeSeconds is used to determine how long to wait.||integer|
367
+ |redrivePolicy|Specify the policy that send message to DeadLetter queue. See detail at Amazon docs.||string|
368
+ |backoffErrorThreshold|The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in.||integer|
369
+ |backoffIdleThreshold|The number of subsequent idle polls that should happen before the backoffMultipler should kick-in.||integer|
370
+ |backoffMultiplier|To let the scheduled polling consumer backoff if there has been a number of subsequent idles/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and/or backoffErrorThreshold must also be configured.||integer|
371
+ |delay|Milliseconds before the next poll.|500|integer|
372
+ |greedy|If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages.|false|boolean|
373
+ |initialDelay|Milliseconds before the first poll starts.|1000|integer|
374
+ |repeatCount|Specifies a maximum limit of number of fires. So if you set it to 1, the scheduler will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever.|0|integer|
375
+ |runLoggingLevel|The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that.|TRACE|object|
376
+ |scheduledExecutorService|Allows for configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool.||object|
377
+ |scheduler|To use a cron scheduler from either camel-spring or camel-quartz component. Use value spring or quartz for built in scheduler|none|object|
378
+ |schedulerProperties|To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler.||object|
379
+ |startScheduler|Whether the scheduler should be auto started.|true|boolean|
380
+ |timeUnit|Time unit for initialDelay and delay options.|MILLISECONDS|object|
381
+ |useFixedDelay|Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details.|true|boolean|
382
+ |accessKey|Amazon AWS Access Key||string|
383
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
384
+ |secretKey|Amazon AWS Secret Key||string|
385
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
386
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
387
+ |useDefaultCredentialsProvider|Set whether the SQS client should expect to load credentials on an AWS infra instance or to expect static credentials to be passed in.|false|boolean|
388
+ |useProfileCredentialsProvider|Set whether the SQS client should expect to load credentials through a profile credentials provider.|false|boolean|
389
+ |useSessionCredentials|Set whether the SQS client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in SQS.|false|boolean|
camel-aws2-step-functions.md ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws2-step-functions
2
+
3
+ **Since Camel 4.0**
4
+
5
+ **Only producer is supported**
6
+
7
+ The AWS2 Step Functions component supports the following operations on
8
+ [AWS Step Functions](https://aws.amazon.com/step-functions/):
9
+
10
+ - Create, delete, update, describe, list state machines.
11
+
12
+ - Create, delete, describe, list activities.
13
+
14
+ - Start, start sync, stop, list, describe executions.
15
+
16
+ - Get activities task.
17
+
18
+ - Get execution history
19
+
20
+ Prerequisites
21
+
22
+ You must have a valid Amazon Web Services developer account, and be
23
+ signed up to use Amazon Step Functions. More information is available at
24
+ [AWS Step Functions](https://aws.amazon.com/step-functions/).
25
+
26
+ # URI Format
27
+
28
+ aws2-step-functions://label[?options]
29
+
30
+ You can append query options to the URI in the following format:
31
+
32
+ `?options=value&option2=value&...`
33
+
34
+ Required Step Functions component options
35
+
36
+ You have to provide the awsSfnClient in the Registry or your accessKey
37
+ and secretKey to access the [AWS Step
38
+ Functions](https://aws.amazon.com/step-functions/) service.
39
+
40
+ # Usage
41
+
42
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
43
+
44
+ You have the possibility of avoiding the usage of explicit static
45
+ credentials by specifying the useDefaultCredentialsProvider option and
46
+ set it to true.
47
+
48
+ The order of evaluation for Default Credentials Provider is the
49
+ following:
50
+
51
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
52
+
53
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
54
+ `AWS_SECRET_ACCESS_KEY`.
55
+
56
+ - Web Identity Token from AWS STS.
57
+
58
+ - The shared credentials and config files.
59
+
60
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
61
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
62
+ set.
63
+
64
+ - Amazon EC2 Instance profile credentials.
65
+
66
+ You have also the possibility of using Profile Credentials Provider, by
67
+ specifying the useProfileCredentialsProvider option to true and
68
+ profileCredentialsName to the profile name.
69
+
70
+ Only one of static, default and profile credentials could be used at the
71
+ same time.
72
+
73
+ For more information about this you can look at [AWS credentials
74
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
75
+
76
+ ## Step Functions Producer operations
77
+
78
+ Camel-AWS Step Functions component provides the following operation on
79
+ the producer side:
80
+
81
+ - createStateMachine
82
+
83
+ - deleteStateMachine
84
+
85
+ - updateStateMachine
86
+
87
+ - describeStateMachine
88
+
89
+ - listStateMachines
90
+
91
+ - createActivity
92
+
93
+ - deleteActivity
94
+
95
+ - describeActivity
96
+
97
+ - getActivityTask
98
+
99
+ - listActivities
100
+
101
+ - startExecution
102
+
103
+ - startSyncExecution
104
+
105
+ - stopExecution
106
+
107
+ - describeExecution
108
+
109
+ - listExecutions
110
+
111
+ - getExecutionHistory
112
+
113
+ # Producer Examples
114
+
115
+ - createStateMachine: this operation will create a state machine
116
+
117
+ <!-- -->
118
+
119
+ from("direct:createStateMachine")
120
+ .to("aws2-step-functions://test?awsSfnClient=#awsSfnClient&operation=createMachine")
121
+
122
+ # Using a POJO as body
123
+
124
+ Sometimes building an AWS Request can be complex because of multiple
125
+ options. We introduce the possibility to use a POJO as the body. In AWS
126
+ Step Functions, there are multiple operations you can submit, as an
127
+ example for Create state machine request, you can do something like:
128
+
129
+ from("direct:start")
130
+ .setBody(CreateStateMachineRequest.builder().name("state-machine").build())
131
+ .to("aws2-step-functions://test?awsSfnClient=#awsSfnClient&operation=createStateMachine&pojoRequest=true")
132
+
133
+ In this way, you’ll pass the request directly without the need of
134
+ passing headers and options specifically related to this operation.
135
+
136
+ # Dependencies
137
+
138
+ Maven users will need to add the following dependency to their pom.xml.
139
+
140
+ **pom.xml**
141
+
142
+ <dependency>
143
+ <groupId>org.apache.camel</groupId>
144
+ <artifactId>camel-aws2-step-functions</artifactId>
145
+ <version>${camel-version}</version>
146
+ </dependency>
147
+
148
+ where `${camel-version}` must be replaced by the actual version of
149
+ Camel.
150
+
151
+ ## Component Configurations
152
+
153
+
154
+ |Name|Description|Default|Type|
155
+ |---|---|---|---|
156
+ |configuration|Component configuration||object|
157
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
158
+ |operation|The operation to perform. It can be listFunctions, getFunction, createFunction, deleteFunction or invokeFunction||object|
159
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
160
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
161
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
162
+ |region|The region in which StepFunctions client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
163
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
164
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
165
+ |useDefaultCredentialsProvider|Set whether the StepFunctions client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
166
+ |useProfileCredentialsProvider|Set whether the StepFunctions client should expect to load credentials through a profile credentials provider.|false|boolean|
167
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
168
+ |awsSfnClient|To use an existing configured AwsStepFunctionsClient client||object|
169
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
170
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
171
+ |proxyHost|To define a proxy host when instantiating the StepFunctions client||string|
172
+ |proxyPort|To define a proxy port when instantiating the StepFunctions client||integer|
173
+ |proxyProtocol|To define a proxy protocol when instantiating the StepFunctions client|HTTPS|object|
174
+ |accessKey|Amazon AWS Access Key||string|
175
+ |secretKey|Amazon AWS Secret Key||string|
176
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
177
+ |useSessionCredentials|Set whether the Step Functions client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in Step Functions.|false|boolean|
178
+
179
+ ## Endpoint Configurations
180
+
181
+
182
+ |Name|Description|Default|Type|
183
+ |---|---|---|---|
184
+ |label|Logical name||string|
185
+ |operation|The operation to perform. It can be listFunctions, getFunction, createFunction, deleteFunction or invokeFunction||object|
186
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
187
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
188
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
189
+ |region|The region in which StepFunctions client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
190
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
191
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
192
+ |useDefaultCredentialsProvider|Set whether the StepFunctions client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
193
+ |useProfileCredentialsProvider|Set whether the StepFunctions client should expect to load credentials through a profile credentials provider.|false|boolean|
194
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
195
+ |awsSfnClient|To use an existing configured AwsStepFunctionsClient client||object|
196
+ |proxyHost|To define a proxy host when instantiating the StepFunctions client||string|
197
+ |proxyPort|To define a proxy port when instantiating the StepFunctions client||integer|
198
+ |proxyProtocol|To define a proxy protocol when instantiating the StepFunctions client|HTTPS|object|
199
+ |accessKey|Amazon AWS Access Key||string|
200
+ |secretKey|Amazon AWS Secret Key||string|
201
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
202
+ |useSessionCredentials|Set whether the Step Functions client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in Step Functions.|false|boolean|
camel-aws2-sts.md ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws2-sts
2
+
3
+ **Since Camel 3.5**
4
+
5
+ **Only producer is supported**
6
+
7
+ The AWS2 STS component supports assumeRole operation. [AWS
8
+ STS](https://aws.amazon.com/sts/).
9
+
10
+ Prerequisites
11
+
12
+ You must have a valid Amazon Web Services developer account, and be
13
+ signed up to use Amazon STS. More information is available at [Amazon
14
+ STS](https://aws.amazon.com/sts/).
15
+
16
+ The AWS2 STS component works on the aws-global region, and it has
17
+ aws-global as the default region.
18
+
19
+ # URI Format
20
+
21
+ aws2-sts://label[?options]
22
+
23
+ You can append query options to the URI in the following format:
24
+
25
+ `?options=value&option2=value&...`
26
+
27
+ Required STS component options
28
+
29
+ You have to provide the amazonSTSClient in the Registry or your
30
+ accessKey and secretKey to access the [Amazon
31
+ STS](https://aws.amazon.com/sts/) service.
32
+
33
+ # Usage
34
+
35
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
36
+
37
+ You have the possibility of avoiding the usage of explicit static
38
+ credentials by specifying the useDefaultCredentialsProvider option and
39
+ set it to true.
40
+
41
+ The order of evaluation for Default Credentials Provider is the
42
+ following:
43
+
44
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
45
+
46
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
47
+ `AWS_SECRET_ACCESS_KEY`.
48
+
49
+ - Web Identity Token from AWS STS.
50
+
51
+ - The shared credentials and config files.
52
+
53
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
54
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
55
+ set.
56
+
57
+ - Amazon EC2 Instance profile credentials.
58
+
59
+ You have also the possibility of using Profile Credentials Provider, by
60
+ specifying the useProfileCredentialsProvider option to true and
61
+ profileCredentialsName to the profile name.
62
+
63
+ Only one of static, default and profile credentials could be used at the
64
+ same time.
65
+
66
+ For more information about this you can look at [AWS credentials
67
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
68
+
69
+ ## STS Producer operations
70
+
71
+ Camel-AWS STS component provides the following operation on the producer
72
+ side:
73
+
74
+ - assumeRole
75
+
76
+ - getSessionToken
77
+
78
+ - getFederationToken
79
+
80
+ # Producer Examples
81
+
82
+ - assumeRole: this operation will make an AWS user assume a different
83
+ role temporary
84
+
85
+ <!-- -->
86
+
87
+ from("direct:assumeRole")
88
+ .setHeader(STS2Constants.ROLE_ARN, constant("arn:123"))
89
+ .setHeader(STS2Constants.ROLE_SESSION_NAME, constant("groot"))
90
+ .to("aws2-sts://test?stsClient=#amazonSTSClient&operation=assumeRole")
91
+
92
+ - getSessionToken: this operation will return a temporary session
93
+ token
94
+
95
+ <!-- -->
96
+
97
+ from("direct:getSessionToken")
98
+ .to("aws2-sts://test?stsClient=#amazonSTSClient&operation=getSessionToken")
99
+
100
+ - getFederationToken: this operation will return a temporary
101
+ federation token
102
+
103
+ <!-- -->
104
+
105
+ from("direct:getFederationToken")
106
+ .setHeader(STS2Constants.FEDERATED_NAME, constant("federation-account"))
107
+ .to("aws2-sts://test?stsClient=#amazonSTSClient&operation=getSessionToken")
108
+
109
+ # Using a POJO as body
110
+
111
+ Sometimes building an AWS Request can be complex because of multiple
112
+ options. We introduce the possibility to use a POJO as the body. In AWS
113
+ STS, as an example for Assume Role request, you can do something like:
114
+
115
+ from("direct:createUser")
116
+ .setBody(AssumeRoleRequest.builder().roleArn("arn:123").roleSessionName("groot").build())
117
+ .to("aws2-sts://test?stsClient=#amazonSTSClient&operation=assumeRole&pojoRequest=true")
118
+
119
+ In this way, you’ll pass the request directly without the need of
120
+ passing headers and options specifically related to this operation.
121
+
122
+ # Dependencies
123
+
124
+ Maven users will need to add the following dependency to their pom.xml.
125
+
126
+ **pom.xml**
127
+
128
+ <dependency>
129
+ <groupId>org.apache.camel</groupId>
130
+ <artifactId>camel-aws2-sts</artifactId>
131
+ <version>${camel-version}</version>
132
+ </dependency>
133
+
134
+ where `${camel-version}` must be replaced by the actual version of
135
+ Camel.
136
+
137
+ ## Component Configurations
138
+
139
+
140
+ |Name|Description|Default|Type|
141
+ |---|---|---|---|
142
+ |configuration|Component configuration||object|
143
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
144
+ |operation|The operation to perform|assumeRole|object|
145
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
146
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
147
+ |region|The region in which the STS client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()|aws-global|string|
148
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
149
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
150
+ |stsClient|To use an existing configured AWS STS client||object|
151
+ |proxyHost|To define a proxy host when instantiating the STS client||string|
152
+ |proxyPort|To define a proxy port when instantiating the STS client||integer|
153
+ |proxyProtocol|To define a proxy protocol when instantiating the STS client|HTTPS|object|
154
+ |accessKey|Amazon AWS Access Key||string|
155
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
156
+ |secretKey|Amazon AWS Secret Key||string|
157
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
158
+ |useDefaultCredentialsProvider|Set whether the STS client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
159
+ |useProfileCredentialsProvider|Set whether the STS client should expect to load credentials through a profile credentials provider.|false|boolean|
160
+
161
+ ## Endpoint Configurations
162
+
163
+
164
+ |Name|Description|Default|Type|
165
+ |---|---|---|---|
166
+ |label|Logical name||string|
167
+ |operation|The operation to perform|assumeRole|object|
168
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
169
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
170
+ |region|The region in which the STS client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()|aws-global|string|
171
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
172
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
173
+ |stsClient|To use an existing configured AWS STS client||object|
174
+ |proxyHost|To define a proxy host when instantiating the STS client||string|
175
+ |proxyPort|To define a proxy port when instantiating the STS client||integer|
176
+ |proxyProtocol|To define a proxy protocol when instantiating the STS client|HTTPS|object|
177
+ |accessKey|Amazon AWS Access Key||string|
178
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
179
+ |secretKey|Amazon AWS Secret Key||string|
180
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
181
+ |useDefaultCredentialsProvider|Set whether the STS client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
182
+ |useProfileCredentialsProvider|Set whether the STS client should expect to load credentials through a profile credentials provider.|false|boolean|
camel-aws2-timestream.md ADDED
@@ -0,0 +1,270 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws2-timestream
2
+
3
+ **Since Camel 4.1**
4
+
5
+ **Only producer is supported**
6
+
7
+ The AWS2 Timestream component supports the following operations on [AWS
8
+ Timestream](https://aws.amazon.com/timestream/):
9
+
10
+ - Write Operations
11
+
12
+ - Describe Write Endpoints
13
+
14
+ - Create, Describe, Resume, List Batch Load Tasks
15
+
16
+ - Create, Delete, Update, Describe, List Databases
17
+
18
+ - Create, Delete, Update, Describe, List Tables
19
+
20
+ - Write Records
21
+
22
+ - Query Operations
23
+
24
+ - Describe Query Endpoints
25
+
26
+ - Prepare Query, Query, Cancel Query
27
+
28
+ - Create, Delete, Execute, Update, Describe, List Scheduled
29
+ Queries
30
+
31
+ Prerequisites
32
+
33
+ You must have a valid Amazon Web Services developer account, and be
34
+ signed up to use Amazon Timestream. More information is available at
35
+ [AWS Timestream](https://aws.amazon.com/timestream/).
36
+
37
+ # URI Format
38
+
39
+ aws2-timestream://clientType:label[?options]
40
+
41
+ You can append query options to the URI in the following format:
42
+
43
+ `?options=value&option2=value&...`
44
+
45
+ Required Timestream component options
46
+
47
+ Based on the type of operation to be performed, the type of client
48
+ (write/query) needs to be provided as clientType URI path parameter
49
+
50
+ You have to provide either the awsTimestreamWriteClient(for write
51
+ operations) or awsTimestreamQueryClient(for query operations) in the
52
+ Registry or your accessKey and secretKey to access the [AWS
53
+ Timestream](https://aws.amazon.com/timestream/) service.
54
+
55
+ # Usage
56
+
57
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
58
+
59
+ You have the possibility of avoiding the usage of explicit static
60
+ credentials by specifying the useDefaultCredentialsProvider option and
61
+ set it to true.
62
+
63
+ The order of evaluation for Default Credentials Provider is the
64
+ following:
65
+
66
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`.
67
+
68
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
69
+ `AWS_SECRET_ACCESS_KEY`.
70
+
71
+ - Web Identity Token from AWS STS.
72
+
73
+ - The shared credentials and config files.
74
+
75
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
76
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
77
+ set.
78
+
79
+ - Amazon EC2 Instance profile credentials.
80
+
81
+ You have also the possibility of using Profile Credentials Provider, by
82
+ specifying the useProfileCredentialsProvider option to true and
83
+ profileCredentialsName to the profile name.
84
+
85
+ Only one of static, default and profile credentials could be used at the
86
+ same time.
87
+
88
+ For more information about this you can look at [AWS credentials
89
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
90
+
91
+ ## Timestream Producer operations
92
+
93
+ Camel-AWS Timestream component provides the following operation on the
94
+ producer side:
95
+
96
+ - Write Operations
97
+
98
+ - describeEndpoints
99
+
100
+ - createBatchLoadTask
101
+
102
+ - describeBatchLoadTask
103
+
104
+ - resumeBatchLoadTask
105
+
106
+ - listBatchLoadTasks
107
+
108
+ - createDatabase
109
+
110
+ - deleteDatabase
111
+
112
+ - describeDatabase
113
+
114
+ - updateDatabase
115
+
116
+ - listDatabases
117
+
118
+ - createTable
119
+
120
+ - deleteTable
121
+
122
+ - describeTable
123
+
124
+ - updateTable
125
+
126
+ - listTables
127
+
128
+ - writeRecords
129
+
130
+ - Query Operations
131
+
132
+ - describeEndpoints
133
+
134
+ - createScheduledQuery
135
+
136
+ - deleteScheduledQuery
137
+
138
+ - executeScheduledQuery
139
+
140
+ - updateScheduledQuery
141
+
142
+ - describeScheduledQuery
143
+
144
+ - listScheduledQueries
145
+
146
+ - prepareQuery
147
+
148
+ - query
149
+
150
+ - cancelQuery
151
+
152
+ # Producer Examples
153
+
154
+ - Write Operation
155
+
156
+ - createDatabase: this operation will create a timestream database
157
+
158
+ <!-- -->
159
+
160
+ from("direct:createDatabase")
161
+ .setHeader(Timestream2Constants.DATABASE_NAME, constant("testDb"))
162
+ .setHeader(Timestream2Constants.KMS_KEY_ID, constant("testKmsKey"))
163
+ .to("aws2-timestream://write:test?awsTimestreamWriteClient=#awsTimestreamWriteClient&operation=createDatabase")
164
+
165
+ - Query Operation
166
+
167
+ - query: this operation will execute a timestream query
168
+
169
+ <!-- -->
170
+
171
+ from("direct:query")
172
+ .setHeader(Timestream2Constants.QUERY_STRING, constant("SELECT * FROM testDb.testTable ORDER BY time DESC LIMIT 10"))
173
+ .to("aws2-timestream://query:test?awsTimestreamQueryClient=#awsTimestreamQueryClient&operation=query")
174
+
175
+ # Using a POJO as body
176
+
177
+ Sometimes building an AWS Request can be complex because of multiple
178
+ options. We introduce the possibility to use a POJO as the body. In AWS
179
+ Timestream there are multiple operations you can submit, as an example
180
+ for Create state machine request, you can do something like:
181
+
182
+ - Write Operation
183
+
184
+ - createDatabase: this operation will create a timestream database
185
+
186
+ <!-- -->
187
+
188
+ from("direct:start")
189
+ .setBody(CreateDatabaseRequest.builder().database(Database.builder().databaseName("testDb").kmsKeyId("testKmsKey").build()).build())
190
+ .to("aws2-timestream://write:test?awsTimestreamWriteClient=#awsTimestreamWriteClient&operation=createDatabase&pojoRequest=true")
191
+
192
+ - Query Operation
193
+
194
+ - query: this operation will execute a timestream query
195
+
196
+ <!-- -->
197
+
198
+ from("direct:query")
199
+ .setBody(QueryRequest.builder().queryString("SELECT * FROM testDb.testTable ORDER BY time DESC LIMIT 10").build())
200
+ .to("aws2-timestream://query:test?awsTimestreamQueryClient=#awsTimestreamQueryClient&operation=query&pojoRequest=true")
201
+
202
+ In this way, you’ll pass the request directly without the need of
203
+ passing headers and options specifically related to this operation.
204
+
205
+ # Dependencies
206
+
207
+ Maven users will need to add the following dependency to their pom.xml.
208
+
209
+ **pom.xml**
210
+
211
+ <dependency>
212
+ <groupId>org.apache.camel</groupId>
213
+ <artifactId>camel-aws2-timestream</artifactId>
214
+ <version>${camel-version}</version>
215
+ </dependency>
216
+
217
+ where `${camel-version}` must be replaced by the actual version of
218
+ Camel.
219
+
220
+ ## Component Configurations
221
+
222
+
223
+ |Name|Description|Default|Type|
224
+ |---|---|---|---|
225
+ |configuration|Component configuration||object|
226
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
227
+ |operation|The operation to perform. It can be describeEndpoints,createBatchLoadTask,describeBatchLoadTask, resumeBatchLoadTask,listBatchLoadTasks,createDatabase,deleteDatabase,describeDatabase,updateDatabase, listDatabases,createTable,deleteTable,describeTable,updateTable,listTables,writeRecords, createScheduledQuery,deleteScheduledQuery,executeScheduledQuery,updateScheduledQuery, describeScheduledQuery,listScheduledQueries,prepareQuery,query,cancelQuery||object|
228
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
229
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
230
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
231
+ |region|The region in which the Timestream client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
232
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
233
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
234
+ |useDefaultCredentialsProvider|Set whether the Timestream client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
235
+ |useProfileCredentialsProvider|Set whether the Timestream client should expect to load credentials through a profile credentials provider.|false|boolean|
236
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
237
+ |awsTimestreamQueryClient|To use an existing configured AwsTimestreamQueryClient client||object|
238
+ |awsTimestreamWriteClient|To use an existing configured AwsTimestreamWriteClient client||object|
239
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
240
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
241
+ |proxyHost|To define a proxy host when instantiating the Timestream client||string|
242
+ |proxyPort|To define a proxy port when instantiating the Timestream client||integer|
243
+ |proxyProtocol|To define a proxy protocol when instantiating the Timestream client|HTTPS|object|
244
+ |accessKey|Amazon AWS Access Key||string|
245
+ |secretKey|Amazon AWS Secret Key||string|
246
+
247
+ ## Endpoint Configurations
248
+
249
+
250
+ |Name|Description|Default|Type|
251
+ |---|---|---|---|
252
+ |clientType|Type of client - write/query||object|
253
+ |label|Logical name||string|
254
+ |operation|The operation to perform. It can be describeEndpoints,createBatchLoadTask,describeBatchLoadTask, resumeBatchLoadTask,listBatchLoadTasks,createDatabase,deleteDatabase,describeDatabase,updateDatabase, listDatabases,createTable,deleteTable,describeTable,updateTable,listTables,writeRecords, createScheduledQuery,deleteScheduledQuery,executeScheduledQuery,updateScheduledQuery, describeScheduledQuery,listScheduledQueries,prepareQuery,query,cancelQuery||object|
255
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
256
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
257
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
258
+ |region|The region in which the Timestream client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
259
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
260
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
261
+ |useDefaultCredentialsProvider|Set whether the Timestream client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
262
+ |useProfileCredentialsProvider|Set whether the Timestream client should expect to load credentials through a profile credentials provider.|false|boolean|
263
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
264
+ |awsTimestreamQueryClient|To use an existing configured AwsTimestreamQueryClient client||object|
265
+ |awsTimestreamWriteClient|To use an existing configured AwsTimestreamWriteClient client||object|
266
+ |proxyHost|To define a proxy host when instantiating the Timestream client||string|
267
+ |proxyPort|To define a proxy port when instantiating the Timestream client||integer|
268
+ |proxyProtocol|To define a proxy protocol when instantiating the Timestream client|HTTPS|object|
269
+ |accessKey|Amazon AWS Access Key||string|
270
+ |secretKey|Amazon AWS Secret Key||string|
camel-aws2-translate.md ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Aws2-translate
2
+
3
+ **Since Camel 3.1**
4
+
5
+ **Only producer is supported**
6
+
7
+ The AWS2 Translate component supports translate a text in multiple
8
+ languages. [AWS Translate](https://aws.amazon.com/translate/) clusters
9
+ instances.
10
+
11
+ Prerequisites
12
+
13
+ You must have a valid Amazon Web Services developer account, and be
14
+ signed up to use Amazon Translate. More information is available at
15
+ [Amazon Translate](https://aws.amazon.com/translate/).
16
+
17
+ # URI Format
18
+
19
+ aws2-translate://label[?options]
20
+
21
+ You can append query options to the URI in the following format:
22
+
23
+ `?options=value&option2=value&...`
24
+
25
+ Required Translate component options
26
+
27
+ You have to provide the amazonTranslateClient in the Registry or your
28
+ accessKey and secretKey to access the [Amazon
29
+ Translate](https://aws.amazon.com/translate/) service.
30
+
31
+ # Usage
32
+
33
+ ## Static credentials, Default Credential Provider and Profile Credentials Provider
34
+
35
+ You have the possibility of avoiding the usage of explicit static
36
+ credentials by specifying the useDefaultCredentialsProvider option and
37
+ set it to true.
38
+
39
+ The order of evaluation for Default Credentials Provider is the
40
+ following:
41
+
42
+ - Java system properties - `aws.accessKeyId` and `aws.secretKey`
43
+
44
+ - Environment variables - `AWS_ACCESS_KEY_ID` and
45
+ `AWS_SECRET_ACCESS_KEY`.
46
+
47
+ - Web Identity Token from AWS STS.
48
+
49
+ - The shared credentials and config files.
50
+
51
+ - Amazon ECS container credentials - loaded from the Amazon ECS if the
52
+ environment variable `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI` is
53
+ set.
54
+
55
+ - Amazon EC2 Instance profile credentials.
56
+
57
+ You have also the possibility of using Profile Credentials Provider, by
58
+ specifying the useProfileCredentialsProvider option to true and
59
+ profileCredentialsName to the profile name.
60
+
61
+ Only one of static, default and profile credentials could be used at the
62
+ same time.
63
+
64
+ For more information about this you can look at [AWS credentials
65
+ documentation](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials.html)
66
+
67
+ ## Translate Producer operations
68
+
69
+ Camel-AWS Translate component provides the following operation on the
70
+ producer side:
71
+
72
+ - translateText
73
+
74
+ # Translate Text example
75
+
76
+ from("direct:start")
77
+ .setHeader(TranslateConstants.SOURCE_LANGUAGE, TranslateLanguageEnum.ITALIAN)
78
+ .setHeader(TranslateConstants.TARGET_LANGUAGE, TranslateLanguageEnum.GERMAN)
79
+ .setBody("Ciao")
80
+ .to("aws2-translate://test?translateClient=#amazonTranslateClient&operation=translateText");
81
+
82
+ As a result, you’ll get an exchange containing the translated text.
83
+
84
+ # Using a POJO as body
85
+
86
+ Sometimes building an AWS Request can be complex because of multiple
87
+ options. We introduce the possibility to use a POJO as the body. In AWS
88
+ Translate, the only operation available is TranslateText, so you can do
89
+ something like:
90
+
91
+ from("direct:start")
92
+ .setBody(TranslateTextRequest.builder().sourceLanguageCode(Translate2LanguageEnum.ITALIAN.toString())
93
+ .targetLanguageCode(Translate2LanguageEnum.GERMAN.toString()).text("Ciao").build())
94
+ .to("aws2-translate://test?translateClient=#amazonTranslateClient&operation=translateText&pojoRequest=true");
95
+
96
+ In this way, you’ll pass the request directly without the need of
97
+ passing headers and options specifically related to this operation.
98
+
99
+ # Dependencies
100
+
101
+ Maven users will need to add the following dependency to their pom.xml.
102
+
103
+ **pom.xml**
104
+
105
+ <dependency>
106
+ <groupId>org.apache.camel</groupId>
107
+ <artifactId>camel-aws2-translate</artifactId>
108
+ <version>${camel-version}</version>
109
+ </dependency>
110
+
111
+ where `${camel-version}` must be replaced by the actual version of
112
+ Camel.
113
+
114
+ ## Component Configurations
115
+
116
+
117
+ |Name|Description|Default|Type|
118
+ |---|---|---|---|
119
+ |autodetectSourceLanguage|Being able to autodetect the source language|false|boolean|
120
+ |configuration|Component configuration||object|
121
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
122
+ |operation|The operation to perform|translateText|object|
123
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
124
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
125
+ |region|The region in which the Translate client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
126
+ |sourceLanguage|Source language to use||string|
127
+ |targetLanguage|Target language to use||string|
128
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
129
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
130
+ |translateClient|To use an existing configured AWS Translate client||object|
131
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
132
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
133
+ |proxyHost|To define a proxy host when instantiating the Translate client||string|
134
+ |proxyPort|To define a proxy port when instantiating the Translate client||integer|
135
+ |proxyProtocol|To define a proxy protocol when instantiating the Translate client|HTTPS|object|
136
+ |accessKey|Amazon AWS Access Key||string|
137
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
138
+ |secretKey|Amazon AWS Secret Key||string|
139
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
140
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
141
+ |useDefaultCredentialsProvider|Set whether the Translate client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
142
+ |useProfileCredentialsProvider|Set whether the Translate client should expect to load credentials through a profile credentials provider.|false|boolean|
143
+ |useSessionCredentials|Set whether the Translate client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in Translate.|false|boolean|
144
+
145
+ ## Endpoint Configurations
146
+
147
+
148
+ |Name|Description|Default|Type|
149
+ |---|---|---|---|
150
+ |label|Logical name||string|
151
+ |autodetectSourceLanguage|Being able to autodetect the source language|false|boolean|
152
+ |operation|The operation to perform|translateText|object|
153
+ |overrideEndpoint|Set the need for overriding the endpoint. This option needs to be used in combination with the uriEndpointOverride option|false|boolean|
154
+ |pojoRequest|If we want to use a POJO request as body or not|false|boolean|
155
+ |region|The region in which the Translate client needs to work. When using this parameter, the configuration will expect the lowercase name of the region (for example, ap-east-1) You'll need to use the name Region.EU\_WEST\_1.id()||string|
156
+ |sourceLanguage|Source language to use||string|
157
+ |targetLanguage|Target language to use||string|
158
+ |uriEndpointOverride|Set the overriding uri endpoint. This option needs to be used in combination with overrideEndpoint option||string|
159
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
160
+ |translateClient|To use an existing configured AWS Translate client||object|
161
+ |proxyHost|To define a proxy host when instantiating the Translate client||string|
162
+ |proxyPort|To define a proxy port when instantiating the Translate client||integer|
163
+ |proxyProtocol|To define a proxy protocol when instantiating the Translate client|HTTPS|object|
164
+ |accessKey|Amazon AWS Access Key||string|
165
+ |profileCredentialsName|If using a profile credentials provider, this parameter will set the profile name||string|
166
+ |secretKey|Amazon AWS Secret Key||string|
167
+ |sessionToken|Amazon AWS Session Token used when the user needs to assume an IAM role||string|
168
+ |trustAllCertificates|If we want to trust all certificates in case of overriding the endpoint|false|boolean|
169
+ |useDefaultCredentialsProvider|Set whether the Translate client should expect to load credentials through a default credentials provider or to expect static credentials to be passed in.|false|boolean|
170
+ |useProfileCredentialsProvider|Set whether the Translate client should expect to load credentials through a profile credentials provider.|false|boolean|
171
+ |useSessionCredentials|Set whether the Translate client should expect to use Session Credentials. This is useful in a situation in which the user needs to assume an IAM role for doing operations in Translate.|false|boolean|
camel-azure-cosmosdb.md ADDED
@@ -0,0 +1,791 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Azure-cosmosdb
2
+
3
+ **Since Camel 3.10**
4
+
5
+ **Both producer and consumer are supported**
6
+
7
+ [Azure Cosmos DB](https://azure.microsoft.com/en-us/services/cosmos-db/)
8
+ is Microsoft’s globally distributed, multimodel database service for
9
+ operational and analytics workloads. It offers multi-mastering feature
10
+ by automatically scaling throughput, compute, and storage. This
11
+ component interacts with Azure CosmosDB through Azure SQL API.
12
+
13
+ Prerequisites
14
+
15
+ You must have a valid Windows Azure Storage account. More information is
16
+ available at [Azure Documentation
17
+ Portal](https://docs.microsoft.com/azure/).
18
+
19
+ <dependency>
20
+ <groupId>org.apache.camel</groupId>
21
+ <artifactId>camel-azure-cosmosdb</artifactId>
22
+ <version>x.x.x</version>
23
+ <!-- use the same version as your Camel core version -->
24
+ </dependency>
25
+
26
+ # URI Format
27
+
28
+ azure-cosmosdb://[databaseName][/containerName][?options]
29
+
30
+ In case of the consumer, `databaseName`, `containerName` are required,
31
+ In case of the producer, it depends on the operation that being
32
+ requested, for example if operation is on a database level, e.b:
33
+ deleteDatabase, only `databaseName` is required, but in case of
34
+ operation being requested in container level, e.g: readItem, then
35
+ `databaseName` and `containerName` are required.
36
+
37
+ You can append query options to the URI in the following format,
38
+ `?options=value&option2=value&`…
39
+
40
+ # Authentication Information
41
+
42
+ To use this component, you have two options to provide the required
43
+ Azure authentication information:
44
+
45
+ - Provide `accountKey` and `databaseEndpoint` for your Azure CosmosDB
46
+ account. The account key can be generated through your CosmosDB
47
+ Azure portal.
48
+
49
+ - Provide a
50
+ [CosmosAsyncClient](https://docs.microsoft.com/en-us/java/api/com.azure.cosmos.cosmosasyncclient?view=azure-java-stable)
51
+ instance which can be provided into `cosmosAsyncClient`.
52
+
53
+ # Async Consumer and Producer
54
+
55
+ This component implements the async Consumer and producer.
56
+
57
+ This allows camel route to consume and produce events asynchronously
58
+ without blocking any threads.
59
+
60
+ # Usage
61
+
62
+ For example, to consume records from a specific container in a specific
63
+ database to a file, use the following snippet:
64
+
65
+ from("azure-cosmosdb://camelDb/myContainer?accountKey=MyaccountKey&databaseEndpoint=https//myazure.com:443&leaseDatabaseName=myLeaseDB&createLeaseDatabaseIfNotExists=true&createLeaseContainerIfNotExists=true").
66
+ to("file://directory");
67
+
68
+ ## Message headers evaluated by the component producer
69
+
70
+ <table>
71
+ <colgroup>
72
+ <col style="width: 10%" />
73
+ <col style="width: 10%" />
74
+ <col style="width: 10%" />
75
+ <col style="width: 69%" />
76
+ </colgroup>
77
+ <thead>
78
+ <tr>
79
+ <th style="text-align: left;">Header</th>
80
+ <th style="text-align: left;">Variable Name</th>
81
+ <th style="text-align: left;">Type</th>
82
+ <th style="text-align: left;">Description</th>
83
+ </tr>
84
+ </thead>
85
+ <tbody>
86
+ <tr>
87
+ <td
88
+ style="text-align: left;"><p><code>CamelAzureCosmosDbDatabaseName</code></p></td>
89
+ <td
90
+ style="text-align: left;"><p><code>CosmosDbConstants.DATABASE_NAME</code></p></td>
91
+ <td style="text-align: left;"><p><code>String</code></p></td>
92
+ <td style="text-align: left;"><p>Overrides the database name which is
93
+ the name of the Cosmos database that component should connect to. In
94
+ case you are producing data and have createDatabaseIfNotExists=true, the
95
+ component will automatically auto create a Cosmos database.</p></td>
96
+ </tr>
97
+ <tr>
98
+ <td
99
+ style="text-align: left;"><p><code>CamelAzureCosmosDbContainerName</code></p></td>
100
+ <td
101
+ style="text-align: left;"><p><code>CosmosDbConstants.CONTAINER_NAME</code></p></td>
102
+ <td style="text-align: left;"><p><code>String</code></p></td>
103
+ <td style="text-align: left;"><p>Overrides the container name which is
104
+ the name of the Cosmos container that component should connect to. In
105
+ case you are producing data and have createContainerIfNotExists=true,
106
+ the component will automatically auto create a Cosmos
107
+ container.</p></td>
108
+ </tr>
109
+ <tr>
110
+ <td
111
+ style="text-align: left;"><p><code>CamelAzureCosmosDbOperation</code></p></td>
112
+ <td
113
+ style="text-align: left;"><p><code>CosmosDbConstants.OPERATION</code></p></td>
114
+ <td
115
+ style="text-align: left;"><p><code>CosmosDbOperationsDefinition</code></p></td>
116
+ <td style="text-align: left;"><p>Set the producer operation which can be
117
+ used to execute a specific operation on the producer.</p></td>
118
+ </tr>
119
+ <tr>
120
+ <td
121
+ style="text-align: left;"><p><code>CamelAzureCosmosDbQuery</code></p></td>
122
+ <td
123
+ style="text-align: left;"><p><code>CosmosDbConstants.QUERY</code></p></td>
124
+ <td style="text-align: left;"><p><code>String</code></p></td>
125
+ <td style="text-align: left;"><p>Set the SQL query to execute on a given
126
+ producer query operations.</p></td>
127
+ </tr>
128
+ <tr>
129
+ <td
130
+ style="text-align: left;"><p><code>CamelAzureCosmosDbQueryRequestOptions</code></p></td>
131
+ <td
132
+ style="text-align: left;"><p><code>CosmosDbConstants.QUERY_REQUEST_OPTIONS</code></p></td>
133
+ <td
134
+ style="text-align: left;"><p><code>CosmosQueryRequestOptions</code></p></td>
135
+ <td style="text-align: left;"><p>Set additional QueryRequestOptions that
136
+ can be used with queryItems, queryContainers, queryDatabases,
137
+ listDatabases, listItems, listContainers operations.</p></td>
138
+ </tr>
139
+ <tr>
140
+ <td
141
+ style="text-align: left;"><p><code>CamelAzureCosmosDbCreateDatabaseIfNotExist</code></p></td>
142
+ <td
143
+ style="text-align: left;"><p><code>CosmosDbConstants.CREATE_DATABASE_IF_NOT_EXIST</code></p></td>
144
+ <td style="text-align: left;"><p><code>boolean</code></p></td>
145
+ <td style="text-align: left;"><p>Sets if the component should create the
146
+ Cosmos database automatically in case it doesn’t exist in the Cosmos
147
+ account.</p></td>
148
+ </tr>
149
+ <tr>
150
+ <td
151
+ style="text-align: left;"><p><code>CamelAzureCosmosDbCreateContainerIfNotExist</code></p></td>
152
+ <td
153
+ style="text-align: left;"><p><code>CosmosDbConstants.CREATE_CONTAINER_IF_NOT_EXIST</code></p></td>
154
+ <td style="text-align: left;"><p><code>boolean</code></p></td>
155
+ <td style="text-align: left;"><p>Sets if the component should create
156
+ Cosmos container automatically in case it doesn’t exist in the Cosmos
157
+ account.</p></td>
158
+ </tr>
159
+ <tr>
160
+ <td
161
+ style="text-align: left;"><p><code>CamelAzureCosmosDbThroughputProperties</code></p></td>
162
+ <td
163
+ style="text-align: left;"><p><code>CosmosDbConstants.THROUGHPUT_PROPERTIES</code></p></td>
164
+ <td
165
+ style="text-align: left;"><p><code>ThroughputProperties</code></p></td>
166
+ <td style="text-align: left;"><p>Sets throughput of the resources in the
167
+ Azure Cosmos DB service.</p></td>
168
+ </tr>
169
+ <tr>
170
+ <td
171
+ style="text-align: left;"><p><code>CamelAzureCosmosDbDatabaseRequestOptions</code></p></td>
172
+ <td
173
+ style="text-align: left;"><p><code>CosmosDbConstants.DATABASE_REQUEST_OPTIONS</code></p></td>
174
+ <td
175
+ style="text-align: left;"><p><code>CosmosDatabaseRequestOptions</code></p></td>
176
+ <td style="text-align: left;"><p>Sets additional options to execute on
177
+ database operations.</p></td>
178
+ </tr>
179
+ <tr>
180
+ <td
181
+ style="text-align: left;"><p><code>CamelAzureCosmosDbContainerPartitionKeyPath</code></p></td>
182
+ <td
183
+ style="text-align: left;"><p><code>CosmosDbConstants.CONTAINER_PARTITION_KEY_PATH</code></p></td>
184
+ <td style="text-align: left;"><p><code>String</code></p></td>
185
+ <td style="text-align: left;"><p>Set the container partition key
186
+ path.</p></td>
187
+ </tr>
188
+ <tr>
189
+ <td
190
+ style="text-align: left;"><p><code>CamelAzureCosmosDbContainerRequestOptions</code></p></td>
191
+ <td
192
+ style="text-align: left;"><p><code>CosmosDbConstants.CONTAINER_REQUEST_OPTIONS</code></p></td>
193
+ <td
194
+ style="text-align: left;"><p><code>CosmosContainerRequestOptions</code></p></td>
195
+ <td style="text-align: left;"><p>Set additional options to execute on
196
+ container operations.</p></td>
197
+ </tr>
198
+ <tr>
199
+ <td
200
+ style="text-align: left;"><p><code>CamelAzureCosmosDbItemPartitionKey</code></p></td>
201
+ <td
202
+ style="text-align: left;"><p><code>CosmosDbConstants.ITEM_PARTITION_KEY</code></p></td>
203
+ <td style="text-align: left;"><p><code>String</code></p></td>
204
+ <td style="text-align: left;"><p>Set the partition key. Represents a
205
+ partition key value in the Azure Cosmos DB database service. A partition
206
+ key identifies the partition where the item is stored in.</p></td>
207
+ </tr>
208
+ <tr>
209
+ <td
210
+ style="text-align: left;"><p><code>CamelAzureCosmosDbItemRequestOptions</code></p></td>
211
+ <td
212
+ style="text-align: left;"><p><code>CosmosDbConstants.ITEM_REQUEST_OPTIONS</code></p></td>
213
+ <td
214
+ style="text-align: left;"><p><code>CosmosItemRequestOptions</code></p></td>
215
+ <td style="text-align: left;"><p>Set additional options to execute on
216
+ item operations.</p></td>
217
+ </tr>
218
+ <tr>
219
+ <td
220
+ style="text-align: left;"><p><code>CamelAzureCosmosDbItemId</code></p></td>
221
+ <td
222
+ style="text-align: left;"><p><code>CosmosDbConstants.ITEM_ID</code></p></td>
223
+ <td style="text-align: left;"><p><code>String</code></p></td>
224
+ <td style="text-align: left;"><p>Set the itemId in case needed for
225
+ operation on item like <em>delete</em>, <em>replace</em>.</p></td>
226
+ </tr>
227
+ </tbody>
228
+ </table>
229
+
230
+ ## Message headers set by the component producer
231
+
232
+ <table>
233
+ <colgroup>
234
+ <col style="width: 10%" />
235
+ <col style="width: 10%" />
236
+ <col style="width: 10%" />
237
+ <col style="width: 69%" />
238
+ </colgroup>
239
+ <thead>
240
+ <tr>
241
+ <th style="text-align: left;">Header</th>
242
+ <th style="text-align: left;">Variable Name</th>
243
+ <th style="text-align: left;">Type</th>
244
+ <th style="text-align: left;">Description</th>
245
+ </tr>
246
+ </thead>
247
+ <tbody>
248
+ <tr>
249
+ <td
250
+ style="text-align: left;"><p><code>CamelAzureCosmosDbRecourseId</code></p></td>
251
+ <td
252
+ style="text-align: left;"><p><code>CosmosDbConstants.RESOURCE_ID</code></p></td>
253
+ <td style="text-align: left;"><p><code>String</code></p></td>
254
+ <td style="text-align: left;"><p>The resource ID of the requested
255
+ resource.</p></td>
256
+ </tr>
257
+ <tr>
258
+ <td
259
+ style="text-align: left;"><p><code>CamelAzureCosmosDbEtag</code></p></td>
260
+ <td
261
+ style="text-align: left;"><p><code>CosmosDbConstants.E_TAG</code></p></td>
262
+ <td style="text-align: left;"><p><code>String</code></p></td>
263
+ <td style="text-align: left;"><p>The Etag ID of the requested
264
+ resource.</p></td>
265
+ </tr>
266
+ <tr>
267
+ <td
268
+ style="text-align: left;"><p><code>CamelAzureCosmosDbTimestamp</code></p></td>
269
+ <td
270
+ style="text-align: left;"><p><code>CosmosDbConstants.TIMESTAMP</code></p></td>
271
+ <td style="text-align: left;"><p><code>String</code></p></td>
272
+ <td style="text-align: left;"><p>The timestamp of the requested
273
+ resource.</p></td>
274
+ </tr>
275
+ <tr>
276
+ <td
277
+ style="text-align: left;"><p><code>CamelAzureCosmosDbResponseHeaders</code></p></td>
278
+ <td
279
+ style="text-align: left;"><p><code>CosmosDbConstants.RESPONSE_HEADERS</code></p></td>
280
+ <td style="text-align: left;"><p><code>Map</code></p></td>
281
+ <td style="text-align: left;"><p>The response headers of the requested
282
+ resource.</p></td>
283
+ </tr>
284
+ <tr>
285
+ <td
286
+ style="text-align: left;"><p><code>CamelAzureCosmosDbStatusCode</code></p></td>
287
+ <td
288
+ style="text-align: left;"><p><code>CosmosDbConstants.STATUS_CODE</code></p></td>
289
+ <td style="text-align: left;"><p><code>Integer</code></p></td>
290
+ <td style="text-align: left;"><p>The status code of the requested
291
+ resource.</p></td>
292
+ </tr>
293
+ <tr>
294
+ <td
295
+ style="text-align: left;"><p><code>CamelAzureCosmosDbDefaultTimeToLiveInSeconds</code></p></td>
296
+ <td
297
+ style="text-align: left;"><p><code>CosmosDbConstants.DEFAULT_TIME_TO_LIVE_SECONDS</code></p></td>
298
+ <td style="text-align: left;"><p><code>Integer</code></p></td>
299
+ <td style="text-align: left;"><p>The TTL of the requested
300
+ resource.</p></td>
301
+ </tr>
302
+ <tr>
303
+ <td
304
+ style="text-align: left;"><p><code>CamelAzureCosmosDbManualThroughput</code></p></td>
305
+ <td
306
+ style="text-align: left;"><p><code>CosmosDbConstants.MANUAL_THROUGHPUT</code></p></td>
307
+ <td style="text-align: left;"><p><code>Integer</code></p></td>
308
+ <td style="text-align: left;"><p>The manual throughput of the requested
309
+ resource.</p></td>
310
+ </tr>
311
+ <tr>
312
+ <td
313
+ style="text-align: left;"><p><code>CamelAzureCosmosDbAutoscaleMaxThroughput</code></p></td>
314
+ <td
315
+ style="text-align: left;"><p><code>CosmosDbConstants.AUTOSCALE_MAX_THROUGHPUT</code></p></td>
316
+ <td style="text-align: left;"><p><code>Integer</code></p></td>
317
+ <td style="text-align: left;"><p>The AutoscaleMaxThroughput of the
318
+ requested resource.</p></td>
319
+ </tr>
320
+ </tbody>
321
+ </table>
322
+
323
+ ## Azure CosmosDB Producer operations
324
+
325
+ Camel Azure CosmosDB component provides a wide range of operations on
326
+ the producer side:
327
+
328
+ **Operations on the service level**
329
+
330
+ For these operations, `databaseName` is **required** except for
331
+ `queryDatabases` and `listDatabases` operations.
332
+
333
+ <table>
334
+ <colgroup>
335
+ <col style="width: 10%" />
336
+ <col style="width: 89%" />
337
+ </colgroup>
338
+ <thead>
339
+ <tr>
340
+ <th style="text-align: left;">Operation</th>
341
+ <th style="text-align: left;">Description</th>
342
+ </tr>
343
+ </thead>
344
+ <tbody>
345
+ <tr>
346
+ <td style="text-align: left;"><p><code>listDatabases</code></p></td>
347
+ <td style="text-align: left;"><p>Gets a list of all databases as
348
+ <code>List&lt;CosmosDatabaseProperties&gt;</code> set in the exchange
349
+ message body.</p></td>
350
+ </tr>
351
+ <tr>
352
+ <td style="text-align: left;"><p><code>createDatabase</code></p></td>
353
+ <td style="text-align: left;"><p>Create a database in the specified
354
+ Azure CosmosDB account.</p></td>
355
+ </tr>
356
+ <tr>
357
+ <td style="text-align: left;"><p><code>queryDatabases</code></p></td>
358
+ <td style="text-align: left;"><p><strong><code>query</code> is
359
+ required</strong> Execute an SQL query against the service level in
360
+ order for example return only a small subset of the databases list. It
361
+ will set <code>List&lt;CosmosDatabaseProperties&gt;</code> set in the
362
+ exchange message body.</p></td>
363
+ </tr>
364
+ </tbody>
365
+ </table>
366
+
367
+ **Operations on the database level**
368
+
369
+ For these operations, `databaseName` is **required** for all operations
370
+ here and `containerName` only for `createContainer` and
371
+ `queryContainers`.
372
+
373
+ <table>
374
+ <colgroup>
375
+ <col style="width: 10%" />
376
+ <col style="width: 89%" />
377
+ </colgroup>
378
+ <thead>
379
+ <tr>
380
+ <th style="text-align: left;">Operation</th>
381
+ <th style="text-align: left;">Description</th>
382
+ </tr>
383
+ </thead>
384
+ <tbody>
385
+ <tr>
386
+ <td style="text-align: left;"><p><code>deleteDatabase</code></p></td>
387
+ <td style="text-align: left;"><p>Delete a database from the Azure
388
+ CosmosDB account.</p></td>
389
+ </tr>
390
+ <tr>
391
+ <td style="text-align: left;"><p><code>createContainer</code></p></td>
392
+ <td style="text-align: left;"><p>Create a container in the specified
393
+ Azure CosmosDB database.</p></td>
394
+ </tr>
395
+ <tr>
396
+ <td
397
+ style="text-align: left;"><p><code>replaceDatabaseThroughput</code></p></td>
398
+ <td style="text-align: left;"><p>Replace the throughput for the
399
+ specified Azure CosmosDB database.</p></td>
400
+ </tr>
401
+ <tr>
402
+ <td style="text-align: left;"><p><code>listContainers</code></p></td>
403
+ <td style="text-align: left;"><p>Gets a list of all containers in the
404
+ specified database as <code>List&lt;CosmosContainerProperties&gt;</code>
405
+ set in the exchange message body.</p></td>
406
+ </tr>
407
+ <tr>
408
+ <td style="text-align: left;"><p><code>queryContainers</code></p></td>
409
+ <td style="text-align: left;"><p><strong><code>query</code> is
410
+ required</strong> Executes an SQL query against the database level in
411
+ order for example return only a small subset of the container list for
412
+ the specified database. It will set
413
+ <code>List&lt;CosmosContainerProperties&gt;</code> set in the exchange
414
+ message body.</p></td>
415
+ </tr>
416
+ </tbody>
417
+ </table>
418
+
419
+ **Operations on the container level**
420
+
421
+ For these operations, `databaseName` and `containerName` is **required**
422
+ for all operations here.
423
+
424
+ <table>
425
+ <colgroup>
426
+ <col style="width: 10%" />
427
+ <col style="width: 89%" />
428
+ </colgroup>
429
+ <thead>
430
+ <tr>
431
+ <th style="text-align: left;">Operation</th>
432
+ <th style="text-align: left;">Description</th>
433
+ </tr>
434
+ </thead>
435
+ <tbody>
436
+ <tr>
437
+ <td style="text-align: left;"><p><code>deleteContainer</code></p></td>
438
+ <td style="text-align: left;"><p>Delete a container from the specified
439
+ Azure CosmosDB database.</p></td>
440
+ </tr>
441
+ <tr>
442
+ <td
443
+ style="text-align: left;"><p><code>replaceContainerThroughput</code></p></td>
444
+ <td style="text-align: left;"><p>Replace the throughput for the
445
+ specified Azure CosmosDB container.</p></td>
446
+ </tr>
447
+ <tr>
448
+ <td style="text-align: left;"><p><code>createItem</code></p></td>
449
+ <td style="text-align: left;"><p><strong><code>itemPartitionKey</code>
450
+ is required</strong> Creates an item in the specified container, it
451
+ accepts POJO or key value as <code>Map&lt;String, ?&gt;</code>.</p></td>
452
+ </tr>
453
+ <tr>
454
+ <td style="text-align: left;"><p><code>upsertItem</code></p></td>
455
+ <td style="text-align: left;"><p><strong><code>itemPartitionKey</code>
456
+ is required</strong> Creates an item in the specified container if it
457
+ doesn’t exist otherwise overwrite it if it exists, it accepts POJO or
458
+ key value as <code>Map&lt;String, ?&gt;</code>.</p></td>
459
+ </tr>
460
+ <tr>
461
+ <td style="text-align: left;"><p><code>replaceItem</code></p></td>
462
+ <td style="text-align: left;"><p><strong><code>itemPartitionKey</code>
463
+ and <code>itemId</code> are required</strong> Overwrites an item in the
464
+ specified container, it accepts POJO or key value as
465
+ <code>Map&lt;String, ?&gt;</code>.</p></td>
466
+ </tr>
467
+ <tr>
468
+ <td style="text-align: left;"><p><code>deleteItem</code></p></td>
469
+ <td style="text-align: left;"><p><strong><code>itemPartitionKey</code>
470
+ and <code>itemId</code> are required</strong> Deletes an item in the
471
+ specified container.</p></td>
472
+ </tr>
473
+ <tr>
474
+ <td style="text-align: left;"><p><code>readItem</code></p></td>
475
+ <td style="text-align: left;"><p><strong><code>itemPartitionKey</code>
476
+ and <code>itemId</code> are required</strong> Gets an item in the
477
+ specified container as <code>Map&lt;String,?&gt;</code> set in the
478
+ exchange body message.</p></td>
479
+ </tr>
480
+ <tr>
481
+ <td style="text-align: left;"><p><code>readItem</code></p></td>
482
+ <td
483
+ style="text-align: left;"><p><strong><code>itemPartitionKey</code></strong>
484
+ Gets a list of items in the specified container per the
485
+ <code>itemPartitionKey</code> as
486
+ <code>List&lt;Map&lt;String,?&gt;&gt;</code> set in the exchange body
487
+ message.</p></td>
488
+ </tr>
489
+ <tr>
490
+ <td style="text-align: left;"><p><code>queryItems</code></p></td>
491
+ <td style="text-align: left;"><p><strong><code>query</code> is
492
+ required</strong> Execute an SQL query against the container level in
493
+ order, for example, return only matching items per the SQL query. It
494
+ will set <code>List&lt;Map&lt;String,&gt;?&gt;</code> in the exchange
495
+ message body.</p></td>
496
+ </tr>
497
+ </tbody>
498
+ </table>
499
+
500
+ Refer to the example section in this page to learn how to use these
501
+ operations into your camel application.
502
+
503
+ ### Examples
504
+
505
+ - `listDatabases`:
506
+
507
+ <!-- -->
508
+
509
+ from("direct:start")
510
+ .to("azure-cosmosdb://?operation=listDatabases")
511
+ .to("mock:result");
512
+
513
+ - `createDatabase`:
514
+
515
+ <!-- -->
516
+
517
+ from("direct:start")
518
+ .process(exchange -> {
519
+ exchange.getIn().setHeader(CosmosDbConstants.DATABASE_NAME, "myDb");
520
+ })
521
+ .to("azure-cosmosdb://?operation=createDatabase")
522
+ .to("mock:result");
523
+
524
+ - `deleteDatabase`:
525
+
526
+ <!-- -->
527
+
528
+ from("direct:start")
529
+ .process(exchange -> {
530
+ exchange.getIn().setHeader(CosmosDbConstants.DATABASE_NAME, "myDb");
531
+ })
532
+ .to("azure-cosmosdb://?operation=deleteDatabase")
533
+ .to("mock:result");
534
+
535
+ - `createContainer`:
536
+
537
+ <!-- -->
538
+
539
+ from("direct:start")
540
+ .process(exchange -> {
541
+ exchange.getIn().setHeader(CosmosDbConstants.DATABASE_NAME, "databaseName");
542
+ exchange.getIn().setHeader(CosmosDbConstants.CONTAINER_NAME, "containerName");
543
+ exchange.getIn().setHeader(CosmosDbConstants.CONTAINER_PARTITION_KEY_PATH, "path");
544
+ exchange.getIn().setHeader(CosmosDbConstants.CREATE_DATABASE_IF_NOT_EXIST, true);
545
+ })
546
+ .to("azure-cosmosdb://?operation=createContainer")
547
+ .to("mock:result");
548
+
549
+ - `deleteContainer`:
550
+
551
+ <!-- -->
552
+
553
+ from("direct:start")
554
+ .process(exchange -> {
555
+ exchange.getIn().setHeader(CosmosDbConstants.DATABASE_NAME, "databaseName");
556
+ exchange.getIn().setHeader(CosmosDbConstants.CONTAINER_NAME, "containerName");
557
+ })
558
+ .to("azure-cosmosdb://?operation=deleteContainer")
559
+ .to("mock:result");
560
+
561
+ - `replaceDatabaseThroughput`:
562
+
563
+ <!-- -->
564
+
565
+ from("direct:start")
566
+ .process(exchange -> {
567
+ exchange.getIn().setHeader(CosmosDbConstants.DATABASE_NAME, "databaseName");
568
+ exchange.getIn().setHeader(CosmosDbConstants.THROUGHPUT_PROPERTIES,
569
+ ThroughputProperties.createManualThroughput(700));
570
+ })
571
+ .to("azure-cosmosdb://?operation=replaceDatabaseThroughput")
572
+ .to("mock:result");
573
+
574
+ - `queryContainers`:
575
+
576
+ <!-- -->
577
+
578
+ from("direct:start")
579
+ .process(exchange -> {
580
+ exchange.getIn().setHeader(CosmosDbConstants.DATABASE_NAME, "databaseName");
581
+ exchange.getIn().setHeader(CosmosDbConstants.QUERY, "SELECT * from c where c.id = 'myAwersomeContainer'");
582
+ })
583
+ .to("azure-cosmosdb://?operation=queryContainers")
584
+ .to("mock:result");
585
+
586
+ - `createItem`:
587
+
588
+ <!-- -->
589
+
590
+ from("direct:start")
591
+ .process(exchange -> {
592
+ // create item to send
593
+ final Map<String, Object> item = new HashMap<>();
594
+ item1.put("id", "test-id-1");
595
+ item1.put("partition", "test-1");
596
+ item1.put("field1", "awesome!");
597
+
598
+ exchange.getIn().setHeader(CosmosDbConstants.DATABASE_NAME, "databaseName");
599
+ exchange.getIn().setHeader(CosmosDbConstants.CONTAINER_NAME, "containerName");
600
+ exchange.getIn().setHeader(CosmosDbConstants.CONTAINER_PARTITION_KEY_PATH, "partition");
601
+ exchange.getIn().setHeader(CosmosDbConstants.ITEM_PARTITION_KEY, "test-1");
602
+ exchange.getIn().setBody(item);
603
+ })
604
+ .to("azure-cosmosdb://?operation=createItem")
605
+ .to("mock:result");
606
+
607
+ - `replaceItem`:
608
+
609
+ <!-- -->
610
+
611
+ from("direct:start")
612
+ .process(exchange -> {
613
+ // create item to send
614
+ final Map<String, Object> item = new HashMap<>();
615
+ item1.put("id", "test-id-1");
616
+ item1.put("partition", "test-1");
617
+ item1.put("field1", "awesome!");
618
+
619
+ exchange.getIn().setHeader(CosmosDbConstants.DATABASE_NAME, "databaseName");
620
+ exchange.getIn().setHeader(CosmosDbConstants.CONTAINER_NAME, "containerName");
621
+ exchange.getIn().setHeader(CosmosDbConstants.ITEM_PARTITION_KEY, "test-1");
622
+ exchange.getIn().setHeader(CosmosDbConstants.ITEM_ID, "test-id-1");
623
+ exchange.getIn().setBody(item);
624
+ })
625
+ .to("azure-cosmosdb://?operation=replaceItem")
626
+ .to("mock:result");
627
+
628
+ - `deleteItem`:
629
+
630
+ <!-- -->
631
+
632
+ from("direct:start")
633
+ .process(exchange -> {
634
+ exchange.getIn().setHeader(CosmosDbConstants.DATABASE_NAME, "databaseName");
635
+ exchange.getIn().setHeader(CosmosDbConstants.CONTAINER_NAME, "containerName");
636
+ exchange.getIn().setHeader(CosmosDbConstants.ITEM_PARTITION_KEY, "test-1");
637
+ exchange.getIn().setHeader(CosmosDbConstants.ITEM_ID, "test-id-1");
638
+ exchange.getIn().setBody(item);
639
+ })
640
+ .to("azure-cosmosdb://?operation=deleteItem")
641
+ .to("mock:result");
642
+
643
+ - `queryItems`:
644
+
645
+ <!-- -->
646
+
647
+ from("direct:start")
648
+ .process(exchange -> {
649
+ exchange.getIn().setHeader(CosmosDbConstants.DATABASE_NAME, "databaseName");
650
+ exchange.getIn().setHeader(CosmosDbConstants.CONTAINER_NAME, "containerName");
651
+ exchange.getIn().setHeader(CosmosDbConstants.QUERY, "SELECT c.id,c.field2,c.field1 from c where c.id = 'test-id-1'");
652
+ })
653
+ .to("azure-cosmosdb://?operation=queryItems")
654
+ .to("mock:result");
655
+
656
+ ## Azure CosmosDB Consumer
657
+
658
+ Camel Azure CosmosDB uses [ChangeFeed
659
+ pattern](https://docs.microsoft.com/en-us/azure/cosmos-db/change-feed-design-patterns)
660
+ to capture a feed of events and feed them into the Camel in an Async
661
+ manner, something similar to the Change Data Capture (CDC) design
662
+ pattern. However, it doesn’t capture deletions as these are removed from
663
+ the feed as well.
664
+
665
+ To use the Camel Azure CosmosDB, `containerName` and `databaseName` are
666
+ required. However, there are more options that need to be set to use
667
+ this feature:
668
+
669
+ - `leaseDatabaseName`: Sets the lease database where the
670
+ `leaseContainerName` will be stored. If it is not specified, this
671
+ component will store the lease container in the same database that
672
+ is specified in databaseName. It will be auto-created if
673
+ `createLeaseDatabaseIfNotExists` is set to true.
674
+
675
+ - `leaseContainerName`: Sets the lease container which acts as a state
676
+ storage and coordinates processing the change feed across multiple
677
+ workers. The lease container can be stored in the same account as
678
+ the monitored container or in a separate account. It will be
679
+ auto-created if `createLeaseContainerIfNotExists` is set to true. If
680
+ not specified, this component will create container called
681
+ `camel-lease`.
682
+
683
+ - `hostName`: Sets the hostname. The host: a host is an application
684
+ instance that uses the change feed processor to listen for changes.
685
+ Multiple instances with the same lease configuration can run in
686
+ parallel, but each instance should have a different instance name.
687
+ If not specified, this will be a generated random hostname.
688
+
689
+ - `changeFeedProcessorOptions`: Sets additional options for the change
690
+ feed processor.
691
+
692
+ The consumer will set `List<Map<String,>>` in exchange message body
693
+ which reflect the list of items in a single feed.
694
+
695
+ ### Example:
696
+
697
+ For example, to listen to the events in `myContainer` container in
698
+ `myDb`:
699
+
700
+ from("azure-cosmosdb://myDb/myContainer?leaseDatabaseName=myLeaseDb&createLeaseDatabaseIfNotExists=true&createLeaseContainerIfNotExists=true")
701
+ .to("mock:result");
702
+
703
+ ## Development Notes (Important)
704
+
705
+ When developing on this component, you will need to obtain your Azure
706
+ accessKey in order to run the integration tests. In addition to the
707
+ mocked unit tests, you **will need to run the integration tests with
708
+ every change you make or even client upgrade as the Azure client can
709
+ break things even on minor versions upgrade.** To run the integration
710
+ tests, on this component directory, run the following maven command:
711
+
712
+ mvn clean install -Dendpoint={{dbaddress}} -DaccessKey={{accessKey}}
713
+
714
+ Whereby `endpoint` is your Azure CosmosDB endpoint name and `accessKey`
715
+ is the access key being generated from Azure CosmosDB portal.
716
+
717
+ ## Component Configurations
718
+
719
+
720
+ |Name|Description|Default|Type|
721
+ |---|---|---|---|
722
+ |clientTelemetryEnabled|Sets the flag to enable client telemetry which will periodically collect database operations aggregation statistics, system information like cpu/memory and send it to cosmos monitoring service, which will be helpful during debugging. DEFAULT value is false indicating this is opt in feature, by default no telemetry collection.|false|boolean|
723
+ |configuration|The component configurations||object|
724
+ |connectionSharingAcrossClientsEnabled|Enables connections sharing across multiple Cosmos Clients. The default is false. When you have multiple instances of Cosmos Client in the same JVM interacting to multiple Cosmos accounts, enabling this allows connection sharing in Direct mode if possible between instances of Cosmos Client. Please note, when setting this option, the connection configuration (e.g., socket timeout config, idle timeout config) of the first instantiated client will be used for all other client instances.|false|boolean|
725
+ |consistencyLevel|Sets the consistency levels supported for Azure Cosmos DB client operations in the Azure Cosmos DB service. The requested ConsistencyLevel must match or be weaker than that provisioned for the database account. Consistency levels by order of strength are STRONG, BOUNDED\_STALENESS, SESSION and EVENTUAL. Refer to consistency level documentation for additional details: https://docs.microsoft.com/en-us/azure/cosmos-db/consistency-levels|SESSION|object|
726
+ |containerPartitionKeyPath|Sets the container partition key path.||string|
727
+ |contentResponseOnWriteEnabled|Sets the boolean to only return the headers and status code in Cosmos DB response in case of Create, Update and Delete operations on CosmosItem. In Consumer, it is enabled by default because of the ChangeFeed in the consumer that needs this flag to be enabled and thus is shouldn't be overridden. In Producer, it advised to disable it since it reduces the network overhead|true|boolean|
728
+ |cosmosAsyncClient|Inject an external CosmosAsyncClient into the component which provides a client-side logical representation of the Azure Cosmos DB service. This asynchronous client is used to configure and execute requests against the service.||object|
729
+ |createContainerIfNotExists|Sets if the component should create Cosmos container automatically in case it doesn't exist in Cosmos database|false|boolean|
730
+ |createDatabaseIfNotExists|Sets if the component should create Cosmos database automatically in case it doesn't exist in Cosmos account|false|boolean|
731
+ |databaseEndpoint|Sets the Azure Cosmos database endpoint the component will connect to.||string|
732
+ |multipleWriteRegionsEnabled|Sets the flag to enable writes on any regions for geo-replicated database accounts in the Azure Cosmos DB service. When the value of this property is true, the SDK will direct write operations to available writable regions of geo-replicated database account. Writable regions are ordered by PreferredRegions property. Setting the property value to true has no effect until EnableMultipleWriteRegions in DatabaseAccount is also set to true. DEFAULT value is true indicating that writes are directed to available writable regions of geo-replicated database account.|true|boolean|
733
+ |preferredRegions|Sets the comma separated preferred regions for geo-replicated database accounts. For example, East US as the preferred region. When EnableEndpointDiscovery is true and PreferredRegions is non-empty, the SDK will prefer to use the regions in the container in the order they are specified to perform operations.||string|
734
+ |readRequestsFallbackEnabled|Sets whether to allow for reads to go to multiple regions configured on an account of Azure Cosmos DB service. DEFAULT value is true. If this property is not set, the default is true for all Consistency Levels other than Bounded Staleness, The default is false for Bounded Staleness. 1. endpointDiscoveryEnabled is true 2. the Azure Cosmos DB account has more than one region|true|boolean|
735
+ |throughputProperties|Sets throughput of the resources in the Azure Cosmos DB service.||object|
736
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
737
+ |changeFeedProcessorOptions|Sets the ChangeFeedProcessorOptions to be used. Unless specifically set the default values that will be used are: maximum items per page or FeedResponse: 100 lease renew interval: 17 seconds lease acquire interval: 13 seconds lease expiration interval: 60 seconds feed poll delay: 5 seconds maximum scale count: unlimited||object|
738
+ |createLeaseContainerIfNotExists|Sets if the component should create Cosmos lease container for the consumer automatically in case it doesn't exist in Cosmos database|false|boolean|
739
+ |createLeaseDatabaseIfNotExists|Sets if the component should create Cosmos lease database for the consumer automatically in case it doesn't exist in Cosmos account|false|boolean|
740
+ |hostName|Sets the hostname. The host: a host is an application instance that uses the change feed processor to listen for changes. Multiple instances with the same lease configuration can run in parallel, but each instance should have a different instance name. If not specified, this will be a generated random hostname.||string|
741
+ |leaseContainerName|Sets the lease container which acts as a state storage and coordinates processing the change feed across multiple workers. The lease container can be stored in the same account as the monitored container or in a separate account. It will be auto created if createLeaseContainerIfNotExists is set to true.|camel-lease|string|
742
+ |leaseDatabaseName|Sets the lease database where the leaseContainerName will be stored. If it is not specified, this component will store the lease container in the same database that is specified in databaseName. It will be auto created if createLeaseDatabaseIfNotExists is set to true.||string|
743
+ |itemId|Sets the itemId in case needed for operation on item like delete, replace||string|
744
+ |itemPartitionKey|Sets partition key. Represents a partition key value in the Azure Cosmos DB database service. A partition key identifies the partition where the item is stored in.||string|
745
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
746
+ |operation|The CosmosDB operation that can be used with this component on the producer.|listDatabases|object|
747
+ |query|An SQL query to execute on a given resources. To learn more about Cosmos SQL API, check this link {link https://docs.microsoft.com/en-us/azure/cosmos-db/sql-query-getting-started}||string|
748
+ |queryRequestOptions|Set additional QueryRequestOptions that can be used with queryItems, queryContainers, queryDatabases, listDatabases, listItems, listContainers operations||object|
749
+ |indexingPolicy|The CosmosDB Indexing Policy that will be set in case of container creation, this option is related to createLeaseContainerIfNotExists and it will be taken into account when the latter is true.||object|
750
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
751
+ |accountKey|Sets either a master or readonly key used to perform authentication for accessing resource.||string|
752
+ |credentialType|Determines the credential strategy to adopt|SHARED\_ACCOUNT\_KEY|object|
753
+
754
+ ## Endpoint Configurations
755
+
756
+
757
+ |Name|Description|Default|Type|
758
+ |---|---|---|---|
759
+ |databaseName|The name of the Cosmos database that component should connect to. In case you are producing data and have createDatabaseIfNotExists=true, the component will automatically auto create a Cosmos database.||string|
760
+ |containerName|The name of the Cosmos container that component should connect to. In case you are producing data and have createContainerIfNotExists=true, the component will automatically auto create a Cosmos container.||string|
761
+ |clientTelemetryEnabled|Sets the flag to enable client telemetry which will periodically collect database operations aggregation statistics, system information like cpu/memory and send it to cosmos monitoring service, which will be helpful during debugging. DEFAULT value is false indicating this is opt in feature, by default no telemetry collection.|false|boolean|
762
+ |connectionSharingAcrossClientsEnabled|Enables connections sharing across multiple Cosmos Clients. The default is false. When you have multiple instances of Cosmos Client in the same JVM interacting to multiple Cosmos accounts, enabling this allows connection sharing in Direct mode if possible between instances of Cosmos Client. Please note, when setting this option, the connection configuration (e.g., socket timeout config, idle timeout config) of the first instantiated client will be used for all other client instances.|false|boolean|
763
+ |consistencyLevel|Sets the consistency levels supported for Azure Cosmos DB client operations in the Azure Cosmos DB service. The requested ConsistencyLevel must match or be weaker than that provisioned for the database account. Consistency levels by order of strength are STRONG, BOUNDED\_STALENESS, SESSION and EVENTUAL. Refer to consistency level documentation for additional details: https://docs.microsoft.com/en-us/azure/cosmos-db/consistency-levels|SESSION|object|
764
+ |containerPartitionKeyPath|Sets the container partition key path.||string|
765
+ |contentResponseOnWriteEnabled|Sets the boolean to only return the headers and status code in Cosmos DB response in case of Create, Update and Delete operations on CosmosItem. In Consumer, it is enabled by default because of the ChangeFeed in the consumer that needs this flag to be enabled and thus is shouldn't be overridden. In Producer, it advised to disable it since it reduces the network overhead|true|boolean|
766
+ |cosmosAsyncClient|Inject an external CosmosAsyncClient into the component which provides a client-side logical representation of the Azure Cosmos DB service. This asynchronous client is used to configure and execute requests against the service.||object|
767
+ |createContainerIfNotExists|Sets if the component should create Cosmos container automatically in case it doesn't exist in Cosmos database|false|boolean|
768
+ |createDatabaseIfNotExists|Sets if the component should create Cosmos database automatically in case it doesn't exist in Cosmos account|false|boolean|
769
+ |databaseEndpoint|Sets the Azure Cosmos database endpoint the component will connect to.||string|
770
+ |multipleWriteRegionsEnabled|Sets the flag to enable writes on any regions for geo-replicated database accounts in the Azure Cosmos DB service. When the value of this property is true, the SDK will direct write operations to available writable regions of geo-replicated database account. Writable regions are ordered by PreferredRegions property. Setting the property value to true has no effect until EnableMultipleWriteRegions in DatabaseAccount is also set to true. DEFAULT value is true indicating that writes are directed to available writable regions of geo-replicated database account.|true|boolean|
771
+ |preferredRegions|Sets the comma separated preferred regions for geo-replicated database accounts. For example, East US as the preferred region. When EnableEndpointDiscovery is true and PreferredRegions is non-empty, the SDK will prefer to use the regions in the container in the order they are specified to perform operations.||string|
772
+ |readRequestsFallbackEnabled|Sets whether to allow for reads to go to multiple regions configured on an account of Azure Cosmos DB service. DEFAULT value is true. If this property is not set, the default is true for all Consistency Levels other than Bounded Staleness, The default is false for Bounded Staleness. 1. endpointDiscoveryEnabled is true 2. the Azure Cosmos DB account has more than one region|true|boolean|
773
+ |throughputProperties|Sets throughput of the resources in the Azure Cosmos DB service.||object|
774
+ |changeFeedProcessorOptions|Sets the ChangeFeedProcessorOptions to be used. Unless specifically set the default values that will be used are: maximum items per page or FeedResponse: 100 lease renew interval: 17 seconds lease acquire interval: 13 seconds lease expiration interval: 60 seconds feed poll delay: 5 seconds maximum scale count: unlimited||object|
775
+ |createLeaseContainerIfNotExists|Sets if the component should create Cosmos lease container for the consumer automatically in case it doesn't exist in Cosmos database|false|boolean|
776
+ |createLeaseDatabaseIfNotExists|Sets if the component should create Cosmos lease database for the consumer automatically in case it doesn't exist in Cosmos account|false|boolean|
777
+ |hostName|Sets the hostname. The host: a host is an application instance that uses the change feed processor to listen for changes. Multiple instances with the same lease configuration can run in parallel, but each instance should have a different instance name. If not specified, this will be a generated random hostname.||string|
778
+ |leaseContainerName|Sets the lease container which acts as a state storage and coordinates processing the change feed across multiple workers. The lease container can be stored in the same account as the monitored container or in a separate account. It will be auto created if createLeaseContainerIfNotExists is set to true.|camel-lease|string|
779
+ |leaseDatabaseName|Sets the lease database where the leaseContainerName will be stored. If it is not specified, this component will store the lease container in the same database that is specified in databaseName. It will be auto created if createLeaseDatabaseIfNotExists is set to true.||string|
780
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
781
+ |exceptionHandler|To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.||object|
782
+ |exchangePattern|Sets the exchange pattern when the consumer creates an exchange.||object|
783
+ |itemId|Sets the itemId in case needed for operation on item like delete, replace||string|
784
+ |itemPartitionKey|Sets partition key. Represents a partition key value in the Azure Cosmos DB database service. A partition key identifies the partition where the item is stored in.||string|
785
+ |operation|The CosmosDB operation that can be used with this component on the producer.|listDatabases|object|
786
+ |query|An SQL query to execute on a given resources. To learn more about Cosmos SQL API, check this link {link https://docs.microsoft.com/en-us/azure/cosmos-db/sql-query-getting-started}||string|
787
+ |queryRequestOptions|Set additional QueryRequestOptions that can be used with queryItems, queryContainers, queryDatabases, listDatabases, listItems, listContainers operations||object|
788
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
789
+ |indexingPolicy|The CosmosDB Indexing Policy that will be set in case of container creation, this option is related to createLeaseContainerIfNotExists and it will be taken into account when the latter is true.||object|
790
+ |accountKey|Sets either a master or readonly key used to perform authentication for accessing resource.||string|
791
+ |credentialType|Determines the credential strategy to adopt|SHARED\_ACCOUNT\_KEY|object|
camel-azure-eventhubs.md ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Azure-eventhubs
2
+
3
+ **Since Camel 3.5**
4
+
5
+ **Both producer and consumer are supported**
6
+
7
+ The Azure Event Hubs used to integrate [Azure Event
8
+ Hubs](https://azure.microsoft.com/en-us/services/event-hubs/) using
9
+ [AMQP
10
+ protocol](https://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol).
11
+ Azure EventHubs is a highly scalable publish-subscribe service that can
12
+ ingest millions of events per second and stream them to multiple
13
+ consumers.
14
+
15
+ Besides AMQP protocol support, Event Hubs as well supports Kafka and
16
+ HTTPS protocols. Therefore, you can also use the [Camel
17
+ Kafka](#components::kafka-component.adoc) component to produce and
18
+ consume to Azure Event Hubs. You can lean more
19
+ [here](https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-quickstart-kafka-enabled-event-hubs).
20
+
21
+ Prerequisites
22
+
23
+ You must have a valid Windows Azure Event Hubs account. More information
24
+ is available at [Azure Documentation
25
+ Portal](https://docs.microsoft.com/azure/).
26
+
27
+ Maven users will need to add the following dependency to their `pom.xml`
28
+ for this component:
29
+
30
+ <dependency>
31
+ <groupId>org.apache.camel</groupId>
32
+ <artifactId>camel-azure-eventhubs</artifactId>
33
+ <version>x.x.x</version>
34
+ <!-- use the same version as your Camel core version -->
35
+ </dependency>
36
+
37
+ # URI Format
38
+
39
+ azure-eventhubs://[namespace/eventHubName][?options]
40
+
41
+ In case you supply the `connectionString`, `namespace` and
42
+ `eventHubName` are not required as these options already included in the
43
+ `connectionString`
44
+
45
+ # Authentication Information
46
+
47
+ You have three different Credential Types: AZURE\_IDENTITY,
48
+ TOKEN\_CREDENTIAL and CONNECTION\_STRING. You can also provide a client
49
+ instance yourself. To use this component, you have three options to
50
+ provide the required Azure authentication information:
51
+
52
+ **CONNECTION\_STRING**:
53
+
54
+ - Provide `sharedAccessName` and `sharedAccessKey` for your Azure
55
+ Event Hubs account. The sharedAccessKey can be generated through
56
+ your Event Hubs Azure portal.
57
+
58
+ - Provide `connectionString` string, if you provide the connection
59
+ string, you don’t supply `namespace`, `eventHubName`,
60
+ `sharedAccessKey` and `sharedAccessName` as these data already
61
+ included in the `connectionString`, therefore is the simplest option
62
+ to get started. Learn more
63
+ [here](https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-get-connection-string)
64
+ on how to generate the connection string.
65
+
66
+ **TOKEN\_CREDENTIAL**:
67
+
68
+ - Provide an implementation of
69
+ `com.azure.core.credential.TokenCredential` into the Camel’s
70
+ Registry, e.g., using the
71
+ `com.azure.identity.DefaultAzureCredentialBuilder().build();` API.
72
+ See the documentation [here about Azure-AD
73
+ authentication](https://docs.microsoft.com/en-us/azure/active-directory/authentication/overview-authentication).
74
+
75
+ AZURE\_IDENTITY: - This will use
76
+ `com.azure.identity.DefaultAzureCredentialBuilder().build();` instance.
77
+ This will follow the Default Azure Credential Chain. See the
78
+ documentation [here about Azure-AD
79
+ authentication](https://docs.microsoft.com/en-us/azure/active-directory/authentication/overview-authentication).
80
+
81
+ **Client instance**:
82
+
83
+ - Provide a
84
+ [EventHubProducerAsyncClient](https://docs.microsoft.com/en-us/java/api/com.azure.messaging.eventhubs.eventhubproducerasyncclient?view=azure-java-stable)
85
+ instance which can be provided into `producerAsyncClient`. However,
86
+ this is **only possible for camel producer**, for the camel
87
+ consumer, is not possible to inject the client due to some design
88
+ constraint by the `EventProcessorClient`.
89
+
90
+ # Checkpoint Store Information
91
+
92
+ A checkpoint store stores and retrieves partition ownership information
93
+ and checkpoint details for each partition in a given consumer group of
94
+ an event hub instance. Users are not meant to implement a
95
+ CheckpointStore. Users are expected to choose existing implementations
96
+ of this interface, instantiate it, and pass it to the component through
97
+ `checkpointStore` option. Users are not expected to use any of the
98
+ methods on a checkpoint store, these are used internally by the client.
99
+
100
+ Having said that, if the user does not pass any `CheckpointStore`
101
+ implementation, the component will fall back to use
102
+ [`BlobCheckpointStore`](https://docs.microsoft.com/en-us/javascript/api/@azure/eventhubs-checkpointstore-blob/blobcheckpointstore?view=azure-node-latest)
103
+ to store the checkpoint info in the Azure Blob Storage account. If you
104
+ chose to use the default `BlobCheckpointStore`, you will need to supply
105
+ the following options:
106
+
107
+ - `blobAccountName`: It sets Azure account name to be used for
108
+ authentication with azure blob services.
109
+
110
+ - `blobAccessKey`: It sets the access key for the associated azure
111
+ account name to be used for authentication with azure blob services.
112
+
113
+ - `blobContainerName`: It sets the blob container that shall be used
114
+ by the BlobCheckpointStore to store the checkpoint offsets.
115
+
116
+ # Async Consumer and Producer
117
+
118
+ This component implements the async Consumer and producer.
119
+
120
+ This allows camel route to consume and produce events asynchronously
121
+ without blocking any threads.
122
+
123
+ # Usage
124
+
125
+ For example, to consume event from EventHub, use the following snippet:
126
+
127
+ from("azure-eventhubs:/camel/camelHub?sharedAccessName=SASaccountName&sharedAccessKey=SASaccessKey&blobAccountName=accountName&blobAccessKey=accessKey&blobContainerName=containerName")
128
+ .to("file://queuedirectory");
129
+
130
+ ## Message body type
131
+
132
+ The component’s producer expects the data in the message body to be in
133
+ `byte[]`. This allows the user to utilize Camel TypeConverter to
134
+ marshal/unmarshal data with ease. The same goes as well for the
135
+ component’s consumer, it will set the encoded data as `byte[]` in the
136
+ message body.
137
+
138
+ ## Automatic detection of EventHubProducerAsyncClient client in registry
139
+
140
+ The component is capable of detecting the presence of an
141
+ EventHubProducerAsyncClient bean into the registry. If it’s the only
142
+ instance of that type, it will be used as the client, and you won’t have
143
+ to define it as uri parameter, like the example above. This may be
144
+ really useful for smarter configuration of the endpoint.
145
+
146
+ ## Consumer Example
147
+
148
+ The example below will unmarshal the events that were originally
149
+ produced in JSON:
150
+
151
+ from("azure-eventhubs:?connectionString=RAW({{connectionString}})"&blobContainerName=containerTest&eventPosition=#eventPosition"
152
+ +"&blobAccountName={{blobAccountName}}&blobAccessKey=RAW({{blobAccessKey}})")
153
+ .unmarshal().json(JsonLibrary.Jackson)
154
+ .to(result);
155
+
156
+ ## Producer Example
157
+
158
+ The example below will send events as String to EventHubs:
159
+
160
+ from("direct:start")
161
+ .process(exchange -> {
162
+ exchange.getIn().setHeader(EventHubsConstants.PARTITION_ID, firstPartition);
163
+ exchange.getIn().setBody("test event");
164
+ })
165
+ .to("azure-eventhubs:?connectionString=RAW({{connectionString}})"
166
+
167
+ Also, the component supports as well **aggregation** of messages by
168
+ sending events as **iterable** of either Exchanges/Messages or normal
169
+ data (e.g.: list of Strings). For example:
170
+
171
+ from("direct:start")
172
+ .process(exchange -> {
173
+ final List<String> messages = new LinkedList<>();
174
+ messages.add("Test String Message 1");
175
+ messages.add("Test String Message 2");
176
+
177
+ exchange.getIn().setHeader(EventHubsConstants.PARTITION_ID, firstPartition);
178
+ exchange.getIn().setBody(messages);
179
+ })
180
+ .to("azure-eventhubs:?connectionString=RAW({{connectionString}})"
181
+
182
+ ## Azure-AD Authentication example
183
+
184
+ The example below makes use of the Azure-AD authentication. See
185
+ [here](https://docs.microsoft.com/en-us/java/api/overview/azure/identity-readme?view=azure-java-stable#environment-variables)
186
+ about what environment variables you need to set for this to work:
187
+
188
+ @BindToRegistry("myTokenCredential")
189
+ public com.azure.core.credential.TokenCredential myTokenCredential() {
190
+ return com.azure.identity.DefaultAzureCredentialBuilder().build();
191
+ }
192
+
193
+ from("direct:start")
194
+ .to("azure-eventhubs:namespace/eventHubName?tokenCredential=#myTokenCredential&credentialType=TOKEN_CREDENTIAL)"
195
+
196
+ ## Development Notes (Important)
197
+
198
+ When developing on this component, you will need to obtain your Azure
199
+ accessKey to run the integration tests. In addition to the mocked unit
200
+ tests, you **will need to run the integration tests with every change
201
+ you make or even client upgrade as the Azure client can break things
202
+ even on minor versions upgrade.** To run the integration tests, on this
203
+ component directory, run the following maven command:
204
+
205
+ mvn verify -DconnectionString=string -DblobAccountName=blob -DblobAccessKey=key
206
+
207
+ Whereby `blobAccountName` is your Azure account name and `blobAccessKey`
208
+ is the access key being generated from Azure portal and
209
+ `connectionString` is the eventHub connection string.
210
+
211
+ ## Component Configurations
212
+
213
+
214
+ |Name|Description|Default|Type|
215
+ |---|---|---|---|
216
+ |amqpRetryOptions|Sets the retry policy for EventHubAsyncClient. If not specified, the default retry options are used.||object|
217
+ |amqpTransportType|Sets the transport type by which all the communication with Azure Event Hubs occurs. Default value is AmqpTransportType#AMQP.|AMQP|object|
218
+ |configuration|The component configurations||object|
219
+ |blobAccessKey|In case you chose the default BlobCheckpointStore, this sets access key for the associated azure account name to be used for authentication with azure blob services.||string|
220
+ |blobAccountName|In case you chose the default BlobCheckpointStore, this sets Azure account name to be used for authentication with azure blob services.||string|
221
+ |blobContainerName|In case you chose the default BlobCheckpointStore, this sets the blob container that shall be used by the BlobCheckpointStore to store the checkpoint offsets.||string|
222
+ |blobStorageSharedKeyCredential|In case you chose the default BlobCheckpointStore, StorageSharedKeyCredential can be injected to create the azure client, this holds the important authentication information.||object|
223
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
224
+ |checkpointBatchSize|Sets the batch size between each checkpoint updates. Works jointly with checkpointBatchTimeout.|500|integer|
225
+ |checkpointBatchTimeout|Sets the batch timeout between each checkpoint updates. Works jointly with checkpointBatchSize.|5000|integer|
226
+ |checkpointStore|Sets the CheckpointStore the EventProcessorClient will use for storing partition ownership and checkpoint information. Users can, optionally, provide their own implementation of CheckpointStore which will store ownership and checkpoint information. By default it set to use com.azure.messaging.eventhubs.checkpointstore.blob.BlobCheckpointStore which stores all checkpoint offsets into Azure Blob Storage.|BlobCheckpointStore|object|
227
+ |consumerGroupName|Sets the name of the consumer group this consumer is associated with. Events are read in the context of this group. The name of the consumer group that is created by default is {code $Default}.|$Default|string|
228
+ |eventPosition|Sets the map containing the event position to use for each partition if a checkpoint for the partition does not exist in CheckpointStore. This map is keyed off of the partition id. If there is no checkpoint in CheckpointStore and there is no entry in this map, the processing of the partition will start from {link EventPosition#latest() latest} position.||object|
229
+ |prefetchCount|Sets the count used by the receiver to control the number of events the Event Hub consumer will actively receive and queue locally without regard to whether a receive operation is currently active.|500|integer|
230
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
231
+ |partitionId|Sets the identifier of the Event Hub partition that the events will be sent to. If the identifier is not specified, the Event Hubs service will be responsible for routing events that are sent to an available partition.||string|
232
+ |partitionKey|Sets a hashing key to be provided for the batch of events, which instructs the Event Hubs service to map this key to a specific partition. The selection of a partition is stable for a given partition hashing key. Should any other batches of events be sent using the same exact partition hashing key, the Event Hubs service will route them all to the same partition. This should be specified only when there is a need to group events by partition, but there is flexibility into which partition they are routed. If ensuring that a batch of events is sent only to a specific partition, it is recommended that the {link #setPartitionId(String) identifier of the position be specified directly} when sending the batch.||string|
233
+ |producerAsyncClient|Sets the EventHubProducerAsyncClient.An asynchronous producer responsible for transmitting EventData to a specific Event Hub, grouped together in batches. Depending on the options specified when creating an {linkEventDataBatch}, the events may be automatically routed to an available partition or specific to a partition. Use by this component to produce the data in camel producer.||object|
234
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
235
+ |connectionString|Instead of supplying namespace, sharedAccessKey, sharedAccessName ... etc, you can just supply the connection string for your eventHub. The connection string for EventHubs already include all the necessary information to connection to your EventHub. To learn on how to generate the connection string, take a look at this documentation: https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-get-connection-string||string|
236
+ |credentialType|Determines the credential strategy to adopt|CONNECTION\_STRING|object|
237
+ |sharedAccessKey|The generated value for the SharedAccessName.||string|
238
+ |sharedAccessName|The name you chose for your EventHubs SAS keys.||string|
239
+ |tokenCredential|Still another way of authentication (beside supplying namespace, sharedAccessKey, sharedAccessName or connection string) is through Azure-AD authentication using an implementation instance of TokenCredential.||object|
240
+
241
+ ## Endpoint Configurations
242
+
243
+
244
+ |Name|Description|Default|Type|
245
+ |---|---|---|---|
246
+ |namespace|EventHubs namespace created in Azure Portal.||string|
247
+ |eventHubName|EventHubs name under a specific namespace.||string|
248
+ |amqpRetryOptions|Sets the retry policy for EventHubAsyncClient. If not specified, the default retry options are used.||object|
249
+ |amqpTransportType|Sets the transport type by which all the communication with Azure Event Hubs occurs. Default value is AmqpTransportType#AMQP.|AMQP|object|
250
+ |blobAccessKey|In case you chose the default BlobCheckpointStore, this sets access key for the associated azure account name to be used for authentication with azure blob services.||string|
251
+ |blobAccountName|In case you chose the default BlobCheckpointStore, this sets Azure account name to be used for authentication with azure blob services.||string|
252
+ |blobContainerName|In case you chose the default BlobCheckpointStore, this sets the blob container that shall be used by the BlobCheckpointStore to store the checkpoint offsets.||string|
253
+ |blobStorageSharedKeyCredential|In case you chose the default BlobCheckpointStore, StorageSharedKeyCredential can be injected to create the azure client, this holds the important authentication information.||object|
254
+ |checkpointBatchSize|Sets the batch size between each checkpoint updates. Works jointly with checkpointBatchTimeout.|500|integer|
255
+ |checkpointBatchTimeout|Sets the batch timeout between each checkpoint updates. Works jointly with checkpointBatchSize.|5000|integer|
256
+ |checkpointStore|Sets the CheckpointStore the EventProcessorClient will use for storing partition ownership and checkpoint information. Users can, optionally, provide their own implementation of CheckpointStore which will store ownership and checkpoint information. By default it set to use com.azure.messaging.eventhubs.checkpointstore.blob.BlobCheckpointStore which stores all checkpoint offsets into Azure Blob Storage.|BlobCheckpointStore|object|
257
+ |consumerGroupName|Sets the name of the consumer group this consumer is associated with. Events are read in the context of this group. The name of the consumer group that is created by default is {code $Default}.|$Default|string|
258
+ |eventPosition|Sets the map containing the event position to use for each partition if a checkpoint for the partition does not exist in CheckpointStore. This map is keyed off of the partition id. If there is no checkpoint in CheckpointStore and there is no entry in this map, the processing of the partition will start from {link EventPosition#latest() latest} position.||object|
259
+ |prefetchCount|Sets the count used by the receiver to control the number of events the Event Hub consumer will actively receive and queue locally without regard to whether a receive operation is currently active.|500|integer|
260
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
261
+ |exceptionHandler|To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.||object|
262
+ |exchangePattern|Sets the exchange pattern when the consumer creates an exchange.||object|
263
+ |partitionId|Sets the identifier of the Event Hub partition that the events will be sent to. If the identifier is not specified, the Event Hubs service will be responsible for routing events that are sent to an available partition.||string|
264
+ |partitionKey|Sets a hashing key to be provided for the batch of events, which instructs the Event Hubs service to map this key to a specific partition. The selection of a partition is stable for a given partition hashing key. Should any other batches of events be sent using the same exact partition hashing key, the Event Hubs service will route them all to the same partition. This should be specified only when there is a need to group events by partition, but there is flexibility into which partition they are routed. If ensuring that a batch of events is sent only to a specific partition, it is recommended that the {link #setPartitionId(String) identifier of the position be specified directly} when sending the batch.||string|
265
+ |producerAsyncClient|Sets the EventHubProducerAsyncClient.An asynchronous producer responsible for transmitting EventData to a specific Event Hub, grouped together in batches. Depending on the options specified when creating an {linkEventDataBatch}, the events may be automatically routed to an available partition or specific to a partition. Use by this component to produce the data in camel producer.||object|
266
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
267
+ |connectionString|Instead of supplying namespace, sharedAccessKey, sharedAccessName ... etc, you can just supply the connection string for your eventHub. The connection string for EventHubs already include all the necessary information to connection to your EventHub. To learn on how to generate the connection string, take a look at this documentation: https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-get-connection-string||string|
268
+ |credentialType|Determines the credential strategy to adopt|CONNECTION\_STRING|object|
269
+ |sharedAccessKey|The generated value for the SharedAccessName.||string|
270
+ |sharedAccessName|The name you chose for your EventHubs SAS keys.||string|
271
+ |tokenCredential|Still another way of authentication (beside supplying namespace, sharedAccessKey, sharedAccessName or connection string) is through Azure-AD authentication using an implementation instance of TokenCredential.||object|
camel-azure-files.md ADDED
@@ -0,0 +1,430 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Azure-files
2
+
3
+ **Since Camel 3.22**
4
+
5
+ **Both producer and consumer are supported**
6
+
7
+ This component provides access to Azure Files.
8
+
9
+ This is preview component, therefore, anything can change in future
10
+ releases (features and behavior can be changed, modified or even dropped
11
+ without notice). At the same time it is consolidated enough, sparingly
12
+ documented, a few users reported it was working in their environment,
13
+ and it is ready for wider feedback.
14
+
15
+ When consuming from remote files server, make sure you read the section
16
+ titled *Consuming Files* further below for details related to consuming
17
+ files.
18
+
19
+ Maven users will need to add the following dependency to their `pom.xml`
20
+ for this component:
21
+
22
+ <dependency>
23
+ <groupId>org.apache.camel</groupId>
24
+ <artifactId>camel-azure-files</artifactId>
25
+ <version>x.y.z</version>
26
+ <!-- use the same version as your Camel core version -->
27
+ </dependency>
28
+
29
+ # Endpoint URI Format
30
+
31
+ azure-files://account[.file.core.windows.net][:port]/share[/directory]
32
+
33
+ Where **directory** represents the underlying directory. The directory
34
+ is a relative path and does not include the share name. The relative
35
+ path can contain nested folders, such as `inbox/spam`. It defaults to
36
+ the share root directory.
37
+
38
+ The `autoCreate` option is supported for the directory; when consumer or
39
+ producer starts, there’s an additional operation performed to create the
40
+ directory configured for the endpoint. The default value for
41
+ `autoCreate` is `true`. On the contrary, the share must exist; it is not
42
+ automatically created.
43
+
44
+ If no **port** number is provided, Camel will provide default values
45
+ according to the protocol (https 443).
46
+
47
+ You can append query options to the URI in the following format
48
+ `?option=value&option2=value&...`.
49
+
50
+ To use this component, you have multiple options to provide the required
51
+ Azure authentication information:
52
+
53
+ - Via Azure Identity, when specifying `credentialType=AZURE_IDENTITY`
54
+ and providing required [environment
55
+ variables](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#environment-variables).
56
+ This enables service principal (e.g. app registration)
57
+ authentication with secret/certificate as well as username password.
58
+
59
+ - Via shared storage account key, when specifying
60
+ `credentialType=SHARED_ACCOUNT_KEY` and providing `sharedKey` for
61
+ your Azure account, this is the simplest way to get started. The
62
+ sharedKey can be generated through your Azure portal.
63
+
64
+ - Via Azure SAS, when specifying `credentialType=AZURE_SAS` and
65
+ providing a SAS Token parameter through the `token` parameter.
66
+
67
+ ## Endpoint URI Examples
68
+
69
+ azure-files://camelazurefiles.file.core.windows.net/samples?sv=2022-11-02&ss=f&srt=sco&sp=rwdlc&se=2023-06-18T22:29:13Z&st=2023-06-05T14:29:13Z&spr=https&sig=MPsMh8zci0v3To7IT9SKdaFGZV8ezno63m9C8s9bdVQ%3D
70
+
71
+ azure-files://camelazurefiles/samples/inbox/spam?sharedKey=FAKE502UyuBD...3Z%2BASt9dCmJg%3D%3D&delete=true
72
+
73
+ # Paths
74
+
75
+ The path separator is `/`. The absolute paths start with the path
76
+ separator. The absolute paths do not include the share name, and they
77
+ are relative to the share root rather than to the endpoint starting
78
+ directory.
79
+
80
+ **NOTE:** At some places, namely logs of used libraries, OS-specific
81
+ path separator appears, and the relative paths are relative to the share
82
+ root (rather than to the current working directory or to the endpoint
83
+ starting directory) so interpret them with a grain of salt.
84
+
85
+ # Concurrency
86
+
87
+ This component does not support concurrency on its endpoints.
88
+
89
+ # More Information
90
+
91
+ This component mimics the FTP component. So, there are more samples and
92
+ details on the FTP component page.
93
+
94
+ This component uses the Azure Java SDK libraries for the actual work.
95
+
96
+ # Consuming Files
97
+
98
+ The remote consumer will by default leave the consumed files untouched
99
+ on the remote cloud files server. You have to configure it explicitly if
100
+ you want it to delete the files or move them to another location. For
101
+ example, you can use `delete=true` to delete the files, or use
102
+ `move=.done` to move the files into `.done` sub directory.
103
+
104
+ In Camel, the `.`-prefixed folders are excluded from recursive polling.
105
+
106
+ The regular File consumer is different as it will by default move files
107
+ to a `.camel` sub directory. The reason Camel does **not** do this by
108
+ default for the remote consumer is that it may lack permissions by
109
+ default to be able to move or delete files.
110
+
111
+ ## Body Type Options
112
+
113
+ For each matching file, the consumer sends to the Camel exchange a
114
+ message with a selected body type:
115
+
116
+ - `byte[]` by default
117
+
118
+ - `java.io.InputStream` if `streamDownload=true` is configured
119
+
120
+ - `java.io.File` if `localWorkDirectory` is configured
121
+
122
+ The body type configuration should be tuned to fit available resources,
123
+ performance targets, route processors, caching, resuming, etc.
124
+
125
+ ## Limitations
126
+
127
+ The option **readLock** can be used to force Camel **not** to consume
128
+ files that are currently in the progress of being written. However, this
129
+ option is turned off by default, as it requires that the user has write
130
+ access. See the endpoint options table for more details about read
131
+ locks.
132
+ There are other solutions to avoid consuming files that are currently
133
+ being written; for instance, you can write to a temporary destination
134
+ and move the file after it has been written.
135
+
136
+ For the `readLock=changed`, it relies only on the last modified;
137
+ furthermore a precision finer than 5 seconds might be problematic.
138
+
139
+ When moving files using `move` or `preMove` option, the files are
140
+ restricted to the share. That prevents consumer from moving files
141
+ outside the endpoint share.
142
+
143
+ ## Exchange Properties
144
+
145
+ The consumer sets the following exchange properties
146
+
147
+ <table>
148
+ <colgroup>
149
+ <col style="width: 50%" />
150
+ <col style="width: 50%" />
151
+ </colgroup>
152
+ <thead>
153
+ <tr>
154
+ <th style="text-align: left;">Header</th>
155
+ <th style="text-align: left;">Description</th>
156
+ </tr>
157
+ </thead>
158
+ <tbody>
159
+ <tr>
160
+ <td style="text-align: left;"><p><code>CamelBatchIndex</code></p></td>
161
+ <td style="text-align: left;"><p>The current index out of total number
162
+ of files being consumed in this batch.</p></td>
163
+ </tr>
164
+ <tr>
165
+ <td style="text-align: left;"><p><code>CamelBatchSize</code></p></td>
166
+ <td style="text-align: left;"><p>The total number of files being
167
+ consumed in this batch.</p></td>
168
+ </tr>
169
+ <tr>
170
+ <td
171
+ style="text-align: left;"><p><code>CamelBatchComplete</code></p></td>
172
+ <td style="text-align: left;"><p>True if there are no more files in this
173
+ batch.</p></td>
174
+ </tr>
175
+ </tbody>
176
+ </table>
177
+
178
+ # Producing Files
179
+
180
+ The Files producer is optimized for two body types:
181
+
182
+ - `java.io.InputStream` if `CamelFileLength` header is set
183
+
184
+ - `byte[]`
185
+
186
+ In either case, the remote file size is allocated and then rewritten
187
+ with body content. Any inconsistency between declared file length and
188
+ stream length results in a corrupted remote file.
189
+
190
+ ## Limitations
191
+
192
+ The underlying Azure Files service does not allow growing files. The
193
+ file length must be known at its creation time, consequently:
194
+
195
+ - `CamelFileLength` header has an important meaning even for
196
+ producers.
197
+
198
+ - No appending mode is supported.
199
+
200
+ # About Timeouts
201
+
202
+ You can use the `connectTimeout` option to set a timeout in millis to
203
+ connect or disconnect.
204
+
205
+ The `timeout` option only applies as the data timeout in millis.
206
+
207
+ The meta-data operations timeout is minimum of: `readLockCheckInterval`,
208
+ `timeout` and 20\_000 millis.
209
+
210
+ For now, the file upload has no timeout. During the upload, the
211
+ underlying library could log timeout warnings. They are recoverable and
212
+ upload could continue.
213
+
214
+ # Using Local Work Directory
215
+
216
+ Camel supports consuming from remote files servers and downloading the
217
+ files directly into a local work directory. This avoids reading the
218
+ entire remote file content into memory as it is streamed directly into
219
+ the local file using `FileOutputStream`.
220
+
221
+ Camel will store to a local file with the same name as the remote file,
222
+ though with `.inprogress` as an extension while the file is being
223
+ downloaded. Afterward, the file is renamed to remove the `.inprogress`
224
+ suffix. And finally, when the Exchange is complete, the local file is
225
+ deleted.
226
+
227
+ So if you want to download files from a remote files server and store it
228
+ as local files, then you need to route to a file endpoint such as:
229
+
230
+ from("azure-files://...&localWorkDirectory=/tmp").to("file://inbox");
231
+
232
+ The route above is ultra efficient as it avoids reading the entire file
233
+ content into memory. It will download the remote file directly to a
234
+ local file stream. The `java.io.File` handle is then used as the
235
+ Exchange body. The file producer leverages this fact and can work
236
+ directly on the work file `java.io.File` handle and perform a
237
+ `java.io.File.rename` to the target filename. As Camel knows it’s a
238
+ local work file, it can optimize and use a rename instead of a file
239
+ copy, as the work file is meant to be deleted anyway.
240
+
241
+ # Custom Filtering
242
+
243
+ Camel supports pluggable filtering strategies. This strategy it to use
244
+ the build in `org.apache.camel.component.file.GenericFileFilter` in
245
+ Java. You can then configure the endpoint with such a filter to skip
246
+ certain filters before being processed.
247
+
248
+ In the sample, we have built our own filter that only accepts files
249
+ starting with the report in the filename.
250
+
251
+ And then we can configure our route using the **filter** attribute to
252
+ reference our filter (using `#` notation) that we have defined in the
253
+ spring XML file:
254
+
255
+ The accept(file) file argument has properties:
256
+
257
+ - endpoint path: the share name such as `/samples`
258
+
259
+ - relative path: a path to the file such as `subdir/a file`
260
+
261
+ - directory: `true` if a directory
262
+
263
+ - file length: if not a directory, then a length of the file in bytes
264
+
265
+ # Filtering using ANT path matcher
266
+
267
+ The ANT path matcher is a filter shipped out-of-the-box in the
268
+ **camel-spring** jar. So you need to depend on **camel-spring** if you
269
+ are using Maven.
270
+ The reason is that we leverage Spring’s
271
+ [AntPathMatcher](http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/util/AntPathMatcher.html)
272
+ to do the actual matching.
273
+
274
+ The file paths are matched with the following rules:
275
+
276
+ - `?` matches one character
277
+
278
+ - `*` matches zero or more characters
279
+
280
+ - `**` matches zero or more directories in a path
281
+
282
+ The sample below demonstrates how to use it:
283
+
284
+ from("azure-files://...&antInclude=**/*.txt").to("...");
285
+
286
+ # Using a Proxy
287
+
288
+ Consult the [underlying
289
+ library](https://learn.microsoft.com/en-us/azure/developer/java/sdk/proxying)
290
+ documentation.
291
+
292
+ # Consuming a single file using a fixed name
293
+
294
+ Unlike FTP component that features a special combination of options:
295
+
296
+ - `useList=false`
297
+
298
+ - `fileName=myFileName.txt`
299
+
300
+ - `ignoreFileNotFoundOrPermissionError=true`
301
+
302
+ to optimize *the single file using a fixed name* use case, it is
303
+ necessary to fall back to regular filters (i.e. the list permission is
304
+ needed).
305
+
306
+ # Debug logging
307
+
308
+ This component has log level **TRACE** that can be helpful if you have
309
+ problems.
310
+
311
+ ## Component Configurations
312
+
313
+
314
+ |Name|Description|Default|Type|
315
+ |---|---|---|---|
316
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
317
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
318
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
319
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
320
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
321
+
322
+ ## Endpoint Configurations
323
+
324
+
325
+ |Name|Description|Default|Type|
326
+ |---|---|---|---|
327
+ |account|The account to use||string|
328
+ |share|The share to use||string|
329
+ |port|Port of the FTP server||integer|
330
+ |directoryName|The starting directory||string|
331
+ |credentialType|Determines the credential strategy to adopt|SHARED\_ACCOUNT\_KEY|object|
332
+ |disconnect|Whether or not to disconnect from remote FTP server right after use. Disconnect will only disconnect the current connection to the FTP server. If you have a consumer which you want to stop, then you need to stop the consumer/route instead.|false|boolean|
333
+ |doneFileName|Producer: If provided, then Camel will write a 2nd done file when the original file has been written. The done file will be empty. This option configures what file name to use. Either you can specify a fixed name. Or you can use dynamic placeholders. The done file will always be written in the same folder as the original file. Consumer: If provided, Camel will only consume files if a done file exists. This option configures what file name to use. Either you can specify a fixed name. Or you can use dynamic placeholders.The done file is always expected in the same folder as the original file. Only ${file.name} and ${file.name.next} is supported as dynamic placeholders.||string|
334
+ |fileName|Use Expression such as File Language to dynamically set the filename. For consumers, it's used as a filename filter. For producers, it's used to evaluate the filename to write. If an expression is set, it take precedence over the CamelFileName header. (Note: The header itself can also be an Expression). The expression options support both String and Expression types. If the expression is a String type, it is always evaluated using the File Language. If the expression is an Expression type, the specified Expression type is used - this allows you, for instance, to use OGNL expressions. For the consumer, you can use it to filter filenames, so you can for instance consume today's file using the File Language syntax: mydata-${date:now:yyyyMMdd}.txt. The producers support the CamelOverruleFileName header which takes precedence over any existing CamelFileName header; the CamelOverruleFileName is a header that is used only once, and makes it easier as this avoids to temporary store CamelFileName and have to restore it afterwards.||string|
335
+ |sharedKey|Shared key (storage account key)||string|
336
+ |delete|If true, the file will be deleted after it is processed successfully.|false|boolean|
337
+ |moveFailed|Sets the move failure expression based on Simple language. For example, to move files into a .error subdirectory use: .error. Note: When moving the files to the fail location Camel will handle the error and will not pick up the file again.||string|
338
+ |noop|If true, the file is not moved or deleted in any way. This option is good for readonly data, or for ETL type requirements. If noop=true, Camel will set idempotent=true as well, to avoid consuming the same files over and over again.|false|boolean|
339
+ |preMove|Expression (such as File Language) used to dynamically set the filename when moving it before processing. For example to move in-progress files into the order directory set this value to order.||string|
340
+ |preSort|When pre-sort is enabled then the consumer will sort the file and directory names during polling, that was retrieved from the file system. You may want to do this in case you need to operate on the files in a sorted order. The pre-sort is executed before the consumer starts to filter, and accept files to process by Camel. This option is default=false meaning disabled.|false|boolean|
341
+ |recursive|If a directory, will look for files in all the sub-directories as well.|false|boolean|
342
+ |resumeDownload|Configures whether resume download is enabled. In addition the options localWorkDirectory must be configured so downloaded files are stored in a local directory, which is required to support resuming of downloads.|false|boolean|
343
+ |sendEmptyMessageWhenIdle|If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead.|false|boolean|
344
+ |streamDownload|Sets the download method to use when not using a local working directory. If set to true, the remote files are streamed to the route as they are read. When set to false, the remote files are loaded into memory before being sent into the route. If enabling this option then you must set stepwise=false as both cannot be enabled at the same time.|false|boolean|
345
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
346
+ |download|Whether the FTP consumer should download the file. If this option is set to false, then the message body will be null, but the consumer will still trigger a Camel Exchange that has details about the file such as file name, file size, etc. It's just that the file will not be downloaded.|false|boolean|
347
+ |exceptionHandler|To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.||object|
348
+ |exchangePattern|Sets the exchange pattern when the consumer creates an exchange.||object|
349
+ |inProgressRepository|A pluggable in-progress repository org.apache.camel.spi.IdempotentRepository. The in-progress repository is used to account the current in progress files being consumed. By default a memory based repository is used.||object|
350
+ |localWorkDirectory|When consuming, a local work directory can be used to store the remote file content directly in local files, to avoid loading the content into memory. This is beneficial, if you consume a very big remote file and thus can conserve memory.||string|
351
+ |onCompletionExceptionHandler|To use a custom org.apache.camel.spi.ExceptionHandler to handle any thrown exceptions that happens during the file on completion process where the consumer does either a commit or rollback. The default implementation will log any exception at WARN level and ignore.||object|
352
+ |pollStrategy|A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel.||object|
353
+ |processStrategy|A pluggable org.apache.camel.component.file.GenericFileProcessStrategy allowing you to implement your own readLock option or similar. Can also be used when special conditions must be met before a file can be consumed, such as a special ready file exists. If this option is set then the readLock option does not apply.||object|
354
+ |checksumFileAlgorithm|If provided, then Camel will write a checksum file when the original file has been written. The checksum file will contain the checksum created with the provided algorithm for the original file. The checksum file will always be written in the same folder as the original file.||string|
355
+ |fileExist|What to do if a file already exists with the same name. Override, which is the default, replaces the existing file. - Append - adds content to the existing file. - Fail - throws a GenericFileOperationException, indicating that there is already an existing file. - Ignore - silently ignores the problem and does not override the existing file, but assumes everything is okay. - Move - option requires to use the moveExisting option to be configured as well. The option eagerDeleteTargetFile can be used to control what to do if an moving the file, and there exists already an existing file, otherwise causing the move operation to fail. The Move option will move any existing files, before writing the target file. - TryRename is only applicable if tempFileName option is in use. This allows to try renaming the file from the temporary name to the actual name, without doing any exists check. This check may be faster on some file systems and especially FTP servers.|Override|object|
356
+ |flatten|Flatten is used to flatten the file name path to strip any leading paths, so it's just the file name. This allows you to consume recursively into sub-directories, but when you eg write the files to another directory they will be written in a single directory. Setting this to true on the producer enforces that any file name in CamelFileName header will be stripped for any leading paths.|false|boolean|
357
+ |jailStartingDirectory|Used for jailing (restricting) writing files to the starting directory (and sub) only. This is enabled by default to not allow Camel to write files to outside directories (to be more secured out of the box). You can turn this off to allow writing files to directories outside the starting directory, such as parent or root folders.|true|boolean|
358
+ |tempFileName|The same as tempPrefix option but offering a more fine grained control on the naming of the temporary filename as it uses the File Language. The location for tempFilename is relative to the final file location in the option 'fileName', not the target directory in the base uri. For example if option fileName includes a directory prefix: dir/finalFilename then tempFileName is relative to that subdirectory dir.||string|
359
+ |tempPrefix|This option is used to write the file using a temporary name and then, after the write is complete, rename it to the real name. Can be used to identify files being written and also avoid consumers (not using exclusive read locks) reading in progress files. Is often used by FTP when uploading big files.||string|
360
+ |allowNullBody|Used to specify if a null body is allowed during file writing. If set to true then an empty file will be created, when set to false, and attempting to send a null body to the file component, a GenericFileWriteException of 'Cannot write null body to file.' will be thrown. If the fileExist option is set to 'Override', then the file will be truncated, and if set to append the file will remain unchanged.|false|boolean|
361
+ |disconnectOnBatchComplete|Whether or not to disconnect from remote FTP server right after a Batch upload is complete. disconnectOnBatchComplete will only disconnect the current connection to the FTP server.|false|boolean|
362
+ |eagerDeleteTargetFile|Whether or not to eagerly delete any existing target file. This option only applies when you use fileExists=Override and the tempFileName option as well. You can use this to disable (set it to false) deleting the target file before the temp file is written. For example you may write big files and want the target file to exists during the temp file is being written. This ensure the target file is only deleted until the very last moment, just before the temp file is being renamed to the target filename. This option is also used to control whether to delete any existing files when fileExist=Move is enabled, and an existing file exists. If this option copyAndDeleteOnRenameFails false, then an exception will be thrown if an existing file existed, if its true, then the existing file is deleted before the move operation.|true|boolean|
363
+ |keepLastModified|Will keep the last modified timestamp from the source file (if any). Will use the FileConstants.FILE\_LAST\_MODIFIED header to located the timestamp. This header can contain either a java.util.Date or long with the timestamp. If the timestamp exists and the option is enabled it will set this timestamp on the written file. Note: This option only applies to the file producer. You cannot use this option with any of the ftp producers.|false|boolean|
364
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
365
+ |moveExistingFileStrategy|Strategy (Custom Strategy) used to move file with special naming token to use when fileExist=Move is configured. By default, there is an implementation used if no custom strategy is provided||object|
366
+ |autoCreate|Automatically create missing directories in the file's pathname. For the file consumer, that means creating the starting directory. For the file producer, it means the directory the files should be written to.|true|boolean|
367
+ |connectTimeout|Sets the connect timeout for waiting for a connection to be established Used by both FTPClient and JSCH|10000|duration|
368
+ |maximumReconnectAttempts|Specifies the maximum reconnect attempts Camel performs when it tries to connect to the remote FTP server. Use 0 to disable this behavior.||integer|
369
+ |reconnectDelay|Delay in millis Camel will wait before performing a reconnect attempt.|1000|duration|
370
+ |throwExceptionOnConnectFailed|Should an exception be thrown if connection failed (exhausted)By default exception is not thrown and a WARN is logged. You can use this to enable exception being thrown and handle the thrown exception from the org.apache.camel.spi.PollingConsumerPollStrategy rollback method.|false|boolean|
371
+ |timeout|Sets the data timeout for waiting for reply Used only by FTPClient|30000|duration|
372
+ |antExclude|Ant style filter exclusion. If both antInclude and antExclude are used, antExclude takes precedence over antInclude. Multiple exclusions may be specified in comma-delimited format.||string|
373
+ |antFilterCaseSensitive|Sets case sensitive flag on ant filter.|true|boolean|
374
+ |antInclude|Ant style filter inclusion. Multiple inclusions may be specified in comma-delimited format.||string|
375
+ |eagerMaxMessagesPerPoll|Allows for controlling whether the limit from maxMessagesPerPoll is eager or not. If eager then the limit is during the scanning of files. Where as false would scan all files, and then perform sorting. Setting this option to false allows for sorting all files first, and then limit the poll. Mind that this requires a higher memory usage as all file details are in memory to perform the sorting.|true|boolean|
376
+ |exclude|Is used to exclude files, if filename matches the regex pattern (matching is case in-sensitive). Notice if you use symbols such as plus sign and others you would need to configure this using the RAW() syntax if configuring this as an endpoint uri. See more details at configuring endpoint uris||string|
377
+ |excludeExt|Is used to exclude files matching file extension name (case insensitive). For example to exclude bak files, then use excludeExt=bak. Multiple extensions can be separated by comma, for example to exclude bak and dat files, use excludeExt=bak,dat. Note that the file extension includes all parts, for example having a file named mydata.tar.gz will have extension as tar.gz. For more flexibility then use the include/exclude options.||string|
378
+ |filter|Pluggable filter as a org.apache.camel.component.file.GenericFileFilter class. Will skip files if filter returns false in its accept() method.||object|
379
+ |filterDirectory|Filters the directory based on Simple language. For example to filter on current date, you can use a simple date pattern such as ${date:now:yyyMMdd}||string|
380
+ |filterFile|Filters the file based on Simple language. For example to filter on file size, you can use ${file:size} 5000||string|
381
+ |idempotent|Option to use the Idempotent Consumer EIP pattern to let Camel skip already processed files. Will by default use a memory based LRUCache that holds 1000 entries. If noop=true then idempotent will be enabled as well to avoid consuming the same files over and over again.|false|boolean|
382
+ |idempotentEager|Option to use the Idempotent Consumer EIP pattern to let Camel skip already processed files. Will by default use a memory based LRUCache that holds 1000 entries. If noop=true then idempotent will be enabled as well to avoid consuming the same files over and over again.|false|boolean|
383
+ |idempotentKey|To use a custom idempotent key. By default the absolute path of the file is used. You can use the File Language, for example to use the file name and file size, you can do: idempotentKey=${file:name}-${file:size}||string|
384
+ |idempotentRepository|A pluggable repository org.apache.camel.spi.IdempotentRepository which by default use MemoryIdempotentRepository if none is specified and idempotent is true.||object|
385
+ |include|Is used to include files, if filename matches the regex pattern (matching is case in-sensitive). Notice if you use symbols such as plus sign and others you would need to configure this using the RAW() syntax if configuring this as an endpoint uri. See more details at configuring endpoint uris||string|
386
+ |includeExt|Is used to include files matching file extension name (case insensitive). For example to include txt files, then use includeExt=txt. Multiple extensions can be separated by comma, for example to include txt and xml files, use includeExt=txt,xml. Note that the file extension includes all parts, for example having a file named mydata.tar.gz will have extension as tar.gz. For more flexibility then use the include/exclude options.||string|
387
+ |maxDepth|The maximum depth to traverse when recursively processing a directory.|2147483647|integer|
388
+ |maxMessagesPerPoll|To define a maximum messages to gather per poll. By default no maximum is set. Can be used to set a limit of e.g. 1000 to avoid when starting up the server that there are thousands of files. Set a value of 0 or negative to disabled it. Notice: If this option is in use then the File and FTP components will limit before any sorting. For example if you have 100000 files and use maxMessagesPerPoll=500, then only the first 500 files will be picked up, and then sorted. You can use the eagerMaxMessagesPerPoll option and set this to false to allow to scan all files first and then sort afterwards.||integer|
389
+ |minDepth|The minimum depth to start processing when recursively processing a directory. Using minDepth=1 means the base directory. Using minDepth=2 means the first sub directory.||integer|
390
+ |move|Expression (such as Simple Language) used to dynamically set the filename when moving it after processing. To move files into a .done subdirectory just enter .done.||string|
391
+ |exclusiveReadLockStrategy|Pluggable read-lock as a org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy implementation.||object|
392
+ |readLock|Used by consumer, to only poll the files if it has exclusive read-lock on the file (i.e. the file is not in-progress or being written). Camel will wait until the file lock is granted. This option provides the build in strategies: - none - No read lock is in use - markerFile - Camel creates a marker file (fileName.camelLock) and then holds a lock on it. This option is not available for the FTP component - changed - Changed is using file length/modification timestamp to detect whether the file is currently being copied or not. Will at least use 1 sec to determine this, so this option cannot consume files as fast as the others, but can be more reliable as the JDK IO API cannot always determine whether a file is currently being used by another process. The option readLockCheckInterval can be used to set the check frequency. - fileLock - is for using java.nio.channels.FileLock. This option is not avail for Windows OS and the FTP component. This approach should be avoided when accessing a remote file system via a mount/share unless that file system supports distributed file locks. - rename - rename is for using a try to rename the file as a test if we can get exclusive read-lock. - idempotent - (only for file component) idempotent is for using a idempotentRepository as the read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. - idempotent-changed - (only for file component) idempotent-changed is for using a idempotentRepository and changed as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. - idempotent-rename - (only for file component) idempotent-rename is for using a idempotentRepository and rename as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that.Notice: The various read locks is not all suited to work in clustered mode, where concurrent consumers on different nodes is competing for the same files on a shared file system. The markerFile using a close to atomic operation to create the empty marker file, but its not guaranteed to work in a cluster. The fileLock may work better but then the file system need to support distributed file locks, and so on. Using the idempotent read lock can support clustering if the idempotent repository supports clustering, such as Hazelcast Component or Infinispan.|none|string|
393
+ |readLockCheckInterval|Interval in millis for the read-lock, if supported by the read lock. This interval is used for sleeping between attempts to acquire the read lock. For example when using the changed read lock, you can set a higher interval period to cater for slow writes. The default of 1 sec. may be too fast if the producer is very slow writing the file. Notice: For FTP the default readLockCheckInterval is 5000. The readLockTimeout value must be higher than readLockCheckInterval, but a rule of thumb is to have a timeout that is at least 2 or more times higher than the readLockCheckInterval. This is needed to ensure that ample time is allowed for the read lock process to try to grab the lock before the timeout was hit.|1000|integer|
394
+ |readLockDeleteOrphanLockFiles|Whether or not read lock with marker files should upon startup delete any orphan read lock files, which may have been left on the file system, if Camel was not properly shutdown (such as a JVM crash). If turning this option to false then any orphaned lock file will cause Camel to not attempt to pickup that file, this could also be due another node is concurrently reading files from the same shared directory.|true|boolean|
395
+ |readLockLoggingLevel|Logging level used when a read lock could not be acquired. By default a DEBUG is logged. You can change this level, for example to OFF to not have any logging. This option is only applicable for readLock of types: changed, fileLock, idempotent, idempotent-changed, idempotent-rename, rename.|DEBUG|object|
396
+ |readLockMarkerFile|Whether to use marker file with the changed, rename, or exclusive read lock types. By default a marker file is used as well to guard against other processes picking up the same files. This behavior can be turned off by setting this option to false. For example if you do not want to write marker files to the file systems by the Camel application.|true|boolean|
397
+ |readLockMinAge|This option is applied only for readLock=changed. It allows to specify a minimum age the file must be before attempting to acquire the read lock. For example use readLockMinAge=300s to require the file is at last 5 minutes old. This can speedup the changed read lock as it will only attempt to acquire files which are at least that given age.|0|integer|
398
+ |readLockMinLength|This option is applied only for readLock=changed. It allows you to configure a minimum file length. By default Camel expects the file to contain data, and thus the default value is 1. You can set this option to zero, to allow consuming zero-length files.|1|integer|
399
+ |readLockRemoveOnCommit|This option is applied only for readLock=idempotent. It allows to specify whether to remove the file name entry from the idempotent repository when processing the file is succeeded and a commit happens. By default the file is not removed which ensures that any race-condition do not occur so another active node may attempt to grab the file. Instead the idempotent repository may support eviction strategies that you can configure to evict the file name entry after X minutes - this ensures no problems with race conditions. See more details at the readLockIdempotentReleaseDelay option.|false|boolean|
400
+ |readLockRemoveOnRollback|This option is applied only for readLock=idempotent. It allows to specify whether to remove the file name entry from the idempotent repository when processing the file failed and a rollback happens. If this option is false, then the file name entry is confirmed (as if the file did a commit).|true|boolean|
401
+ |readLockTimeout|Optional timeout in millis for the read-lock, if supported by the read-lock. If the read-lock could not be granted and the timeout triggered, then Camel will skip the file. At next poll Camel, will try the file again, and this time maybe the read-lock could be granted. Use a value of 0 or lower to indicate forever. Currently fileLock, changed and rename support the timeout. Notice: For FTP the default readLockTimeout value is 20000 instead of 10000. The readLockTimeout value must be higher than readLockCheckInterval, but a rule of thumb is to have a timeout that is at least 2 or more times higher than the readLockCheckInterval. This is needed to ensure that ample time is allowed for the read lock process to try to grab the lock before the timeout was hit.|10000|integer|
402
+ |backoffErrorThreshold|The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in.||integer|
403
+ |backoffIdleThreshold|The number of subsequent idle polls that should happen before the backoffMultipler should kick-in.||integer|
404
+ |backoffMultiplier|To let the scheduled polling consumer backoff if there has been a number of subsequent idles/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and/or backoffErrorThreshold must also be configured.||integer|
405
+ |delay|Milliseconds before the next poll.|500|integer|
406
+ |greedy|If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages.|false|boolean|
407
+ |initialDelay|Milliseconds before the first poll starts.|1000|integer|
408
+ |repeatCount|Specifies a maximum limit of number of fires. So if you set it to 1, the scheduler will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever.|0|integer|
409
+ |runLoggingLevel|The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that.|TRACE|object|
410
+ |scheduledExecutorService|Allows for configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool.||object|
411
+ |scheduler|To use a cron scheduler from either camel-spring or camel-quartz component. Use value spring or quartz for built in scheduler|none|object|
412
+ |schedulerProperties|To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler.||object|
413
+ |startScheduler|Whether the scheduler should be auto started.|true|boolean|
414
+ |timeUnit|Time unit for initialDelay and delay options.|MILLISECONDS|object|
415
+ |useFixedDelay|Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details.|true|boolean|
416
+ |sdd|part of service SAS token||string|
417
+ |se|part of SAS token||string|
418
+ |si|part of service SAS token||string|
419
+ |sig|part of SAS token||string|
420
+ |sip|part of SAS token||string|
421
+ |sp|part of SAS token||string|
422
+ |spr|part of SAS token||string|
423
+ |sr|part of service SAS token||string|
424
+ |srt|part of SAS token||string|
425
+ |ss|part of account SAS token||string|
426
+ |st|part of SAS token||string|
427
+ |sv|part of SAS token||string|
428
+ |shuffle|To shuffle the list of files (sort in random order)|false|boolean|
429
+ |sortBy|Built-in sort by using the File Language. Supports nested sorts, so you can have a sort by file name and as a 2nd group sort by modified date.||string|
430
+ |sorter|Pluggable sorter as a java.util.Comparator class.||object|
camel-azure-key-vault.md ADDED
@@ -0,0 +1,298 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Azure-key-vault
2
+
3
+ **Since Camel 3.17**
4
+
5
+ **Only producer is supported**
6
+
7
+ The azure-key-vault component that integrates [Azure Key
8
+ Vault](https://azure.microsoft.com/en-us/services/key-vault/).
9
+
10
+ Prerequisites
11
+
12
+ You must have a valid Windows Azure Key Vault account. More information
13
+ is available at [Azure Documentation
14
+ Portal](https://docs.microsoft.com/azure/).
15
+
16
+ # URI Format
17
+
18
+ <dependency>
19
+ <groupId>org.apache.camel</groupId>
20
+ <artifactId>camel-azure-key-vault</artifactId>
21
+ <version>x.x.x</version>
22
+ <!-- use the same version as your Camel core version -->
23
+ </dependency>
24
+
25
+ # Usage
26
+
27
+ ## Using Azure Key Vault Property Function
28
+
29
+ To use this function, you’ll need to provide credentials to Azure Key
30
+ Vault Service as environment variables:
31
+
32
+ export $CAMEL_VAULT_AZURE_TENANT_ID=tenantId
33
+ export $CAMEL_VAULT_AZURE_CLIENT_ID=clientId
34
+ export $CAMEL_VAULT_AZURE_CLIENT_SECRET=clientSecret
35
+ export $CAMEL_VAULT_AZURE_VAULT_NAME=vaultName
36
+
37
+ You can also configure the credentials in the `application.properties`
38
+ file such as:
39
+
40
+ camel.vault.azure.tenantId = accessKey
41
+ camel.vault.azure.clientId = clientId
42
+ camel.vault.azure.clientSecret = clientSecret
43
+ camel.vault.azure.vaultName = vaultName
44
+
45
+ Or you can enable the usage of Azure Identity in the following way:
46
+
47
+ export $CAMEL_VAULT_AZURE_IDENTITY_ENABLED=true
48
+ export $CAMEL_VAULT_AZURE_VAULT_NAME=vaultName
49
+
50
+ You can also enable the usage of Azure Identity in the
51
+ `application.properties` file such as:
52
+
53
+ camel.vault.azure.azureIdentityEnabled = true
54
+ camel.vault.azure.vaultName = vaultName
55
+
56
+ At this point, you’ll be able to reference a property in the following
57
+ way:
58
+
59
+ <camelContext>
60
+ <route>
61
+ <from uri="direct:start"/>
62
+ <to uri="{{azure:route}}"/>
63
+ </route>
64
+ </camelContext>
65
+
66
+ Where route will be the name of the secret stored in the Azure Key Vault
67
+ Service.
68
+
69
+ You could specify a default value in case the secret is not present on
70
+ Azure Key Vault Service:
71
+
72
+ <camelContext>
73
+ <route>
74
+ <from uri="direct:start"/>
75
+ <to uri="{{azure:route:default}}"/>
76
+ </route>
77
+ </camelContext>
78
+
79
+ In this case, if the secret doesn’t exist, the property will fall back
80
+ to "default" as value.
81
+
82
+ Also, you are able to get a particular field of the secret, if you have,
83
+ for example, a secret named database of this form:
84
+
85
+ {
86
+ "username": "admin",
87
+ "password": "password123",
88
+ "engine": "postgres",
89
+ "host": "127.0.0.1",
90
+ "port": "3128",
91
+ "dbname": "db"
92
+ }
93
+
94
+ You’re able to do get single secret value in your route, like for
95
+ example:
96
+
97
+ <camelContext>
98
+ <route>
99
+ <from uri="direct:start"/>
100
+ <log message="Username is {{azure:database/username}}"/>
101
+ </route>
102
+ </camelContext>
103
+
104
+ Or re-use the property as part of an endpoint.
105
+
106
+ You could specify a default value in case the particular field of secret
107
+ is not present on Azure Key Vault:
108
+
109
+ <camelContext>
110
+ <route>
111
+ <from uri="direct:start"/>
112
+ <log message="Username is {{azure:database/username:admin}}"/>
113
+ </route>
114
+ </camelContext>
115
+
116
+ In this case, if the secret doesn’t exist or the secret exists, but the
117
+ username field is not part of the secret, the property will fall back to
118
+ "admin" as value.
119
+
120
+ There is also the syntax to get a particular version of the secret for
121
+ both the approach, with field/default value specified or only with
122
+ secret:
123
+
124
+ <camelContext>
125
+ <route>
126
+ <from uri="direct:start"/>
127
+ <to uri="{{azure:route@bf9b4f4b-8e63-43fd-a73c-3e2d3748b451}}"/>
128
+ </route>
129
+ </camelContext>
130
+
131
+ This approach will return the RAW route secret with the version
132
+ *bf9b4f4b-8e63-43fd-a73c-3e2d3748b451*.
133
+
134
+ <camelContext>
135
+ <route>
136
+ <from uri="direct:start"/>
137
+ <to uri="{{azure:route:default@bf9b4f4b-8e63-43fd-a73c-3e2d3748b451}}"/>
138
+ </route>
139
+ </camelContext>
140
+
141
+ This approach will return the route secret value with version
142
+ *bf9b4f4b-8e63-43fd-a73c-3e2d3748b451* or default value in case the
143
+ secret doesn’t exist or the version doesn’t exist.
144
+
145
+ <camelContext>
146
+ <route>
147
+ <from uri="direct:start"/>
148
+ <log message="Username is {{azure:database/username:admin@bf9b4f4b-8e63-43fd-a73c-3e2d3748b451}}"/>
149
+ </route>
150
+ </camelContext>
151
+
152
+ This approach will return the username field of the database secret with
153
+ version *bf9b4f4b-8e63-43fd-a73c-3e2d3748b451* or admin in case the
154
+ secret doesn’t exist or the version doesn’t exist.
155
+
156
+ For the moment we are not considering the rotation function if any are
157
+ applied, but it is in the work to be done.
158
+
159
+ The only requirement is adding the camel-azure-key-vault jar to your
160
+ Camel application.
161
+
162
+ ## Automatic Camel context reloading on Secret Refresh
163
+
164
+ Being able to reload Camel context on a Secret Refresh could be done by
165
+ specifying the usual credentials (the same used for Azure Key Vault
166
+ Property Function).
167
+
168
+ With Environment variables:
169
+
170
+ export $CAMEL_VAULT_AZURE_TENANT_ID=tenantId
171
+ export $CAMEL_VAULT_AZURE_CLIENT_ID=clientId
172
+ export $CAMEL_VAULT_AZURE_CLIENT_SECRET=clientSecret
173
+ export $CAMEL_VAULT_AZURE_VAULT_NAME=vaultName
174
+
175
+ or as plain Camel main properties:
176
+
177
+ camel.vault.azure.tenantId = accessKey
178
+ camel.vault.azure.clientId = clientId
179
+ camel.vault.azure.clientSecret = clientSecret
180
+ camel.vault.azure.vaultName = vaultName
181
+
182
+ If you want to use Azure Identity with environment variables, you can do
183
+ in the following way:
184
+
185
+ export $CAMEL_VAULT_AZURE_IDENTITY_ENABLED=true
186
+ export $CAMEL_VAULT_AZURE_VAULT_NAME=vaultName
187
+
188
+ You can also enable the usage of Azure Identity in the
189
+ `application.properties` file such as:
190
+
191
+ camel.vault.azure.azureIdentityEnabled = true
192
+ camel.vault.azure.vaultName = vaultName
193
+
194
+ To enable the automatic refresh, you’ll need additional properties to
195
+ set:
196
+
197
+ camel.vault.azure.refreshEnabled=true
198
+ camel.vault.azure.refreshPeriod=60000
199
+ camel.vault.azure.secrets=Secret
200
+ camel.vault.azure.eventhubConnectionString=eventhub_conn_string
201
+ camel.vault.azure.blobAccountName=blob_account_name
202
+ camel.vault.azure.blobContainerName=blob_container_name
203
+ camel.vault.azure.blobAccessKey=blob_access_key
204
+ camel.main.context-reload-enabled = true
205
+
206
+ where `camel.vault.azure.refreshEnabled` will enable the automatic
207
+ context reload, `camel.vault.azure.refreshPeriod` is the interval of
208
+ time between two different checks for update events and
209
+ `camel.vault.azure.secrets` is a regex representing the secrets we want
210
+ to track for updates.
211
+
212
+ where `camel.vault.azure.eventhubConnectionString` is the eventhub
213
+ connection string to get notification from,
214
+ `camel.vault.azure.blobAccountName`,
215
+ `camel.vault.azure.blobContainerName` and
216
+ `camel.vault.azure.blobAccessKey` are the Azure Storage Blob parameters
217
+ for the checkpoint store needed by Azure Eventhub.
218
+
219
+ Note that `camel.vault.azure.secrets` is not mandatory: if not specified
220
+ the task responsible for checking updates events will take into accounts
221
+ or the properties with an `azure:` prefix.
222
+
223
+ The only requirement is adding the camel-azure-key-vault jar to your
224
+ Camel application.
225
+
226
+ ## Azure Key Vault Producer operations
227
+
228
+ Azure Key Vault component provides the following operation on the
229
+ producer side:
230
+
231
+ - createSecret
232
+
233
+ - getSecret
234
+
235
+ - deleteSecret
236
+
237
+ - purgeDeletedSecret
238
+
239
+ # Examples
240
+
241
+ ## Producer Examples
242
+
243
+ - createSecret: this operation will create a secret in Azure Key Vault
244
+
245
+ <!-- -->
246
+
247
+ from("direct:createSecret")
248
+ .setHeader(KeyVaultConstants.SECRET_NAME, "Test")
249
+ .setBody(constant("Test"))
250
+ .to("azure-key-vault://test123?clientId=RAW({{clientId}})&clientSecret=RAW({{clientSecret}})&tenantId=RAW({{tenantId}})")
251
+
252
+ - getSecret: this operation will get a secret from Azure Key Vault
253
+
254
+ <!-- -->
255
+
256
+ from("direct:getSecret")
257
+ .setHeader(KeyVaultConstants.SECRET_NAME, "Test")
258
+ .to("azure-key-vault://test123?clientId=RAW({{clientId}})&clientSecret=RAW({{clientSecret}})&tenantId=RAW({{tenantId}})&operation=getSecret")
259
+
260
+ - deleteSecret: this operation will delete a Secret from Azure Key
261
+ Vault
262
+
263
+ <!-- -->
264
+
265
+ from("direct:deleteSecret")
266
+ .setHeader(KeyVaultConstants.SECRET_NAME, "Test")
267
+ .to("azure-key-vault://test123?clientId=RAW({{clientId}})&clientSecret=RAW({{clientSecret}})&tenantId=RAW({{tenantId}})&operation=deleteSecret")
268
+
269
+ - purgeDeletedSecret: this operation will purge a deleted Secret from
270
+ Azure Key Vault
271
+
272
+ <!-- -->
273
+
274
+ from("direct:purgeDeletedSecret")
275
+ .setHeader(KeyVaultConstants.SECRET_NAME, "Test")
276
+ .to("azure-key-vault://test123?clientId=RAW({{clientId}})&clientSecret=RAW({{clientSecret}})&tenantId=RAW({{tenantId}})&operation=purgeDeletedSecret")
277
+
278
+ ## Component Configurations
279
+
280
+
281
+ |Name|Description|Default|Type|
282
+ |---|---|---|---|
283
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
284
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
285
+
286
+ ## Endpoint Configurations
287
+
288
+
289
+ |Name|Description|Default|Type|
290
+ |---|---|---|---|
291
+ |vaultName|Vault Name to be used||string|
292
+ |credentialType|Determines the credential strategy to adopt|CLIENT\_SECRET|object|
293
+ |operation|Operation to be performed||object|
294
+ |secretClient|Instance of Secret client||object|
295
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
296
+ |clientId|Client Id to be used||string|
297
+ |clientSecret|Client Secret to be used||string|
298
+ |tenantId|Tenant Id to be used||string|
camel-azure-servicebus.md ADDED
@@ -0,0 +1,246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Azure-servicebus
2
+
3
+ **Since Camel 3.12**
4
+
5
+ **Both producer and consumer are supported**
6
+
7
+ The azure-servicebus component that integrates [Azure
8
+ ServiceBus](https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-messaging-overview).
9
+ Azure ServiceBus is a fully managed enterprise integration message
10
+ broker. Service Bus can decouple applications and services. Service Bus
11
+ offers a reliable and secure platform for asynchronous transfer of data
12
+ and state. Data is transferred between different applications and
13
+ services using messages.
14
+
15
+ Prerequisites
16
+
17
+ You must have a valid Windows Azure Storage account. More information is
18
+ available at [Azure Documentation
19
+ Portal](https://docs.microsoft.com/azure/).
20
+
21
+ <dependency>
22
+ <groupId>org.apache.camel</groupId>
23
+ <artifactId>camel-azure-servicebus</artifactId>
24
+ <version>x.x.x</version>
25
+ <!-- use the same version as your Camel core version -->
26
+ </dependency>
27
+
28
+ # Consumer and Producer
29
+
30
+ This component implements the Consumer and Producer.
31
+
32
+ # Usage
33
+
34
+ ## Authentication Information
35
+
36
+ You have three different Credential Types: AZURE\_IDENTITY,
37
+ TOKEN\_CREDENTIAL and CONNECTION\_STRING. You can also provide a client
38
+ instance yourself. To use this component, you have three options to
39
+ provide the required Azure authentication information:
40
+
41
+ **CONNECTION\_STRING**:
42
+
43
+ - Provide `connectionString` string it is the simplest option to get
44
+ started.
45
+
46
+ **TOKEN\_CREDENTIAL**:
47
+
48
+ - Provide an implementation of
49
+ `com.azure.core.credential.TokenCredential` into the Camel’s
50
+ Registry, e.g., using the
51
+ `com.azure.identity.DefaultAzureCredentialBuilder().build();` API.
52
+ See the documentation [here about Azure-AD
53
+ authentication](https://docs.microsoft.com/en-us/azure/active-directory/authentication/overview-authentication).
54
+
55
+ **AZURE\_IDENTITY**:
56
+
57
+ - This will use
58
+ `com.azure.identity.DefaultAzureCredentialBuilder().build();`
59
+ instance. This will follow the Default Azure Credential Chain. See
60
+ the documentation [here about Azure-AD
61
+ authentication](https://docs.microsoft.com/en-us/azure/active-directory/authentication/overview-authentication).
62
+
63
+ **Client instance**:
64
+
65
+ - You can provide a
66
+ `com.azure.messaging.servicebus.ServiceBusSenderClient` for sending
67
+ message and/or
68
+ `com.azure.messaging.servicebus.ServiceBusReceiverClient` to receive
69
+ messages. If you provide the instances, they will be autowired.
70
+
71
+ ## Message Body
72
+
73
+ In the producer, this component accepts message body of `String`,
74
+ `byte[]` and `BinaryData` types or `List<String>`, `List<byte[]>` and
75
+ `List<BinaryData>` to send batch messages.
76
+
77
+ In the consumer, the returned message body will be of type \`String.
78
+
79
+ ## Azure ServiceBus Producer operations
80
+
81
+ <table>
82
+ <colgroup>
83
+ <col style="width: 10%" />
84
+ <col style="width: 89%" />
85
+ </colgroup>
86
+ <thead>
87
+ <tr>
88
+ <th style="text-align: left;">Operation</th>
89
+ <th style="text-align: left;">Description</th>
90
+ </tr>
91
+ </thead>
92
+ <tbody>
93
+ <tr>
94
+ <td style="text-align: left;"><p><code>sendMessages</code></p></td>
95
+ <td style="text-align: left;"><p>Sends a set of messages to a Service
96
+ Bus queue or topic using a batched approach.</p></td>
97
+ </tr>
98
+ <tr>
99
+ <td style="text-align: left;"><p><code>scheduleMessages</code></p></td>
100
+ <td style="text-align: left;"><p>Sends a scheduled message to the Azure
101
+ Service Bus entity this sender is connected to. A scheduled message is
102
+ enqueued and made available to receivers only at the scheduled enqueue
103
+ time.</p></td>
104
+ </tr>
105
+ </tbody>
106
+ </table>
107
+
108
+ ## Azure ServiceBus Consumer operations
109
+
110
+ <table>
111
+ <colgroup>
112
+ <col style="width: 10%" />
113
+ <col style="width: 89%" />
114
+ </colgroup>
115
+ <thead>
116
+ <tr>
117
+ <th style="text-align: left;">Operation</th>
118
+ <th style="text-align: left;">Description</th>
119
+ </tr>
120
+ </thead>
121
+ <tbody>
122
+ <tr>
123
+ <td style="text-align: left;"><p><code>receiveMessages</code></p></td>
124
+ <td style="text-align: left;"><p>Receives an &lt;b&gt;infinite&lt;/b&gt;
125
+ stream of messages from the Service Bus entity.</p></td>
126
+ </tr>
127
+ <tr>
128
+ <td style="text-align: left;"><p><code>peekMessages</code></p></td>
129
+ <td style="text-align: left;"><p>Reads the next batch of active messages
130
+ without changing the state of the receiver or the message
131
+ source.</p></td>
132
+ </tr>
133
+ </tbody>
134
+ </table>
135
+
136
+ ### Examples
137
+
138
+ - `sendMessages`
139
+
140
+ <!-- -->
141
+
142
+ from("direct:start")
143
+ .process(exchange -> {
144
+ final List<Object> inputBatch = new LinkedList<>();
145
+ inputBatch.add("test batch 1");
146
+ inputBatch.add("test batch 2");
147
+ inputBatch.add("test batch 3");
148
+ inputBatch.add(123456);
149
+
150
+ exchange.getIn().setBody(inputBatch);
151
+ })
152
+ .to("azure-servicebus:test//?connectionString=test")
153
+ .to("mock:result");
154
+
155
+ - `scheduleMessages`
156
+
157
+ <!-- -->
158
+
159
+ from("direct:start")
160
+ .process(exchange -> {
161
+ final List<Object> inputBatch = new LinkedList<>();
162
+ inputBatch.add("test batch 1");
163
+ inputBatch.add("test batch 2");
164
+ inputBatch.add("test batch 3");
165
+ inputBatch.add(123456);
166
+
167
+ exchange.getIn().setHeader(ServiceBusConstants.SCHEDULED_ENQUEUE_TIME, OffsetDateTime.now());
168
+ exchange.getIn().setBody(inputBatch);
169
+ })
170
+ .to("azure-servicebus:test//?connectionString=test&producerOperation=scheduleMessages")
171
+ .to("mock:result");
172
+
173
+ - `receiveMessages`
174
+
175
+ <!-- -->
176
+
177
+ from("azure-servicebus:test//?connectionString=test")
178
+ .log("${body}")
179
+ .to("mock:result");
180
+
181
+ ## Component Configurations
182
+
183
+
184
+ |Name|Description|Default|Type|
185
+ |---|---|---|---|
186
+ |amqpRetryOptions|Sets the retry options for Service Bus clients. If not specified, the default retry options are used.||object|
187
+ |amqpTransportType|Sets the transport type by which all the communication with Azure Service Bus occurs. Default value is AMQP.|AMQP|object|
188
+ |clientOptions|Sets the ClientOptions to be sent from the client built from this builder, enabling customization of certain properties, as well as support the addition of custom header information.||object|
189
+ |configuration|The component configurations||object|
190
+ |headerFilterStrategy|To use a custom HeaderFilterStrategy to filter Service Bus application properties to and from Camel message headers.||object|
191
+ |proxyOptions|Sets the proxy configuration to use for ServiceBusSenderClient. When a proxy is configured, AMQP\_WEB\_SOCKETS must be used for the transport type.||object|
192
+ |serviceBusType|The service bus type of connection to execute. Queue is for typical queue option and topic for subscription based model.|queue|object|
193
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
194
+ |enableDeadLettering|Enable application level deadlettering to the subscription deadletter subqueue if deadletter related headers are set.|false|boolean|
195
+ |maxAutoLockRenewDuration|Sets the amount of time to continue auto-renewing the lock. Setting ZERO disables auto-renewal. For ServiceBus receive mode (RECEIVE\_AND\_DELETE RECEIVE\_AND\_DELETE), auto-renewal is disabled.|5m|object|
196
+ |maxConcurrentCalls|Sets maximum number of concurrent calls|1|integer|
197
+ |prefetchCount|Sets the prefetch count of the receiver. For both PEEK\_LOCK PEEK\_LOCK and RECEIVE\_AND\_DELETE RECEIVE\_AND\_DELETE receive modes the default value is 1. Prefetch speeds up the message flow by aiming to have a message readily available for local retrieval when and before the application asks for one using receive message. Setting a non-zero value will prefetch that number of messages. Setting the value to zero turns prefetch off.||integer|
198
+ |processorClient|Sets the processorClient in order to consume messages by the consumer||object|
199
+ |serviceBusReceiveMode|Sets the receive mode for the receiver.|PEEK\_LOCK|object|
200
+ |subQueue|Sets the type of the SubQueue to connect to.||object|
201
+ |subscriptionName|Sets the name of the subscription in the topic to listen to. topicOrQueueName and serviceBusType=topic must also be set. This property is required if serviceBusType=topic and the consumer is in use.||string|
202
+ |binary|Set binary mode. If true, message body will be sent as byte. By default, it is false.|false|boolean|
203
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
204
+ |producerOperation|Sets the desired operation to be used in the producer|sendMessages|object|
205
+ |scheduledEnqueueTime|Sets OffsetDateTime at which the message should appear in the Service Bus queue or topic.||object|
206
+ |senderClient|Sets senderClient to be used in the producer.||object|
207
+ |serviceBusTransactionContext|Represents transaction in service. This object just contains transaction id.||object|
208
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
209
+ |connectionString|Sets the connection string for a Service Bus namespace or a specific Service Bus resource.||string|
210
+ |credentialType|Determines the credential strategy to adopt|CONNECTION\_STRING|object|
211
+ |fullyQualifiedNamespace|Fully Qualified Namespace of the service bus||string|
212
+ |tokenCredential|A TokenCredential for Azure AD authentication.||object|
213
+
214
+ ## Endpoint Configurations
215
+
216
+
217
+ |Name|Description|Default|Type|
218
+ |---|---|---|---|
219
+ |topicOrQueueName|Selected topic name or the queue name, that is depending on serviceBusType config. For example if serviceBusType=queue, then this will be the queue name and if serviceBusType=topic, this will be the topic name.||string|
220
+ |amqpRetryOptions|Sets the retry options for Service Bus clients. If not specified, the default retry options are used.||object|
221
+ |amqpTransportType|Sets the transport type by which all the communication with Azure Service Bus occurs. Default value is AMQP.|AMQP|object|
222
+ |clientOptions|Sets the ClientOptions to be sent from the client built from this builder, enabling customization of certain properties, as well as support the addition of custom header information.||object|
223
+ |headerFilterStrategy|To use a custom HeaderFilterStrategy to filter Service Bus application properties to and from Camel message headers.||object|
224
+ |proxyOptions|Sets the proxy configuration to use for ServiceBusSenderClient. When a proxy is configured, AMQP\_WEB\_SOCKETS must be used for the transport type.||object|
225
+ |serviceBusType|The service bus type of connection to execute. Queue is for typical queue option and topic for subscription based model.|queue|object|
226
+ |enableDeadLettering|Enable application level deadlettering to the subscription deadletter subqueue if deadletter related headers are set.|false|boolean|
227
+ |maxAutoLockRenewDuration|Sets the amount of time to continue auto-renewing the lock. Setting ZERO disables auto-renewal. For ServiceBus receive mode (RECEIVE\_AND\_DELETE RECEIVE\_AND\_DELETE), auto-renewal is disabled.|5m|object|
228
+ |maxConcurrentCalls|Sets maximum number of concurrent calls|1|integer|
229
+ |prefetchCount|Sets the prefetch count of the receiver. For both PEEK\_LOCK PEEK\_LOCK and RECEIVE\_AND\_DELETE RECEIVE\_AND\_DELETE receive modes the default value is 1. Prefetch speeds up the message flow by aiming to have a message readily available for local retrieval when and before the application asks for one using receive message. Setting a non-zero value will prefetch that number of messages. Setting the value to zero turns prefetch off.||integer|
230
+ |processorClient|Sets the processorClient in order to consume messages by the consumer||object|
231
+ |serviceBusReceiveMode|Sets the receive mode for the receiver.|PEEK\_LOCK|object|
232
+ |subQueue|Sets the type of the SubQueue to connect to.||object|
233
+ |subscriptionName|Sets the name of the subscription in the topic to listen to. topicOrQueueName and serviceBusType=topic must also be set. This property is required if serviceBusType=topic and the consumer is in use.||string|
234
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
235
+ |exceptionHandler|To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.||object|
236
+ |exchangePattern|Sets the exchange pattern when the consumer creates an exchange.||object|
237
+ |binary|Set binary mode. If true, message body will be sent as byte. By default, it is false.|false|boolean|
238
+ |producerOperation|Sets the desired operation to be used in the producer|sendMessages|object|
239
+ |scheduledEnqueueTime|Sets OffsetDateTime at which the message should appear in the Service Bus queue or topic.||object|
240
+ |senderClient|Sets senderClient to be used in the producer.||object|
241
+ |serviceBusTransactionContext|Represents transaction in service. This object just contains transaction id.||object|
242
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
243
+ |connectionString|Sets the connection string for a Service Bus namespace or a specific Service Bus resource.||string|
244
+ |credentialType|Determines the credential strategy to adopt|CONNECTION\_STRING|object|
245
+ |fullyQualifiedNamespace|Fully Qualified Namespace of the service bus||string|
246
+ |tokenCredential|A TokenCredential for Azure AD authentication.||object|
camel-azure-storage-blob.md ADDED
@@ -0,0 +1,806 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Azure-storage-blob
2
+
3
+ **Since Camel 3.3**
4
+
5
+ **Both producer and consumer are supported**
6
+
7
+ The Azure Storage Blob component is used for storing and retrieving
8
+ blobs from [Azure Storage
9
+ Blob](https://azure.microsoft.com/services/storage/blobs/) Service using
10
+ **Azure APIs v12**. However, in the case of versions above v12, we will
11
+ see if this component can adopt these changes depending on how much
12
+ breaking changes can result.
13
+
14
+ Prerequisites
15
+
16
+ You must have a valid Windows Azure Storage account. More information is
17
+ available at [Azure Documentation
18
+ Portal](https://docs.microsoft.com/azure/).
19
+
20
+ Maven users will need to add the following dependency to their `pom.xml`
21
+ for this component:
22
+
23
+ <dependency>
24
+ <groupId>org.apache.camel</groupId>
25
+ <artifactId>camel-azure-storage-blob</artifactId>
26
+ <version>x.x.x</version>
27
+ <!-- use the same version as your Camel core version -->
28
+ </dependency>
29
+
30
+ # URI Format
31
+
32
+ azure-storage-blob://accountName[/containerName][?options]
33
+
34
+ In the case of a consumer, `accountName`, `containerName` are required.
35
+
36
+ In the case of a producer, it depends on the operation that is being
37
+ requested, for example, if operation is on a container level, e.b:
38
+ createContainer, accountName and containerName are only required, but in
39
+ case of operation being requested in blob level, e.g: getBlob,
40
+ accountName, containerName and blobName are required.
41
+
42
+ The blob will be created if it does not already exist. You can append
43
+ query options to the URI in the following format,
44
+ `?options=value&option2=value&...`
45
+
46
+ **Required information options:**
47
+
48
+ To use this component, you have multiple options to provide the required
49
+ Azure authentication information:
50
+
51
+ - By providing your own
52
+ [BlobServiceClient](https://azuresdkdocs.blob.core.windows.net/$web/java/azure-storage-blob/12.0.0/com/azure/storage/blob/BlobServiceClient.html)
53
+ instance which can be injected into `blobServiceClient`. Note: You
54
+ don’t need to create a specific client, e.g.: BlockBlobClient, the
55
+ BlobServiceClient represents the upper level which can be used to
56
+ retrieve lower level clients.
57
+
58
+ - Via Azure Identity, when specifying `credentialType=AZURE_IDENTITY`
59
+ and providing required [environment
60
+ variables](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#environment-variables).
61
+ This enables service principal (e.g. app registration)
62
+ authentication with secret/certificate as well as username password.
63
+ Note that this is the default authentication strategy.
64
+
65
+ - Via shared storage account key, when specifying
66
+ `credentialType=SHARED_ACCOUNT_KEY` and providing `accountName` and
67
+ `accessKey` for your Azure account, this is the simplest way to get
68
+ started. The accessKey can be generated through your Azure portal.
69
+
70
+ - Via shared storage account key, when specifying
71
+ `credentialType=SHARED_KEY_CREDENTIAL` and providing a
72
+ [StorageSharedKeyCredential](https://azuresdkartifacts.blob.core.windows.net/azure-sdk-for-java/staging/apidocs/com/azure/storage/common/StorageSharedKeyCredential.html)
73
+ instance which can be injected into `credentials` option.
74
+
75
+ - Via Azure SAS, when specifying `credentialType=AZURE_SAS` and
76
+ providing a SAS Token parameter through the `sasToken` parameter.
77
+
78
+ # Usage
79
+
80
+ For example, to download a blob content from the block blob `hello.txt`
81
+ located on the `container1` in the `camelazure` storage account, use the
82
+ following snippet:
83
+
84
+ from("azure-storage-blob://camelazure/container1?blobName=hello.txt&credentialType=SHARED_ACCOUNT_KEY&accessKey=RAW(yourAccessKey)").
85
+ to("file://blobdirectory");
86
+
87
+ ## Advanced Azure Storage Blob configuration
88
+
89
+ If your Camel Application is running behind a firewall or if you need to
90
+ have more control over the `BlobServiceClient` instance configuration,
91
+ you can create your own instance:
92
+
93
+ StorageSharedKeyCredential credential = new StorageSharedKeyCredential("yourAccountName", "yourAccessKey");
94
+ String uri = String.format("https://%s.blob.core.windows.net", "yourAccountName");
95
+
96
+ BlobServiceClient client = new BlobServiceClientBuilder()
97
+ .endpoint(uri)
98
+ .credential(credential)
99
+ .buildClient();
100
+ // This is camel context
101
+ context.getRegistry().bind("client", client);
102
+
103
+ Then refer to this instance in your Camel `azure-storage-blob` component
104
+ configuration:
105
+
106
+ from("azure-storage-blob://cameldev/container1?blobName=myblob&serviceClient=#client")
107
+ .to("mock:result");
108
+
109
+ ## Automatic detection of BlobServiceClient client in registry
110
+
111
+ The component is capable of detecting the presence of an
112
+ BlobServiceClient bean into the registry. If it’s the only instance of
113
+ that type, it will be used as the client, and you won’t have to define
114
+ it as uri parameter, like the example above. This may be really useful
115
+ for smarter configuration of the endpoint.
116
+
117
+ ## Azure Storage Blob Producer operations
118
+
119
+ Camel Azure Storage Blob component provides a wide range of operations
120
+ on the producer side:
121
+
122
+ **Operations on the service level**
123
+
124
+ For these operations, `accountName` is **required**.
125
+
126
+ <table>
127
+ <colgroup>
128
+ <col style="width: 10%" />
129
+ <col style="width: 89%" />
130
+ </colgroup>
131
+ <thead>
132
+ <tr>
133
+ <th style="text-align: left;">Operation</th>
134
+ <th style="text-align: left;">Description</th>
135
+ </tr>
136
+ </thead>
137
+ <tbody>
138
+ <tr>
139
+ <td
140
+ style="text-align: left;"><p><code>listBlobContainers</code></p></td>
141
+ <td style="text-align: left;"><p>Get the content of the blob. You can
142
+ restrict the output of this operation to a blob range.</p></td>
143
+ </tr>
144
+ <tr>
145
+ <td style="text-align: left;"><p><code>getChangeFeed</code></p></td>
146
+ <td style="text-align: left;"><p>Returns transaction logs of all the
147
+ changes that occur to the blobs and the blob metadata in your storage
148
+ account. The change feed provides ordered, guaranteed, durable,
149
+ immutable, read-only log of these changes.</p></td>
150
+ </tr>
151
+ </tbody>
152
+ </table>
153
+
154
+ **Operations on the container level**
155
+
156
+ For these operations, `accountName` and `containerName` are
157
+ **required**.
158
+
159
+ <table>
160
+ <colgroup>
161
+ <col style="width: 10%" />
162
+ <col style="width: 89%" />
163
+ </colgroup>
164
+ <thead>
165
+ <tr>
166
+ <th style="text-align: left;">Operation</th>
167
+ <th style="text-align: left;">Description</th>
168
+ </tr>
169
+ </thead>
170
+ <tbody>
171
+ <tr>
172
+ <td
173
+ style="text-align: left;"><p><code>createBlobContainer</code></p></td>
174
+ <td style="text-align: left;"><p>Create a new container within a storage
175
+ account. If a container with the same name already exists, the producer
176
+ will ignore it.</p></td>
177
+ </tr>
178
+ <tr>
179
+ <td
180
+ style="text-align: left;"><p><code>deleteBlobContainer</code></p></td>
181
+ <td style="text-align: left;"><p>Delete the specified container in the
182
+ storage account. If the container doesn’t exist, the operation
183
+ fails.</p></td>
184
+ </tr>
185
+ <tr>
186
+ <td style="text-align: left;"><p><code>listBlobs</code></p></td>
187
+ <td style="text-align: left;"><p>Returns a list of blobs in this
188
+ container, with folder structures flattened.</p></td>
189
+ </tr>
190
+ </tbody>
191
+ </table>
192
+
193
+ **Operations on the blob level**
194
+
195
+ For these operations, `accountName`, `containerName` and `blobName` are
196
+ **required**.
197
+
198
+ <table>
199
+ <colgroup>
200
+ <col style="width: 10%" />
201
+ <col style="width: 10%" />
202
+ <col style="width: 79%" />
203
+ </colgroup>
204
+ <thead>
205
+ <tr>
206
+ <th style="text-align: left;">Operation</th>
207
+ <th style="text-align: left;">Blob Type</th>
208
+ <th style="text-align: left;">Description</th>
209
+ </tr>
210
+ </thead>
211
+ <tbody>
212
+ <tr>
213
+ <td style="text-align: left;"><p><code>getBlob</code></p></td>
214
+ <td style="text-align: left;"><p>Common</p></td>
215
+ <td style="text-align: left;"><p>Get the content of the blob. You can
216
+ restrict the output of this operation to a blob range.</p></td>
217
+ </tr>
218
+ <tr>
219
+ <td style="text-align: left;"><p><code>deleteBlob</code></p></td>
220
+ <td style="text-align: left;"><p>Common</p></td>
221
+ <td style="text-align: left;"><p>Delete a blob.</p></td>
222
+ </tr>
223
+ <tr>
224
+ <td
225
+ style="text-align: left;"><p><code>downloadBlobToFile</code></p></td>
226
+ <td style="text-align: left;"><p>Common</p></td>
227
+ <td style="text-align: left;"><p>Download the entire blob into a file
228
+ specified by the path. The file will be created and must not exist, if
229
+ the file already exists a <code>FileAlreadyExistsException</code> will
230
+ be thrown.</p></td>
231
+ </tr>
232
+ <tr>
233
+ <td style="text-align: left;"><p><code>downloadLink</code></p></td>
234
+ <td style="text-align: left;"><p>Common</p></td>
235
+ <td style="text-align: left;"><p>Generate the download link for the
236
+ specified blob using shared access signatures (SAS). This by default
237
+ only limits to 1hour of allowed access. However, you can override the
238
+ default expiration duration through the headers.</p></td>
239
+ </tr>
240
+ <tr>
241
+ <td style="text-align: left;"><p><code>uploadBlockBlob</code></p></td>
242
+ <td style="text-align: left;"><p>BlockBlob</p></td>
243
+ <td style="text-align: left;"><p>Creates a new block blob, or updates
244
+ the content of an existing block blob. Updating an existing block blob
245
+ overwrites any existing metadata on the blob. Partial updates are not
246
+ supported with PutBlob; the content of the existing blob is overwritten
247
+ with the new content.</p></td>
248
+ </tr>
249
+ <tr>
250
+ <td
251
+ style="text-align: left;"><p><code>stageBlockBlobList</code></p></td>
252
+ <td style="text-align: left;"><p><code>BlockBlob</code></p></td>
253
+ <td style="text-align: left;"><p>Uploads the specified block to the
254
+ block blob’s "staging area" to be later committed by a call to
255
+ commitBlobBlockList. However, in case header
256
+ <code>CamelAzureStorageBlobCommitBlobBlockListLater</code> or config
257
+ <code>commitBlockListLater</code> is set to false, this will commit the
258
+ blocks immediately after staging the blocks.</p></td>
259
+ </tr>
260
+ <tr>
261
+ <td
262
+ style="text-align: left;"><p><code>commitBlobBlockList</code></p></td>
263
+ <td style="text-align: left;"><p><code>BlockBlob</code></p></td>
264
+ <td style="text-align: left;"><p>Write a blob by specifying the list of
265
+ block IDs that are to make up the blob. To be written as part of a blob,
266
+ a block must have been successfully written to the server in a prior
267
+ <code>stageBlockBlobList</code> operation. You can call
268
+ <code>commitBlobBlockList</code> to update a blob by uploading only
269
+ those blocks that have changed, then committing the new and existing
270
+ blocks together. Any blocks not specified in the block list and
271
+ permanently deleted.</p></td>
272
+ </tr>
273
+ <tr>
274
+ <td style="text-align: left;"><p><code>getBlobBlockList</code></p></td>
275
+ <td style="text-align: left;"><p><code>BlockBlob</code></p></td>
276
+ <td style="text-align: left;"><p>Returns the list of blocks that have
277
+ been uploaded as part of a block blob using the specified blocklist
278
+ filter.</p></td>
279
+ </tr>
280
+ <tr>
281
+ <td style="text-align: left;"><p><code>createAppendBlob</code></p></td>
282
+ <td style="text-align: left;"><p><code>AppendBlob</code></p></td>
283
+ <td style="text-align: left;"><p>Creates a 0-length append blob. Call
284
+ commitAppendBlo`b operation to append data to an append blob.</p></td>
285
+ </tr>
286
+ <tr>
287
+ <td style="text-align: left;"><p><code>commitAppendBlob</code></p></td>
288
+ <td style="text-align: left;"><p><code>AppendBlob</code></p></td>
289
+ <td style="text-align: left;"><p>Commits a new block of data to the end
290
+ of the existing append blob. In case of header
291
+ <code>CamelAzureStorageBlobCreateAppendBlob</code> or config
292
+ <code>createAppendBlob</code> is set to true, it will attempt to create
293
+ the appendBlob through internal call to <code>createAppendBlob</code>
294
+ operation first before committing.</p></td>
295
+ </tr>
296
+ <tr>
297
+ <td style="text-align: left;"><p><code>createPageBlob</code></p></td>
298
+ <td style="text-align: left;"><p><code>PageBlob</code></p></td>
299
+ <td style="text-align: left;"><p>Creates a page blob of the specified
300
+ length. Call <code>uploadPageBlob</code> operation to upload data to a
301
+ page blob.</p></td>
302
+ </tr>
303
+ <tr>
304
+ <td style="text-align: left;"><p><code>uploadPageBlob</code></p></td>
305
+ <td style="text-align: left;"><p><code>PageBlob</code></p></td>
306
+ <td style="text-align: left;"><p>Write one or more pages to the page
307
+ blob. The size must be a multiple of 512. In case of header
308
+ <code>CamelAzureStorageBlobCreatePageBlob</code> or config
309
+ <code>createPageBlob</code> is set to true, it will attempt to create
310
+ the appendBlob through internal call to <code>createPageBlob</code>
311
+ operation first before uploading.</p></td>
312
+ </tr>
313
+ <tr>
314
+ <td style="text-align: left;"><p><code>resizePageBlob</code></p></td>
315
+ <td style="text-align: left;"><p><code>PageBlob</code></p></td>
316
+ <td style="text-align: left;"><p>Resizes the page blob to the specified
317
+ size, which must be a multiple of 512.</p></td>
318
+ </tr>
319
+ <tr>
320
+ <td style="text-align: left;"><p><code>clearPageBlob</code></p></td>
321
+ <td style="text-align: left;"><p><code>PageBlob</code></p></td>
322
+ <td style="text-align: left;"><p>Free the specified pages from the page
323
+ blob. The size of the range must be a multiple of 512.</p></td>
324
+ </tr>
325
+ <tr>
326
+ <td style="text-align: left;"><p><code>getPageBlobRanges</code></p></td>
327
+ <td style="text-align: left;"><p><code>PageBlob</code></p></td>
328
+ <td style="text-align: left;"><p>Returns the list of valid page ranges
329
+ for a page blob or snapshot of a page blob.</p></td>
330
+ </tr>
331
+ <tr>
332
+ <td style="text-align: left;"><p><code>copyBlob</code></p></td>
333
+ <td style="text-align: left;"><p><code>Common</code></p></td>
334
+ <td style="text-align: left;"><p>Copy a blob from one container to
335
+ another one, even from different accounts.</p></td>
336
+ </tr>
337
+ </tbody>
338
+ </table>
339
+
340
+ Refer to the example section in this page to learn how to use these
341
+ operations into your camel application.
342
+
343
+ ## Consumer Examples
344
+
345
+ To consume a blob into a file using the file component, this can be done
346
+ like this:
347
+
348
+ from("azure-storage-blob://camelazure/container1?blobName=hello.txt&accountName=yourAccountName&accessKey=yourAccessKey").
349
+ to("file://blobdirectory");
350
+
351
+ However, you can also write to file directly without using the file
352
+ component, you will need to specify `fileDir` folder path to save your
353
+ blob in your machine.
354
+
355
+ from("azure-storage-blob://camelazure/container1?blobName=hello.txt&accountName=yourAccountName&accessKey=yourAccessKey&fileDir=/var/to/awesome/dir").
356
+ to("mock:results");
357
+
358
+ Also, the component supports batch consumer, hence you can consume
359
+ multiple blobs with only specifying the container name, the consumer
360
+ will return multiple exchanges depending on the number of the blobs in
361
+ the container. Example:
362
+
363
+ from("azure-storage-blob://camelazure/container1?accountName=yourAccountName&accessKey=yourAccessKey&fileDir=/var/to/awesome/dir").
364
+ to("mock:results");
365
+
366
+ ## Producer Operations Examples
367
+
368
+ - `listBlobContainers`:
369
+
370
+ <!-- -->
371
+
372
+ from("direct:start")
373
+ .process(exchange -> {
374
+ // set the header you want the producer to evaluate, refer to the previous
375
+ // section to learn about the headers that can be set
376
+ // e.g.:
377
+ exchange.getIn().setHeader(BlobConstants.LIST_BLOB_CONTAINERS_OPTIONS, new ListBlobContainersOptions().setMaxResultsPerPage(10));
378
+ })
379
+ .to("azure-storage-blob://camelazure?operation=listBlobContainers&client&serviceClient=#client")
380
+ .to("mock:result");
381
+
382
+ - `createBlobContainer`:
383
+
384
+ <!-- -->
385
+
386
+ from("direct:start")
387
+ .process(exchange -> {
388
+ // set the header you want the producer to evaluate, refer to the previous
389
+ // section to learn about the headers that can be set
390
+ // e.g.:
391
+ exchange.getIn().setHeader(BlobConstants.BLOB_CONTAINER_NAME, "newContainerName");
392
+ })
393
+ .to("azure-storage-blob://camelazure/container1?operation=createBlobContainer&serviceClient=#client")
394
+ .to("mock:result");
395
+
396
+ - `deleteBlobContainer`:
397
+
398
+ <!-- -->
399
+
400
+ from("direct:start")
401
+ .process(exchange -> {
402
+ // set the header you want the producer to evaluate, refer to the previous
403
+ // section to learn about the headers that can be set
404
+ // e.g.:
405
+ exchange.getIn().setHeader(BlobConstants.BLOB_CONTAINER_NAME, "overridenName");
406
+ })
407
+ .to("azure-storage-blob://camelazure/container1?operation=deleteBlobContainer&serviceClient=#client")
408
+ .to("mock:result");
409
+
410
+ - `listBlobs`:
411
+
412
+ <!-- -->
413
+
414
+ from("direct:start")
415
+ .process(exchange -> {
416
+ // set the header you want the producer to evaluate, refer to the previous
417
+ // section to learn about the headers that can be set
418
+ // e.g.:
419
+ exchange.getIn().setHeader(BlobConstants.BLOB_CONTAINER_NAME, "overridenName");
420
+ })
421
+ .to("azure-storage-blob://camelazure/container1?operation=listBlobs&serviceClient=#client")
422
+ .to("mock:result");
423
+
424
+ - `getBlob`:
425
+
426
+ We can either set an `outputStream` in the exchange body and write the
427
+ data to it. E.g.:
428
+
429
+ from("direct:start")
430
+ .process(exchange -> {
431
+ // set the header you want the producer to evaluate, refer to the previous
432
+ // section to learn about the headers that can be set
433
+ // e.g.:
434
+ exchange.getIn().setHeader(BlobConstants.BLOB_CONTAINER_NAME, "overridenName");
435
+
436
+ // set our body
437
+ exchange.getIn().setBody(outputStream);
438
+ })
439
+ .to("azure-storage-blob://camelazure/container1?blobName=blob&operation=getBlob&serviceClient=#client")
440
+ .to("mock:result");
441
+
442
+ If we don’t set a body, then this operation will give us an
443
+ `InputStream` instance which can proceeded further downstream:
444
+
445
+ from("direct:start")
446
+ .to("azure-storage-blob://camelazure/container1?blobName=blob&operation=getBlob&serviceClient=#client")
447
+ .process(exchange -> {
448
+ InputStream inputStream = exchange.getMessage().getBody(InputStream.class);
449
+ // We use Apache common IO for simplicity, but you are free to do whatever dealing
450
+ // with inputStream
451
+ System.out.println(IOUtils.toString(inputStream, StandardCharsets.UTF_8.name()));
452
+ })
453
+ .to("mock:result");
454
+
455
+ - `deleteBlob`:
456
+
457
+ <!-- -->
458
+
459
+ from("direct:start")
460
+ .process(exchange -> {
461
+ // set the header you want the producer to evaluate, refer to the previous
462
+ // section to learn about the headers that can be set
463
+ // e.g.:
464
+ exchange.getIn().setHeader(BlobConstants.BLOB_NAME, "overridenName");
465
+ })
466
+ .to("azure-storage-blob://camelazure/container1?blobName=blob&operation=deleteBlob&serviceClient=#client")
467
+ .to("mock:result");
468
+
469
+ - `downloadBlobToFile`:
470
+
471
+ <!-- -->
472
+
473
+ from("direct:start")
474
+ .process(exchange -> {
475
+ // set the header you want the producer to evaluate, refer to the previous
476
+ // section to learn about the headers that can be set
477
+ // e.g.:
478
+ exchange.getIn().setHeader(BlobConstants.BLOB_NAME, "overridenName");
479
+ })
480
+ .to("azure-storage-blob://camelazure/container1?blobName=blob&operation=downloadBlobToFile&fileDir=/var/mydir&serviceClient=#client")
481
+ .to("mock:result");
482
+
483
+ - `downloadLink`
484
+
485
+ <!-- -->
486
+
487
+ from("direct:start")
488
+ .to("azure-storage-blob://camelazure/container1?blobName=blob&operation=downloadLink&serviceClient=#client")
489
+ .process(exchange -> {
490
+ String link = exchange.getMessage().getHeader(BlobConstants.DOWNLOAD_LINK, String.class);
491
+ System.out.println("My link " + link);
492
+ })
493
+ .to("mock:result");
494
+
495
+ - `uploadBlockBlob`
496
+
497
+ <!-- -->
498
+
499
+ from("direct:start")
500
+ .process(exchange -> {
501
+ // set the header you want the producer to evaluate, refer to the previous
502
+ // section to learn about the headers that can be set
503
+ // e.g.:
504
+ exchange.getIn().setHeader(BlobConstants.BLOB_NAME, "overridenName");
505
+ exchange.getIn().setBody("Block Blob");
506
+ })
507
+ .to("azure-storage-blob://camelazure/container1?blobName=blob&operation=uploadBlockBlob&serviceClient=#client")
508
+ .to("mock:result");
509
+
510
+ - `stageBlockBlobList`
511
+
512
+ <!-- -->
513
+
514
+ from("direct:start")
515
+ .process(exchange -> {
516
+ final List<BlobBlock> blocks = new LinkedList<>();
517
+ blocks.add(BlobBlock.createBlobBlock(new ByteArrayInputStream("Hello".getBytes())));
518
+ blocks.add(BlobBlock.createBlobBlock(new ByteArrayInputStream("From".getBytes())));
519
+ blocks.add(BlobBlock.createBlobBlock(new ByteArrayInputStream("Camel".getBytes())));
520
+
521
+ exchange.getIn().setBody(blocks);
522
+ })
523
+ .to("azure-storage-blob://camelazure/container1?blobName=blob&operation=stageBlockBlobList&serviceClient=#client")
524
+ .to("mock:result");
525
+
526
+ - `commitBlockBlobList`
527
+
528
+ <!-- -->
529
+
530
+ from("direct:start")
531
+ .process(exchange -> {
532
+ // We assume here you have the knowledge of these blocks you want to commit
533
+ final List<Block> blockIds = new LinkedList<>();
534
+ blockIds.add(new Block().setName("id-1"));
535
+ blockIds.add(new Block().setName("id-2"));
536
+ blockIds.add(new Block().setName("id-3"));
537
+
538
+ exchange.getIn().setBody(blockIds);
539
+ })
540
+ .to("azure-storage-blob://camelazure/container1?blobName=blob&operation=commitBlockBlobList&serviceClient=#client")
541
+ .to("mock:result");
542
+
543
+ - `getBlobBlockList`
544
+
545
+ <!-- -->
546
+
547
+ from("direct:start")
548
+ .to("azure-storage-blob://camelazure/container1?blobName=blob&operation=getBlobBlockList&serviceClient=#client")
549
+ .log("${body}")
550
+ .to("mock:result");
551
+
552
+ - `createAppendBlob`
553
+
554
+ <!-- -->
555
+
556
+ from("direct:start")
557
+ .to("azure-storage-blob://camelazure/container1?blobName=blob&operation=createAppendBlob&serviceClient=#client")
558
+ .to("mock:result");
559
+
560
+ - `commitAppendBlob`
561
+
562
+ <!-- -->
563
+
564
+ from("direct:start")
565
+ .process(exchange -> {
566
+ final String data = "Hello world from my awesome tests!";
567
+ final InputStream dataStream = new ByteArrayInputStream(data.getBytes(StandardCharsets.UTF_8));
568
+
569
+ exchange.getIn().setBody(dataStream);
570
+
571
+ // of course, you can set whatever headers you like, refer to the headers section to learn more
572
+ })
573
+ .to("azure-storage-blob://camelazure/container1?blobName=blob&operation=commitAppendBlob&serviceClient=#client")
574
+ .to("mock:result");
575
+
576
+ - `createPageBlob`
577
+
578
+ <!-- -->
579
+
580
+ from("direct:start")
581
+ .to("azure-storage-blob://camelazure/container1?blobName=blob&operation=createPageBlob&serviceClient=#client")
582
+ .to("mock:result");
583
+
584
+ - `uploadPageBlob`
585
+
586
+ <!-- -->
587
+
588
+ from("direct:start")
589
+ .process(exchange -> {
590
+ byte[] dataBytes = new byte[512]; // we set range for the page from 0-511
591
+ new Random().nextBytes(dataBytes);
592
+ final InputStream dataStream = new ByteArrayInputStream(dataBytes);
593
+ final PageRange pageRange = new PageRange().setStart(0).setEnd(511);
594
+
595
+ exchange.getIn().setHeader(BlobConstants.PAGE_BLOB_RANGE, pageRange);
596
+ exchange.getIn().setBody(dataStream);
597
+ })
598
+ .to("azure-storage-blob://camelazure/container1?blobName=blob&operation=uploadPageBlob&serviceClient=#client")
599
+ .to("mock:result");
600
+
601
+ - `resizePageBlob`
602
+
603
+ <!-- -->
604
+
605
+ from("direct:start")
606
+ .process(exchange -> {
607
+ final PageRange pageRange = new PageRange().setStart(0).setEnd(511);
608
+
609
+ exchange.getIn().setHeader(BlobConstants.PAGE_BLOB_RANGE, pageRange);
610
+ })
611
+ .to("azure-storage-blob://camelazure/container1?blobName=blob&operation=resizePageBlob&serviceClient=#client")
612
+ .to("mock:result");
613
+
614
+ - `clearPageBlob`
615
+
616
+ <!-- -->
617
+
618
+ from("direct:start")
619
+ .process(exchange -> {
620
+ final PageRange pageRange = new PageRange().setStart(0).setEnd(511);
621
+
622
+ exchange.getIn().setHeader(BlobConstants.PAGE_BLOB_RANGE, pageRange);
623
+ })
624
+ .to("azure-storage-blob://camelazure/container1?blobName=blob&operation=clearPageBlob&serviceClient=#client")
625
+ .to("mock:result");
626
+
627
+ - `getPageBlobRanges`
628
+
629
+ <!-- -->
630
+
631
+ from("direct:start")
632
+ .process(exchange -> {
633
+ final PageRange pageRange = new PageRange().setStart(0).setEnd(511);
634
+
635
+ exchange.getIn().setHeader(BlobConstants.PAGE_BLOB_RANGE, pageRange);
636
+ })
637
+ .to("azure-storage-blob://camelazure/container1?blobName=blob&operation=getPageBlobRanges&serviceClient=#client")
638
+ .log("${body}")
639
+ .to("mock:result");
640
+
641
+ - `copyBlob`
642
+
643
+ <!-- -->
644
+
645
+ from("direct:copyBlob")
646
+ .process(exchange -> {
647
+ exchange.getIn().setHeader(BlobConstants.BLOB_NAME, "file.txt");
648
+ exchange.getMessage().setHeader(BlobConstants.SOURCE_BLOB_CONTAINER_NAME, "containerblob1");
649
+ exchange.getMessage().setHeader(BlobConstants.SOURCE_BLOB_ACCOUNT_NAME, "account");
650
+ })
651
+ .to("azure-storage-blob://account/containerblob2?operation=copyBlob&sourceBlobAccessKey=RAW(accessKey)")
652
+ .to("mock:result");
653
+
654
+ In this way the `file.txt` in the container `containerblob1` of the
655
+ account `account`, will be copied to the container `containerblob2` of
656
+ the same account.
657
+
658
+ ## SAS Token generation example
659
+
660
+ SAS Blob Container tokens can be generated programmatically or via Azure
661
+ UI. To generate the token with java code, the following can be done:
662
+
663
+ BlobContainerClient blobClient = new BlobContainerClientBuilder()
664
+ .endpoint(String.format("https://%s.blob.core.windows.net/%s", accountName, accessKey))
665
+ .containerName(containerName)
666
+ .credential(new StorageSharedKeyCredential(accountName, accessKey))
667
+ .buildClient();
668
+
669
+ // Create a SAS token that's valid for 1 day, as an example
670
+ OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
671
+
672
+ // Assign permissions to the SAS token
673
+ BlobContainerSasPermission blobContainerSasPermission = new BlobContainerSasPermission()
674
+ .setWritePermission(true)
675
+ .setListPermission(true)
676
+ .setCreatePermission(true)
677
+ .setDeletePermission(true)
678
+ .setAddPermission(true)
679
+ .setReadPermission(true);
680
+
681
+ BlobServiceSasSignatureValues sasSignatureValues = new BlobServiceSasSignatureValues(expiryTime, blobContainerSasPermission);
682
+
683
+ return blobClient.generateSas(sasSignatureValues);
684
+
685
+ The generated SAS token can be then stored to an application.properties
686
+ file so that it can be loaded by the camel route, for example:
687
+
688
+ camel.component.azure-storage-blob.sas-token=MY_TOKEN_HERE
689
+
690
+ from("direct:copyBlob")
691
+ .to("azure-storage-blob://account/containerblob2?operation=uploadBlockBlob&credentialType=AZURE_SAS")
692
+
693
+ ## Development Notes (Important)
694
+
695
+ All integration tests use
696
+ [Testcontainers](https://www.testcontainers.org/) and run by default.
697
+ Obtaining of Azure accessKey and accountName is needed to be able to run
698
+ all integration tests using Azure services. In addition to the mocked
699
+ unit tests, you **will need to run the integration tests with every
700
+ change you make or even client upgrade as the Azure client can break
701
+ things even on minor versions upgrade.** To run the integration tests,
702
+ on this component directory, run the following maven command:
703
+
704
+ mvn verify -DaccountName=myacc -DaccessKey=mykey -DcredentialType=SHARED_ACCOUNT_KEY
705
+
706
+ Whereby `accountName` is your Azure account name and `accessKey` is the
707
+ access key being generated from Azure portal.
708
+
709
+ ## Component Configurations
710
+
711
+
712
+ |Name|Description|Default|Type|
713
+ |---|---|---|---|
714
+ |blobName|The blob name, to consume specific blob from a container. However, on producer it is only required for the operations on the blob level||string|
715
+ |blobOffset|Set the blob offset for the upload or download operations, default is 0|0|integer|
716
+ |blobType|The blob type in order to initiate the appropriate settings for each blob type|blockblob|object|
717
+ |closeStreamAfterRead|Close the stream after read or keep it open, default is true|true|boolean|
718
+ |configuration|The component configurations||object|
719
+ |credentials|StorageSharedKeyCredential can be injected to create the azure client, this holds the important authentication information||object|
720
+ |credentialType|Determines the credential strategy to adopt|AZURE\_IDENTITY|object|
721
+ |dataCount|How many bytes to include in the range. Must be greater than or equal to 0 if specified.||integer|
722
+ |fileDir|The file directory where the downloaded blobs will be saved to, this can be used in both, producer and consumer||string|
723
+ |maxResultsPerPage|Specifies the maximum number of blobs to return, including all BlobPrefix elements. If the request does not specify maxResultsPerPage or specifies a value greater than 5,000, the server will return up to 5,000 items.||integer|
724
+ |maxRetryRequests|Specifies the maximum number of additional HTTP Get requests that will be made while reading the data from a response body.|0|integer|
725
+ |prefix|Filters the results to return only blobs whose names begin with the specified prefix. May be null to return all blobs.||string|
726
+ |regex|Filters the results to return only blobs whose names match the specified regular expression. May be null to return all if both prefix and regex are set, regex takes the priority and prefix is ignored.||string|
727
+ |sasToken|In case of usage of Shared Access Signature we'll need to set a SAS Token||string|
728
+ |serviceClient|Client to a storage account. This client does not hold any state about a particular storage account but is instead a convenient way of sending off appropriate requests to the resource on the service. It may also be used to construct URLs to blobs and containers. This client contains operations on a service account. Operations on a container are available on BlobContainerClient through BlobServiceClient#getBlobContainerClient(String), and operations on a blob are available on BlobClient through BlobContainerClient#getBlobClient(String).||object|
729
+ |timeout|An optional timeout value beyond which a RuntimeException will be raised.||object|
730
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
731
+ |blobSequenceNumber|A user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 263 - 1.The default value is 0.|0|integer|
732
+ |blockListType|Specifies which type of blocks to return.|COMMITTED|object|
733
+ |changeFeedContext|When using getChangeFeed producer operation, this gives additional context that is passed through the Http pipeline during the service call.||object|
734
+ |changeFeedEndTime|When using getChangeFeed producer operation, this filters the results to return events approximately before the end time. Note: A few events belonging to the next hour can also be returned. A few events belonging to this hour can be missing; to ensure all events from the hour are returned, round the end time up by an hour.||object|
735
+ |changeFeedStartTime|When using getChangeFeed producer operation, this filters the results to return events approximately after the start time. Note: A few events belonging to the previous hour can also be returned. A few events belonging to this hour can be missing; to ensure all events from the hour are returned, round the start time down by an hour.||object|
736
+ |closeStreamAfterWrite|Close the stream after write or keep it open, default is true|true|boolean|
737
+ |commitBlockListLater|When is set to true, the staged blocks will not be committed directly.|true|boolean|
738
+ |createAppendBlob|When is set to true, the append blocks will be created when committing append blocks.|true|boolean|
739
+ |createPageBlob|When is set to true, the page blob will be created when uploading page blob.|true|boolean|
740
+ |downloadLinkExpiration|Override the default expiration (millis) of URL download link.||integer|
741
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
742
+ |operation|The blob operation that can be used with this component on the producer|listBlobContainers|object|
743
+ |pageBlobSize|Specifies the maximum size for the page blob, up to 8 TB. The page blob size must be aligned to a 512-byte boundary.|512|integer|
744
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
745
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
746
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
747
+ |accessKey|Access key for the associated azure account name to be used for authentication with azure blob services||string|
748
+ |sourceBlobAccessKey|Source Blob Access Key: for copyblob operation, sadly, we need to have an accessKey for the source blob we want to copy Passing an accessKey as header, it's unsafe so we could set as key.||string|
749
+
750
+ ## Endpoint Configurations
751
+
752
+
753
+ |Name|Description|Default|Type|
754
+ |---|---|---|---|
755
+ |accountName|Azure account name to be used for authentication with azure blob services||string|
756
+ |containerName|The blob container name||string|
757
+ |blobName|The blob name, to consume specific blob from a container. However, on producer it is only required for the operations on the blob level||string|
758
+ |blobOffset|Set the blob offset for the upload or download operations, default is 0|0|integer|
759
+ |blobServiceClient|Client to a storage account. This client does not hold any state about a particular storage account but is instead a convenient way of sending off appropriate requests to the resource on the service. It may also be used to construct URLs to blobs and containers. This client contains operations on a service account. Operations on a container are available on BlobContainerClient through getBlobContainerClient(String), and operations on a blob are available on BlobClient through getBlobContainerClient(String).getBlobClient(String).||object|
760
+ |blobType|The blob type in order to initiate the appropriate settings for each blob type|blockblob|object|
761
+ |closeStreamAfterRead|Close the stream after read or keep it open, default is true|true|boolean|
762
+ |credentials|StorageSharedKeyCredential can be injected to create the azure client, this holds the important authentication information||object|
763
+ |credentialType|Determines the credential strategy to adopt|AZURE\_IDENTITY|object|
764
+ |dataCount|How many bytes to include in the range. Must be greater than or equal to 0 if specified.||integer|
765
+ |fileDir|The file directory where the downloaded blobs will be saved to, this can be used in both, producer and consumer||string|
766
+ |maxResultsPerPage|Specifies the maximum number of blobs to return, including all BlobPrefix elements. If the request does not specify maxResultsPerPage or specifies a value greater than 5,000, the server will return up to 5,000 items.||integer|
767
+ |maxRetryRequests|Specifies the maximum number of additional HTTP Get requests that will be made while reading the data from a response body.|0|integer|
768
+ |prefix|Filters the results to return only blobs whose names begin with the specified prefix. May be null to return all blobs.||string|
769
+ |regex|Filters the results to return only blobs whose names match the specified regular expression. May be null to return all if both prefix and regex are set, regex takes the priority and prefix is ignored.||string|
770
+ |sasToken|In case of usage of Shared Access Signature we'll need to set a SAS Token||string|
771
+ |serviceClient|Client to a storage account. This client does not hold any state about a particular storage account but is instead a convenient way of sending off appropriate requests to the resource on the service. It may also be used to construct URLs to blobs and containers. This client contains operations on a service account. Operations on a container are available on BlobContainerClient through BlobServiceClient#getBlobContainerClient(String), and operations on a blob are available on BlobClient through BlobContainerClient#getBlobClient(String).||object|
772
+ |timeout|An optional timeout value beyond which a RuntimeException will be raised.||object|
773
+ |sendEmptyMessageWhenIdle|If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead.|false|boolean|
774
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
775
+ |exceptionHandler|To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.||object|
776
+ |exchangePattern|Sets the exchange pattern when the consumer creates an exchange.||object|
777
+ |pollStrategy|A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel.||object|
778
+ |blobSequenceNumber|A user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 263 - 1.The default value is 0.|0|integer|
779
+ |blockListType|Specifies which type of blocks to return.|COMMITTED|object|
780
+ |changeFeedContext|When using getChangeFeed producer operation, this gives additional context that is passed through the Http pipeline during the service call.||object|
781
+ |changeFeedEndTime|When using getChangeFeed producer operation, this filters the results to return events approximately before the end time. Note: A few events belonging to the next hour can also be returned. A few events belonging to this hour can be missing; to ensure all events from the hour are returned, round the end time up by an hour.||object|
782
+ |changeFeedStartTime|When using getChangeFeed producer operation, this filters the results to return events approximately after the start time. Note: A few events belonging to the previous hour can also be returned. A few events belonging to this hour can be missing; to ensure all events from the hour are returned, round the start time down by an hour.||object|
783
+ |closeStreamAfterWrite|Close the stream after write or keep it open, default is true|true|boolean|
784
+ |commitBlockListLater|When is set to true, the staged blocks will not be committed directly.|true|boolean|
785
+ |createAppendBlob|When is set to true, the append blocks will be created when committing append blocks.|true|boolean|
786
+ |createPageBlob|When is set to true, the page blob will be created when uploading page blob.|true|boolean|
787
+ |downloadLinkExpiration|Override the default expiration (millis) of URL download link.||integer|
788
+ |operation|The blob operation that can be used with this component on the producer|listBlobContainers|object|
789
+ |pageBlobSize|Specifies the maximum size for the page blob, up to 8 TB. The page blob size must be aligned to a 512-byte boundary.|512|integer|
790
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
791
+ |backoffErrorThreshold|The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in.||integer|
792
+ |backoffIdleThreshold|The number of subsequent idle polls that should happen before the backoffMultipler should kick-in.||integer|
793
+ |backoffMultiplier|To let the scheduled polling consumer backoff if there has been a number of subsequent idles/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and/or backoffErrorThreshold must also be configured.||integer|
794
+ |delay|Milliseconds before the next poll.|500|integer|
795
+ |greedy|If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages.|false|boolean|
796
+ |initialDelay|Milliseconds before the first poll starts.|1000|integer|
797
+ |repeatCount|Specifies a maximum limit of number of fires. So if you set it to 1, the scheduler will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever.|0|integer|
798
+ |runLoggingLevel|The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that.|TRACE|object|
799
+ |scheduledExecutorService|Allows for configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool.||object|
800
+ |scheduler|To use a cron scheduler from either camel-spring or camel-quartz component. Use value spring or quartz for built in scheduler|none|object|
801
+ |schedulerProperties|To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler.||object|
802
+ |startScheduler|Whether the scheduler should be auto started.|true|boolean|
803
+ |timeUnit|Time unit for initialDelay and delay options.|MILLISECONDS|object|
804
+ |useFixedDelay|Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details.|true|boolean|
805
+ |accessKey|Access key for the associated azure account name to be used for authentication with azure blob services||string|
806
+ |sourceBlobAccessKey|Source Blob Access Key: for copyblob operation, sadly, we need to have an accessKey for the source blob we want to copy Passing an accessKey as header, it's unsafe so we could set as key.||string|
camel-azure-storage-datalake.md ADDED
@@ -0,0 +1,557 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Azure-storage-datalake
2
+
3
+ **Since Camel 3.8**
4
+
5
+ **Both producer and consumer are supported**
6
+
7
+ The Azure storage datalake component is used for storing and retrieving
8
+ file from Azure Storage Data Lake Service using the **Azure APIs v12**.
9
+
10
+ Prerequisites
11
+
12
+ You need to have a valid Azure account with Azure storage set up. More
13
+ information can be found at [Azure Documentation
14
+ Portal](https://docs.microsoft.com/azure/).
15
+
16
+ Maven users will need to add the following dependency to their `pom.xml`
17
+ for this component.
18
+
19
+ <dependency>
20
+ <groupId>org.apache.camel</groupId>
21
+ <artifactId>camel-azure-storage-datalake</artifactId>
22
+ <version>x.x.x</version>
23
+ <!-- use the same version as your camel core version -->
24
+ </dependency>
25
+
26
+ # Uri Format
27
+
28
+ azure-storage-datalake:accountName[/fileSystemName][?options]
29
+
30
+ In the case of the consumer, both `accountName` and `fileSystemName` are
31
+ required. In the case of the producer, it depends on the operation being
32
+ requested.
33
+
34
+ You can append query options to the URI in the following format:
35
+ `?option1=value&option2=value&...`
36
+
37
+ ## Methods of authentication
38
+
39
+ To use this component, you will have to provide at least one of the
40
+ specific credentialType parameters:
41
+
42
+ - `SHARED_KEY_CREDENTIAL`: Provide `accountName` and `accessKey` for
43
+ your azure account or provide StorageSharedKeyCredential instance
44
+ which can be provided into `sharedKeyCredential` option.
45
+
46
+ - `CLIENT_SECRET`: Provide ClientSecretCredential instance which can
47
+ be provided into `clientSecretCredential` option or provide
48
+ `accountName`, `clientId`, `clientSecret` and `tenantId` for
49
+ authentication with Azure Active Directory.
50
+
51
+ - `SERVICE_CLIENT_INSTANCE`: Provide a DataLakeServiceClient instance
52
+ which can be provided into `serviceClient` option.
53
+
54
+ - `AZURE_IDENTITY`: Use the Default Azure Credential Provider Chain
55
+
56
+ - `AZURE_SAS`: Provide `sasSignature` or `sasCredential` parameters to
57
+ use SAS mechanism
58
+
59
+ The default is `CLIENT_SECRET`.
60
+
61
+ # Usage
62
+
63
+ For example, to download content from file `test.txt` located on the
64
+ `filesystem` in `camelTesting` storage account, use the following
65
+ snippet:
66
+
67
+ from("azure-storage-datalake:camelTesting/filesystem?fileName=test.txt&accountKey=key").
68
+ to("file://fileDirectory");
69
+
70
+ ## Automatic detection of a service client
71
+
72
+ The component is capable of automatically detecting the presence of a
73
+ DataLakeServiceClient bean in the registry. Hence, if your registry has
74
+ only one instance of type DataLakeServiceClient, it will be
75
+ automatically used as the default client. You won’t have to explicitly
76
+ define it as an uri parameter.
77
+
78
+ ## Azure Storage DataLake Producer Operations
79
+
80
+ The various operations supported by Azure Storage DataLake are as given
81
+ below:
82
+
83
+ **Operations on Service level**
84
+
85
+ For these operations, `accountName` option is required
86
+
87
+ <table>
88
+ <colgroup>
89
+ <col style="width: 10%" />
90
+ <col style="width: 89%" />
91
+ </colgroup>
92
+ <thead>
93
+ <tr>
94
+ <th style="text-align: left;">Operation</th>
95
+ <th style="text-align: left;">Description</th>
96
+ </tr>
97
+ </thead>
98
+ <tbody>
99
+ <tr>
100
+ <td style="text-align: left;"><p><code>listFileSystem</code></p></td>
101
+ <td style="text-align: left;"><p>List all the file systems that are
102
+ present in the given azure account.</p></td>
103
+ </tr>
104
+ </tbody>
105
+ </table>
106
+
107
+ **Operations on File system level**
108
+
109
+ For these operations, `accountName` and `fileSystemName` options are
110
+ required
111
+
112
+ <table>
113
+ <colgroup>
114
+ <col style="width: 10%" />
115
+ <col style="width: 89%" />
116
+ </colgroup>
117
+ <thead>
118
+ <tr>
119
+ <th style="text-align: left;">Operation</th>
120
+ <th style="text-align: left;">Description</th>
121
+ </tr>
122
+ </thead>
123
+ <tbody>
124
+ <tr>
125
+ <td style="text-align: left;"><p><code>createFileSystem</code></p></td>
126
+ <td style="text-align: left;"><p>Create a new file System with the
127
+ storage account</p></td>
128
+ </tr>
129
+ <tr>
130
+ <td style="text-align: left;"><p><code>deleteFileSystem</code></p></td>
131
+ <td style="text-align: left;"><p>Delete the specified file system within
132
+ the storage account</p></td>
133
+ </tr>
134
+ <tr>
135
+ <td style="text-align: left;"><p><code>listPaths</code></p></td>
136
+ <td style="text-align: left;"><p>Returns list of all the files within
137
+ the given path in the given file system, with folder structure
138
+ flattened</p></td>
139
+ </tr>
140
+ </tbody>
141
+ </table>
142
+
143
+ **Operations on Directory level**
144
+
145
+ For these operations, `accountName`, `fileSystemName` and
146
+ `directoryName` options are required
147
+
148
+ <table>
149
+ <colgroup>
150
+ <col style="width: 10%" />
151
+ <col style="width: 89%" />
152
+ </colgroup>
153
+ <thead>
154
+ <tr>
155
+ <th style="text-align: left;">Operation</th>
156
+ <th style="text-align: left;">Description</th>
157
+ </tr>
158
+ </thead>
159
+ <tbody>
160
+ <tr>
161
+ <td style="text-align: left;"><p><code>createFile</code></p></td>
162
+ <td style="text-align: left;"><p>Create a new file in the specified
163
+ directory within the fileSystem</p></td>
164
+ </tr>
165
+ <tr>
166
+ <td style="text-align: left;"><p><code>deleteDirectory</code></p></td>
167
+ <td style="text-align: left;"><p>Delete the specified directory within
168
+ the file system</p></td>
169
+ </tr>
170
+ </tbody>
171
+ </table>
172
+
173
+ **Operations on file level**
174
+
175
+ For these operations, `accountName`, `fileSystemName` and `fileName`
176
+ options are required
177
+
178
+ <table>
179
+ <colgroup>
180
+ <col style="width: 10%" />
181
+ <col style="width: 89%" />
182
+ </colgroup>
183
+ <thead>
184
+ <tr>
185
+ <th style="text-align: left;">Operation</th>
186
+ <th style="text-align: left;">Description</th>
187
+ </tr>
188
+ </thead>
189
+ <tbody>
190
+ <tr>
191
+ <td style="text-align: left;"><p><code>getFile</code></p></td>
192
+ <td style="text-align: left;"><p>Get the contents of a file</p></td>
193
+ </tr>
194
+ <tr>
195
+ <td style="text-align: left;"><p><code>downloadToFile</code></p></td>
196
+ <td style="text-align: left;"><p>Download the entire file from the file
197
+ system into a path specified by fileDir.</p></td>
198
+ </tr>
199
+ <tr>
200
+ <td style="text-align: left;"><p><code>downloadLink</code></p></td>
201
+ <td style="text-align: left;"><p>Generate a download link for the
202
+ specified file using Shared Access Signature (SAS). The expiration time
203
+ to be set for the link can be specified otherwise 1 hour is taken as
204
+ default.</p></td>
205
+ </tr>
206
+ <tr>
207
+ <td style="text-align: left;"><p><code>deleteFile</code></p></td>
208
+ <td style="text-align: left;"><p>Delete the specified file.</p></td>
209
+ </tr>
210
+ <tr>
211
+ <td style="text-align: left;"><p><code>appendToFile</code></p></td>
212
+ <td style="text-align: left;"><p>Appends the data passed to the
213
+ specified file in the file System. Flush command is required after
214
+ append.</p></td>
215
+ </tr>
216
+ <tr>
217
+ <td style="text-align: left;"><p><code>flushToFile</code></p></td>
218
+ <td style="text-align: left;"><p>Flushes the data already appended to
219
+ the specified file.</p></td>
220
+ </tr>
221
+ <tr>
222
+ <td
223
+ style="text-align: left;"><p><code>openQueryInputStream</code></p></td>
224
+ <td style="text-align: left;"><p>Opens an <code>InputStream</code> based
225
+ on the query passed to the endpoint. For this operation, you must first
226
+ register the query acceleration feature with your subscription.</p></td>
227
+ </tr>
228
+ </tbody>
229
+ </table>
230
+
231
+ Refer to the examples section below for more details on how to use these
232
+ operations
233
+
234
+ ## Consumer Examples
235
+
236
+ To consume a file from the storage datalake into a file using the file
237
+ component, this can be done like this:
238
+
239
+ from("azure-storage-datalake":cameltesting/filesystem?fileName=test.txt&accountKey=yourAccountKey").
240
+ to("file:/filelocation");
241
+
242
+ You can also directly write to a file without using the file component.
243
+ For this, you will need to specify the path in `fileDir` option, to save
244
+ it to your machine.
245
+
246
+ from("azure-storage-datalake":cameltesting/filesystem?fileName=test.txt&accountKey=yourAccountKey&fileDir=/test/directory").
247
+ to("mock:results");
248
+
249
+ This component also supports batch consumer. So, you can consume
250
+ multiple files from a file system by specifying the path from where you
251
+ want to consume the files.
252
+
253
+ from("azure-storage-datalake":cameltesting/filesystem?accountKey=yourAccountKey&fileDir=/test/directory&path=abc/test").
254
+ to("mock:results");
255
+
256
+ ## Producer Examples
257
+
258
+ - `listFileSystem`
259
+
260
+ <!-- -->
261
+
262
+ from("direct:start")
263
+ .process(exchange -> {
264
+ //required headers can be added here
265
+ exchange.getIn().setHeader(DataLakeConstants.LIST_FILESYSTEMS_OPTIONS, new ListFileSystemsOptions().setMaxResultsPerPage(10));
266
+ })
267
+ .to("azure-storage-datalake:cameltesting?operation=listFileSystem&dataLakeServiceClient=#serviceClient")
268
+ .to("mock:results");
269
+
270
+ - `createFileSystem`
271
+
272
+ <!-- -->
273
+
274
+ from("direct:start")
275
+ .process(exchange -> {
276
+ exchange.getIn().setHeader(DataLakeConstants.FILESYSTEM_NAME, "test1");
277
+ })
278
+ .to("azure-storage-datalake:cameltesting?operation=createFileSystem&dataLakeServiceClient=#serviceClient")
279
+ .to("mock:results");
280
+
281
+ - `deleteFileSystem`
282
+
283
+ <!-- -->
284
+
285
+ from("direct:start")
286
+ .process(exchange -> {
287
+ exchange.getIn().setHeader(DataLakeConstants.FILESYSTEM_NAME, "test1");
288
+ })
289
+ .to("azure-storage-datalake:cameltesting?operation=deleteFileSystem&dataLakeServiceClient=#serviceClient")
290
+ .to("mock:results");
291
+
292
+ - `listPaths`
293
+
294
+ <!-- -->
295
+
296
+ from("direct:start")
297
+ .process(exchange -> {
298
+ exchange.getIn().setHeader(DataLakeConstants.LIST_PATH_OPTIONS, new ListPathsOptions().setPath("/main"));
299
+ })
300
+ .to("azure-storage-datalake:cameltesting/filesystem?operation=listPaths&dataLakeServiceClient=#serviceClient")
301
+ .to("mock:results");
302
+
303
+ - `getFile`
304
+
305
+ This can be done in two ways, We can either set an `OutputStream` in the
306
+ exchange body
307
+
308
+ from("direct:start")
309
+ .process(exchange -> {
310
+ // set an OutputStream where the file data can should be written
311
+ exchange.getIn().setBody(outputStream);
312
+ })
313
+ .to("azure-storage-datalake:cameltesting/filesystem?operation=getFile&fileName=test.txt&dataLakeServiceClient=#serviceClient")
314
+ .to("mock:results");
315
+
316
+ Or if the body is not set, the operation will give an `InputStream`,
317
+ given that you have already registered for query acceleration in azure
318
+ portal.
319
+
320
+ from("direct:start")
321
+ .to("azure-storage-datalake:cameltesting/filesystem?operation=getFile&fileName=test.txt&dataLakeServiceClient=#serviceClient")
322
+ .process(exchange -> {
323
+ InputStream inputStream = exchange.getMessage().getBody(InputStream.class);
324
+ System.out.Println(IOUtils.toString(inputStream, StandardCharcets.UTF_8.name()));
325
+ })
326
+ .to("mock:results");
327
+
328
+ - `deleteFile`
329
+
330
+ <!-- -->
331
+
332
+ from("direct:start")
333
+ .to("azure-storage-datalake:cameltesting/filesystem?operation=deleteFile&fileName=test.txt&dataLakeServiceClient=#serviceClient")
334
+ .to("mock:results");
335
+
336
+ - `downloadToFile`
337
+
338
+ <!-- -->
339
+
340
+ from("direct:start")
341
+ .to("azure-storage-datalake:cameltesting/filesystem?operation=downloadToFile&fileName=test.txt&fileDir=/test/mydir&dataLakeServiceClient=#serviceClient")
342
+ .to("mock:results");
343
+
344
+ - `downloadLink`
345
+
346
+ <!-- -->
347
+
348
+ from("direct:start")
349
+ .to("azure-storage-datalake:cameltesting/filesystem?operation=downloadLink&fileName=test.txt&dataLakeServiceClient=#serviceClient")
350
+ .process(exchange -> {
351
+ String link = exchange.getMessage().getBody(String.class);
352
+ System.out.println(link);
353
+ })
354
+ .to("mock:results");
355
+
356
+ - `appendToFile`
357
+
358
+ <!-- -->
359
+
360
+ from("direct:start")
361
+ .process(exchange -> {
362
+ final String data = "test data";
363
+ final InputStream inputStream = new ByteArrayInputStream(data.getBytes(StandardCharsets.UTF_8));
364
+ exchange.getIn().setBody(inputStream);
365
+ })
366
+ .to("azure-storage-datalake:cameltesting/filesystem?operation=appendToFile&fileName=test.txt&dataLakeServiceClient=#serviceClient")
367
+ .to("mock:results");
368
+
369
+ - `flushToFile`
370
+
371
+ <!-- -->
372
+
373
+ from("direct:start")
374
+ .process(exchange -> {
375
+ exchange.getIn().setHeader(DataLakeConstants.POSITION, 0);
376
+ })
377
+ .to("azure-storage-datalake:cameltesting/filesystem?operation=flushToFile&fileName=test.txt&dataLakeServiceClient=#serviceClient")
378
+ .to("mock:results");
379
+
380
+ - `openQueryInputStream`
381
+
382
+ For this operation, you should have already registered for query
383
+ acceleration on the azure portal
384
+
385
+ from("direct:start")
386
+ .process(exchange -> {
387
+ exchange.getIn().setHeader(DataLakeConstants.QUERY_OPTIONS, new FileQueryOptions("SELECT * from BlobStorage"));
388
+ })
389
+ .to("azure-storage-datalake:cameltesting/filesystem?operation=openQueryInputStream&fileName=test.txt&dataLakeServiceClient=#serviceClient")
390
+ .to("mock:results");
391
+
392
+ - `upload`
393
+
394
+ <!-- -->
395
+
396
+ from("direct:start")
397
+ .process(exchange -> {
398
+ final String data = "test data";
399
+ final InputStream inputStream = new ByteArrayInputStream(data.getBytes(StandardCharsets.UTF_8));
400
+ exchange.getIn().setBody(inputStream);
401
+ })
402
+ .to("azure-storage-datalake:cameltesting/filesystem?operation=upload&fileName=test.txt&dataLakeServiceClient=#serviceClient")
403
+ .to("mock:results");
404
+
405
+ - `uploadFromFile`
406
+
407
+ <!-- -->
408
+
409
+ from("direct:start")
410
+ .process(exchange -> {
411
+ exchange.getIn().setHeader(DataLakeConstants.PATH, "test/file.txt");
412
+ })
413
+ .to("azure-storage-datalake:cameltesting/filesystem?operation=uploadFromFile&fileName=test.txt&dataLakeServiceClient=#serviceClient")
414
+ .to("mock:results");
415
+
416
+ - `createFile`
417
+
418
+ <!-- -->
419
+
420
+ from("direct:start")
421
+ .process(exchange -> {
422
+ exchange.getIn().setHeader(DataLakeConstants.DIRECTORY_NAME, "test/file/");
423
+ })
424
+ .to("azure-storage-datalake:cameltesting/filesystem?operation=createFile&fileName=test.txt&dataLakeServiceClient=#serviceClient")
425
+ .to("mock:results");
426
+
427
+ - `deleteDirectory`
428
+
429
+ <!-- -->
430
+
431
+ from("direct:start")
432
+ .process(exchange -> {
433
+ exchange.getIn().setHeader(DataLakeConstants.DIRECTORY_NAME, "test/file/");
434
+ })
435
+ .to("azure-storage-datalake:cameltesting/filesystem?operation=deleteDirectory&dataLakeServiceClient=#serviceClient")
436
+ .to("mock:results");
437
+
438
+ ## Testing
439
+
440
+ Please run all the unit tests and integration tests while making changes
441
+ to the component as changes or version upgrades can break things. For
442
+ running all the tests in the component, you will need to obtain azure
443
+ `accountName` and `accessKey`. After obtaining the same, you can run the
444
+ full test on this component directory by running the following maven
445
+ command
446
+
447
+ mvn verify -Dazure.storage.account.name=<accountName> -Dazure.storage.account.key=<accessKey>
448
+
449
+ You can also skip the integration test and run only basic unit test by
450
+ using the command
451
+
452
+ mvn test
453
+
454
+ ## Component Configurations
455
+
456
+
457
+ |Name|Description|Default|Type|
458
+ |---|---|---|---|
459
+ |clientId|client id for azure account||string|
460
+ |close|Whether or not a file changed event raised indicates completion (true) or modification (false)||boolean|
461
+ |closeStreamAfterRead|check for closing stream after read||boolean|
462
+ |configuration|configuration object for data lake||object|
463
+ |credentialType|Determines the credential strategy to adopt|CLIENT\_SECRET|object|
464
+ |dataCount|count number of bytes to download||integer|
465
+ |directoryName|directory of the file to be handled in component||string|
466
+ |downloadLinkExpiration|download link expiration time||integer|
467
+ |expression|expression for queryInputStream||string|
468
+ |fileDir|directory of file to do operations in the local system||string|
469
+ |fileName|name of file to be handled in component||string|
470
+ |fileOffset|offset position in file for different operations||integer|
471
+ |maxResults|maximum number of results to show at a time||integer|
472
+ |maxRetryRequests|no of retries to a given request||integer|
473
+ |openOptions|set open options for creating file||object|
474
+ |path|path in azure data lake for operations||string|
475
+ |permission|permission string for the file||string|
476
+ |position|This parameter allows the caller to upload data in parallel and control the order in which it is appended to the file.||integer|
477
+ |recursive|recursively include all paths||boolean|
478
+ |regex|regular expression for matching file names||string|
479
+ |retainUncommitedData|Whether or not uncommitted data is to be retained after the operation||boolean|
480
+ |serviceClient|data lake service client for azure storage data lake||object|
481
+ |sharedKeyCredential|shared key credential for azure data lake gen2||object|
482
+ |tenantId|tenant id for azure account||string|
483
+ |timeout|Timeout for operation||object|
484
+ |umask|umask permission for file||string|
485
+ |userPrincipalNameReturned|whether or not to use upn||boolean|
486
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
487
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
488
+ |operation|operation to be performed|listFileSystem|object|
489
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
490
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
491
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
492
+ |accountKey|account key for authentication||string|
493
+ |clientSecret|client secret for azure account||string|
494
+ |clientSecretCredential|client secret credential for authentication||object|
495
+ |sasCredential|SAS token credential||object|
496
+ |sasSignature|SAS token signature||string|
497
+
498
+ ## Endpoint Configurations
499
+
500
+
501
+ |Name|Description|Default|Type|
502
+ |---|---|---|---|
503
+ |accountName|name of the azure account||string|
504
+ |fileSystemName|name of filesystem to be used||string|
505
+ |clientId|client id for azure account||string|
506
+ |close|Whether or not a file changed event raised indicates completion (true) or modification (false)||boolean|
507
+ |closeStreamAfterRead|check for closing stream after read||boolean|
508
+ |credentialType|Determines the credential strategy to adopt|CLIENT\_SECRET|object|
509
+ |dataCount|count number of bytes to download||integer|
510
+ |dataLakeServiceClient|service client of data lake||object|
511
+ |directoryName|directory of the file to be handled in component||string|
512
+ |downloadLinkExpiration|download link expiration time||integer|
513
+ |expression|expression for queryInputStream||string|
514
+ |fileDir|directory of file to do operations in the local system||string|
515
+ |fileName|name of file to be handled in component||string|
516
+ |fileOffset|offset position in file for different operations||integer|
517
+ |maxResults|maximum number of results to show at a time||integer|
518
+ |maxRetryRequests|no of retries to a given request||integer|
519
+ |openOptions|set open options for creating file||object|
520
+ |path|path in azure data lake for operations||string|
521
+ |permission|permission string for the file||string|
522
+ |position|This parameter allows the caller to upload data in parallel and control the order in which it is appended to the file.||integer|
523
+ |recursive|recursively include all paths||boolean|
524
+ |regex|regular expression for matching file names||string|
525
+ |retainUncommitedData|Whether or not uncommitted data is to be retained after the operation||boolean|
526
+ |serviceClient|data lake service client for azure storage data lake||object|
527
+ |sharedKeyCredential|shared key credential for azure data lake gen2||object|
528
+ |tenantId|tenant id for azure account||string|
529
+ |timeout|Timeout for operation||object|
530
+ |umask|umask permission for file||string|
531
+ |userPrincipalNameReturned|whether or not to use upn||boolean|
532
+ |sendEmptyMessageWhenIdle|If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead.|false|boolean|
533
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
534
+ |exceptionHandler|To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.||object|
535
+ |exchangePattern|Sets the exchange pattern when the consumer creates an exchange.||object|
536
+ |pollStrategy|A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel.||object|
537
+ |operation|operation to be performed|listFileSystem|object|
538
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
539
+ |backoffErrorThreshold|The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in.||integer|
540
+ |backoffIdleThreshold|The number of subsequent idle polls that should happen before the backoffMultipler should kick-in.||integer|
541
+ |backoffMultiplier|To let the scheduled polling consumer backoff if there has been a number of subsequent idles/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and/or backoffErrorThreshold must also be configured.||integer|
542
+ |delay|Milliseconds before the next poll.|500|integer|
543
+ |greedy|If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages.|false|boolean|
544
+ |initialDelay|Milliseconds before the first poll starts.|1000|integer|
545
+ |repeatCount|Specifies a maximum limit of number of fires. So if you set it to 1, the scheduler will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever.|0|integer|
546
+ |runLoggingLevel|The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that.|TRACE|object|
547
+ |scheduledExecutorService|Allows for configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool.||object|
548
+ |scheduler|To use a cron scheduler from either camel-spring or camel-quartz component. Use value spring or quartz for built in scheduler|none|object|
549
+ |schedulerProperties|To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler.||object|
550
+ |startScheduler|Whether the scheduler should be auto started.|true|boolean|
551
+ |timeUnit|Time unit for initialDelay and delay options.|MILLISECONDS|object|
552
+ |useFixedDelay|Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details.|true|boolean|
553
+ |accountKey|account key for authentication||string|
554
+ |clientSecret|client secret for azure account||string|
555
+ |clientSecretCredential|client secret credential for authentication||object|
556
+ |sasCredential|SAS token credential||object|
557
+ |sasSignature|SAS token signature||string|
camel-azure-storage-queue.md ADDED
@@ -0,0 +1,424 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Azure-storage-queue
2
+
3
+ **Since Camel 3.3**
4
+
5
+ **Both producer and consumer are supported**
6
+
7
+ The Azure Storage Queue component supports storing and retrieving the
8
+ messages to/from [Azure Storage
9
+ Queue](https://azure.microsoft.com/services/storage/queues/) service
10
+ using **Azure APIs v12**. However, in the case of versions above v12, we
11
+ will see if this component can adopt these changes depending on how much
12
+ breaking changes can result.
13
+
14
+ Prerequisites
15
+
16
+ You must have a valid Windows Azure Storage account. More information is
17
+ available at [Azure Documentation
18
+ Portal](https://docs.microsoft.com/azure/).
19
+
20
+ Maven users will need to add the following dependency to their `pom.xml`
21
+ for this component:
22
+
23
+ <dependency>
24
+ <groupId>org.apache.camel</groupId>
25
+ <artifactId>camel-azure-storage-queue</artifactId>
26
+ <version>x.x.x</version>
27
+ <!-- use the same version as your Camel core version -->
28
+ </dependency>
29
+
30
+ # URI Format
31
+
32
+ azure-storage-queue://accountName[/queueName][?options]
33
+
34
+ In the case of consumer, `accountName` and `queueName` are required.
35
+
36
+ In the case of producer, it depends on the operation that being
37
+ requested, for example, if operation is on a service level, e.b:
38
+ `listQueues`, only `accountName` is required, but in the case of
39
+ operation being requested on the queue level, e.g.:
40
+ ``createQueue, `sendMessage``, etc., both `accountName` and
41
+ `queueName` are required.
42
+
43
+ The queue will be created if it does not already exist. You can append
44
+ query options to the URI in the following format:
45
+ `?options=value&option2=value&...`
46
+
47
+ **Required information options:**
48
+
49
+ **Required information options:**
50
+
51
+ To use this component, you have multiple options to provide the required
52
+ Azure authentication information:
53
+
54
+ - By providing your own QueueServiceClient instance which can be
55
+ injected into `serviceClient`.
56
+
57
+ - Via Azure Identity, when specifying `credentialType=AZURE_IDENTITY`
58
+ and providing required [environment
59
+ variables](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#environment-variables).
60
+ This enables service principal (e.g. app registration)
61
+ authentication with secret/certificate as well as username password.
62
+
63
+ - Via shared storage account key, when specifying
64
+ `credentialType=SHARED_ACCOUNT_KEY` and providing `accountName` and
65
+ `accessKey` for your Azure account, this is the simplest way to get
66
+ started. The accessKey can be generated through your Azure portal.
67
+ Note that this is the default authentication strategy.
68
+
69
+ - Via shared storage account key, when specifying
70
+ `credentialType=SHARED_KEY_CREDENTIAL` and providing a
71
+ [StorageSharedKeyCredential](https://azuresdkartifacts.blob.core.windows.net/azure-sdk-for-java/staging/apidocs/com/azure/storage/common/StorageSharedKeyCredential.html)
72
+ instance which can be injected into `credentials` option.
73
+
74
+ # Usage
75
+
76
+ For example, to get a message content from the queue `messageQueue` in
77
+ the `storageAccount` storage account and, use the following snippet:
78
+
79
+ from("azure-storage-queue://storageAccount/messageQueue?accessKey=yourAccessKey").
80
+ to("file://queuedirectory");
81
+
82
+ ## Advanced Azure Storage Queue configuration
83
+
84
+ If your Camel Application is running behind a firewall or if you need to
85
+ have more control over the `QueueServiceClient` instance configuration,
86
+ you can create your own instance:
87
+
88
+ StorageSharedKeyCredential credential = new StorageSharedKeyCredential("yourAccountName", "yourAccessKey");
89
+ String uri = String.format("https://%s.queue.core.windows.net", "yourAccountName");
90
+
91
+ QueueServiceClient client = new QueueServiceClientBuilder()
92
+ .endpoint(uri)
93
+ .credential(credential)
94
+ .buildClient();
95
+ // This is camel context
96
+ context.getRegistry().bind("client", client);
97
+
98
+ Then refer to this instance in your Camel `azure-storage-queue`
99
+ component configuration:
100
+
101
+ from("azure-storage-queue://cameldev/queue1?serviceClient=#client")
102
+ .to("file://outputFolder?fileName=output.txt&fileExist=Append");
103
+
104
+ ## Automatic detection of QueueServiceClient client in registry
105
+
106
+ The component is capable of detecting the presence of an
107
+ QueueServiceClient bean into the registry. If it’s the only instance of
108
+ that type, it will be used as the client, and you won’t have to define
109
+ it as uri parameter, like the example above. This may be really useful
110
+ for smarter configuration of the endpoint.
111
+
112
+ ## Azure Storage Queue Producer operations
113
+
114
+ Camel Azure Storage Queue component provides a wide range of operations
115
+ on the producer side:
116
+
117
+ **Operations on the service level**
118
+
119
+ For these operations, `accountName` is **required**.
120
+
121
+ <table>
122
+ <colgroup>
123
+ <col style="width: 10%" />
124
+ <col style="width: 89%" />
125
+ </colgroup>
126
+ <thead>
127
+ <tr>
128
+ <th style="text-align: left;">Operation</th>
129
+ <th style="text-align: left;">Description</th>
130
+ </tr>
131
+ </thead>
132
+ <tbody>
133
+ <tr>
134
+ <td style="text-align: left;"><p><code>listQueues</code></p></td>
135
+ <td style="text-align: left;"><p>Lists the queues in the storage account
136
+ that pass the filter starting at the specified marker.</p></td>
137
+ </tr>
138
+ </tbody>
139
+ </table>
140
+
141
+ **Operations on the queue level**
142
+
143
+ For these operations, `accountName` and `queueName` are **required**.
144
+
145
+ <table>
146
+ <colgroup>
147
+ <col style="width: 10%" />
148
+ <col style="width: 89%" />
149
+ </colgroup>
150
+ <thead>
151
+ <tr>
152
+ <th style="text-align: left;">Operation</th>
153
+ <th style="text-align: left;">Description</th>
154
+ </tr>
155
+ </thead>
156
+ <tbody>
157
+ <tr>
158
+ <td style="text-align: left;"><p><code>createQueue</code></p></td>
159
+ <td style="text-align: left;"><p>Creates a new queue.</p></td>
160
+ </tr>
161
+ <tr>
162
+ <td style="text-align: left;"><p><code>deleteQueue</code></p></td>
163
+ <td style="text-align: left;"><p>Permanently deletes the queue.</p></td>
164
+ </tr>
165
+ <tr>
166
+ <td style="text-align: left;"><p><code>clearQueue</code></p></td>
167
+ <td style="text-align: left;"><p>Deletes all messages in the
168
+ queue..</p></td>
169
+ </tr>
170
+ <tr>
171
+ <td style="text-align: left;"><p><code>sendMessage</code></p></td>
172
+ <td style="text-align: left;"><p><strong>Default Producer
173
+ Operation</strong> Sends a message with a given time-to-live and timeout
174
+ period where the message is invisible in the queue. The message text is
175
+ evaluated from the exchange message body. By default, if the queue
176
+ doesn’t exist, it will create an empty queue first. If you want to
177
+ disable this, set the config <code>createQueue</code> or header
178
+ <code>CamelAzureStorageQueueCreateQueue</code> to
179
+ <code>false</code>.</p></td>
180
+ </tr>
181
+ <tr>
182
+ <td style="text-align: left;"><p><code>deleteMessage</code></p></td>
183
+ <td style="text-align: left;"><p>Deletes the specified message in the
184
+ queue.</p></td>
185
+ </tr>
186
+ <tr>
187
+ <td style="text-align: left;"><p><code>receiveMessages</code></p></td>
188
+ <td style="text-align: left;"><p>Retrieves up to the maximum number of
189
+ messages from the queue and hides them from other operations for the
190
+ timeout period. However, it will not dequeue the message from the queue
191
+ due to reliability reasons.</p></td>
192
+ </tr>
193
+ <tr>
194
+ <td style="text-align: left;"><p><code>peekMessages</code></p></td>
195
+ <td style="text-align: left;"><p>Peek messages from the front of the
196
+ queue up to the maximum number of messages.</p></td>
197
+ </tr>
198
+ <tr>
199
+ <td style="text-align: left;"><p><code>updateMessage</code></p></td>
200
+ <td style="text-align: left;"><p>Updates the specific message in the
201
+ queue with a new message and resets the visibility timeout. The message
202
+ text is evaluated from the exchange message body.</p></td>
203
+ </tr>
204
+ </tbody>
205
+ </table>
206
+
207
+ Refer to the example section in this page to learn how to use these
208
+ operations into your camel application.
209
+
210
+ ## Consumer Examples
211
+
212
+ To consume a queue into a file component with maximum five messages in
213
+ one batch, this can be done like this:
214
+
215
+ from("azure-storage-queue://cameldev/queue1?serviceClient=#client&maxMessages=5")
216
+ .to("file://outputFolder?fileName=output.txt&fileExist=Append");
217
+
218
+ ## Producer Operations Examples
219
+
220
+ - `listQueues`:
221
+
222
+ <!-- -->
223
+
224
+ from("direct:start")
225
+ .process(exchange -> {
226
+ // set the header you want the producer to evaluate, refer to the previous
227
+ // section to learn about the headers that can be set
228
+ // e.g., to only returns a list of queues with 'awesome' prefix:
229
+ exchange.getIn().setHeader(QueueConstants.QUEUES_SEGMENT_OPTIONS, new QueuesSegmentOptions().setPrefix("awesome"));
230
+ })
231
+ .to("azure-storage-queue://cameldev?serviceClient=#client&operation=listQueues")
232
+ .log("${body}")
233
+ .to("mock:result");
234
+
235
+ - `createQueue`:
236
+
237
+ <!-- -->
238
+
239
+ from("direct:start")
240
+ .process(exchange -> {
241
+ // set the header you want the producer to evaluate, refer to the previous
242
+ // section to learn about the headers that can be set
243
+ // e.g.:
244
+ exchange.getIn().setHeader(QueueConstants.QUEUE_NAME, "overrideName");
245
+ })
246
+ .to("azure-storage-queue://cameldev/test?serviceClient=#client&operation=createQueue");
247
+
248
+ - `deleteQueue`:
249
+
250
+ <!-- -->
251
+
252
+ from("direct:start")
253
+ .process(exchange -> {
254
+ // set the header you want the producer to evaluate, refer to the previous
255
+ // section to learn about the headers that can be set
256
+ // e.g.:
257
+ exchange.getIn().setHeader(QueueConstants.QUEUE_NAME, "overrideName");
258
+ })
259
+ .to("azure-storage-queue://cameldev/test?serviceClient=#client&operation=deleteQueue");
260
+
261
+ - `clearQueue`:
262
+
263
+ <!-- -->
264
+
265
+ from("direct:start")
266
+ .process(exchange -> {
267
+ // set the header you want the producer to evaluate, refer to the previous
268
+ // section to learn about the headers that can be set
269
+ // e.g.:
270
+ exchange.getIn().setHeader(QueueConstants.QUEUE_NAME, "overrideName");
271
+ })
272
+ .to("azure-storage-queue://cameldev/test?serviceClient=#client&operation=clearQueue");
273
+
274
+ - `sendMessage`:
275
+
276
+ <!-- -->
277
+
278
+ from("direct:start")
279
+ .process(exchange -> {
280
+ // set the header you want the producer to evaluate, refer to the previous
281
+ // section to learn about the headers that can be set
282
+ // e.g.:
283
+ exchange.getIn().setBody("message to send");
284
+ // we set a visibility of 1min
285
+ exchange.getIn().setHeader(QueueConstants.VISIBILITY_TIMEOUT, Duration.ofMinutes(1));
286
+ })
287
+ .to("azure-storage-queue://cameldev/test?serviceClient=#client");
288
+
289
+ - `deleteMessage`:
290
+
291
+ <!-- -->
292
+
293
+ from("direct:start")
294
+ .process(exchange -> {
295
+ // set the header you want the producer to evaluate, refer to the previous
296
+ // section to learn about the headers that can be set
297
+ // e.g.:
298
+ // Mandatory header:
299
+ exchange.getIn().setHeader(QueueConstants.MESSAGE_ID, "1");
300
+ // Mandatory header:
301
+ exchange.getIn().setHeader(QueueConstants.POP_RECEIPT, "PAAAAHEEERXXX-1");
302
+ })
303
+ .to("azure-storage-queue://cameldev/test?serviceClient=#client&operation=deleteMessage");
304
+
305
+ - `receiveMessages`:
306
+
307
+ <!-- -->
308
+
309
+ from("direct:start")
310
+ .to("azure-storage-queue://cameldev/test?serviceClient=#client&operation=receiveMessages")
311
+ .process(exchange -> {
312
+ final List<QueueMessageItem> messageItems = exchange.getMessage().getBody(List.class);
313
+ messageItems.forEach(messageItem -> System.out.println(messageItem.getMessageText()));
314
+ })
315
+ .to("mock:result");
316
+
317
+ - `peekMessages`:
318
+
319
+ <!-- -->
320
+
321
+ from("direct:start")
322
+ .to("azure-storage-queue://cameldev/test?serviceClient=#client&operation=peekMessages")
323
+ .process(exchange -> {
324
+ final List<PeekedMessageItem> messageItems = exchange.getMessage().getBody(List.class);
325
+ messageItems.forEach(messageItem -> System.out.println(messageItem.getMessageText()));
326
+ })
327
+ .to("mock:result");
328
+
329
+ - `updateMessage`:
330
+
331
+ <!-- -->
332
+
333
+ from("direct:start")
334
+ .process(exchange -> {
335
+ // set the header you want the producer to evaluate, refer to the previous
336
+ // section to learn about the headers that can be set
337
+ // e.g.:
338
+ exchange.getIn().setBody("new message text");
339
+ // Mandatory header:
340
+ exchange.getIn().setHeader(QueueConstants.MESSAGE_ID, "1");
341
+ // Mandatory header:
342
+ exchange.getIn().setHeader(QueueConstants.POP_RECEIPT, "PAAAAHEEERXXX-1");
343
+ // Mandatory header:
344
+ exchange.getIn().setHeader(QueueConstants.VISIBILITY_TIMEOUT, Duration.ofMinutes(1));
345
+ })
346
+ .to("azure-storage-queue://cameldev/test?serviceClient=#client&operation=updateMessage");
347
+
348
+ ## Development Notes (Important)
349
+
350
+ When developing on this component, you will need to obtain your Azure
351
+ `accessKey` to run the integration tests. In addition to the mocked unit
352
+ tests, you **will need to run the integration tests with every change
353
+ you make or even client upgrade as the Azure client can break things
354
+ even on minor versions upgrade.** To run the integration tests, on this
355
+ component directory, run the following maven command:
356
+
357
+ mvn verify -DaccountName=myacc -DaccessKey=mykey
358
+
359
+ Whereby `accountName` is your Azure account name and `accessKey` is the
360
+ access key being generated from Azure portal.
361
+
362
+ ## Component Configurations
363
+
364
+
365
+ |Name|Description|Default|Type|
366
+ |---|---|---|---|
367
+ |configuration|The component configurations||object|
368
+ |credentialType|Determines the credential strategy to adopt|SHARED\_ACCOUNT\_KEY|object|
369
+ |serviceClient|Service client to a storage account to interact with the queue service. This client does not hold any state about a particular storage account but is instead a convenient way of sending off appropriate requests to the resource on the service. This client contains all the operations for interacting with a queue account in Azure Storage. Operations allowed by the client are creating, listing, and deleting queues, retrieving and updating properties of the account, and retrieving statistics of the account.||object|
370
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
371
+ |createQueue|When is set to true, the queue will be automatically created when sending messages to the queue.|false|boolean|
372
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
373
+ |operation|Queue service operation hint to the producer||object|
374
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
375
+ |healthCheckConsumerEnabled|Used for enabling or disabling all consumer based health checks from this component|true|boolean|
376
+ |healthCheckProducerEnabled|Used for enabling or disabling all producer based health checks from this component. Notice: Camel has by default disabled all producer based health-checks. You can turn on producer checks globally by setting camel.health.producersEnabled=true.|true|boolean|
377
+ |maxMessages|Maximum number of messages to get, if there are less messages exist in the queue than requested all the messages will be returned. If left empty only 1 message will be retrieved, the allowed range is 1 to 32 messages.|1|integer|
378
+ |messageId|The ID of the message to be deleted or updated.||string|
379
+ |popReceipt|Unique identifier that must match for the message to be deleted or updated.||string|
380
+ |timeout|An optional timeout applied to the operation. If a response is not returned before the timeout concludes a RuntimeException will be thrown.||object|
381
+ |timeToLive|How long the message will stay alive in the queue. If unset the value will default to 7 days, if -1 is passed the message will not expire. The time to live must be -1 or any positive number. The format should be in this form: PnDTnHnMn.nS., e.g: PT20.345S -- parses as 20.345 seconds, P2D -- parses as 2 days However, in case you are using EndpointDsl/ComponentDsl, you can do something like Duration.ofSeconds() since these Java APIs are typesafe.||object|
382
+ |visibilityTimeout|The timeout period for how long the message is invisible in the queue. The timeout must be between 1 seconds and 7 days. The format should be in this form: PnDTnHnMn.nS., e.g: PT20.345S -- parses as 20.345 seconds, P2D -- parses as 2 days However, in case you are using EndpointDsl/ComponentDsl, you can do something like Duration.ofSeconds() since these Java APIs are typesafe.||object|
383
+ |accessKey|Access key for the associated azure account name to be used for authentication with azure queue services||string|
384
+ |credentials|StorageSharedKeyCredential can be injected to create the azure client, this holds the important authentication information||object|
385
+
386
+ ## Endpoint Configurations
387
+
388
+
389
+ |Name|Description|Default|Type|
390
+ |---|---|---|---|
391
+ |accountName|Azure account name to be used for authentication with azure queue services||string|
392
+ |queueName|The queue resource name||string|
393
+ |credentialType|Determines the credential strategy to adopt|SHARED\_ACCOUNT\_KEY|object|
394
+ |serviceClient|Service client to a storage account to interact with the queue service. This client does not hold any state about a particular storage account but is instead a convenient way of sending off appropriate requests to the resource on the service. This client contains all the operations for interacting with a queue account in Azure Storage. Operations allowed by the client are creating, listing, and deleting queues, retrieving and updating properties of the account, and retrieving statistics of the account.||object|
395
+ |sendEmptyMessageWhenIdle|If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead.|false|boolean|
396
+ |bridgeErrorHandler|Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.|false|boolean|
397
+ |exceptionHandler|To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.||object|
398
+ |exchangePattern|Sets the exchange pattern when the consumer creates an exchange.||object|
399
+ |pollStrategy|A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel.||object|
400
+ |createQueue|When is set to true, the queue will be automatically created when sending messages to the queue.|false|boolean|
401
+ |operation|Queue service operation hint to the producer||object|
402
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
403
+ |maxMessages|Maximum number of messages to get, if there are less messages exist in the queue than requested all the messages will be returned. If left empty only 1 message will be retrieved, the allowed range is 1 to 32 messages.|1|integer|
404
+ |messageId|The ID of the message to be deleted or updated.||string|
405
+ |popReceipt|Unique identifier that must match for the message to be deleted or updated.||string|
406
+ |timeout|An optional timeout applied to the operation. If a response is not returned before the timeout concludes a RuntimeException will be thrown.||object|
407
+ |timeToLive|How long the message will stay alive in the queue. If unset the value will default to 7 days, if -1 is passed the message will not expire. The time to live must be -1 or any positive number. The format should be in this form: PnDTnHnMn.nS., e.g: PT20.345S -- parses as 20.345 seconds, P2D -- parses as 2 days However, in case you are using EndpointDsl/ComponentDsl, you can do something like Duration.ofSeconds() since these Java APIs are typesafe.||object|
408
+ |visibilityTimeout|The timeout period for how long the message is invisible in the queue. The timeout must be between 1 seconds and 7 days. The format should be in this form: PnDTnHnMn.nS., e.g: PT20.345S -- parses as 20.345 seconds, P2D -- parses as 2 days However, in case you are using EndpointDsl/ComponentDsl, you can do something like Duration.ofSeconds() since these Java APIs are typesafe.||object|
409
+ |backoffErrorThreshold|The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in.||integer|
410
+ |backoffIdleThreshold|The number of subsequent idle polls that should happen before the backoffMultipler should kick-in.||integer|
411
+ |backoffMultiplier|To let the scheduled polling consumer backoff if there has been a number of subsequent idles/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and/or backoffErrorThreshold must also be configured.||integer|
412
+ |delay|Milliseconds before the next poll.|500|integer|
413
+ |greedy|If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages.|false|boolean|
414
+ |initialDelay|Milliseconds before the first poll starts.|1000|integer|
415
+ |repeatCount|Specifies a maximum limit of number of fires. So if you set it to 1, the scheduler will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever.|0|integer|
416
+ |runLoggingLevel|The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that.|TRACE|object|
417
+ |scheduledExecutorService|Allows for configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool.||object|
418
+ |scheduler|To use a cron scheduler from either camel-spring or camel-quartz component. Use value spring or quartz for built in scheduler|none|object|
419
+ |schedulerProperties|To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler.||object|
420
+ |startScheduler|Whether the scheduler should be auto started.|true|boolean|
421
+ |timeUnit|Time unit for initialDelay and delay options.|MILLISECONDS|object|
422
+ |useFixedDelay|Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details.|true|boolean|
423
+ |accessKey|Access key for the associated azure account name to be used for authentication with azure queue services||string|
424
+ |credentials|StorageSharedKeyCredential can be injected to create the azure client, this holds the important authentication information||object|
camel-bean-validator.md ADDED
@@ -0,0 +1,218 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Bean-validator
2
+
3
+ **Since Camel 2.3**
4
+
5
+ **Only producer is supported**
6
+
7
+ The Validator component performs bean validation of the message body
8
+ using the Java Bean Validation API ([JSR
9
+ 303](http://jcp.org/en/jsr/detail?id=303)). Camel uses the reference
10
+ implementation, which is [Hibernate
11
+ Validator](https://docs.jboss.org/hibernate/validator/6.2/reference/en-US/html_single/).
12
+
13
+ Maven users will need to add the following dependency to their `pom.xml`
14
+ for this component:
15
+
16
+ <dependency>
17
+ <groupId>org.apache.camel</groupId>
18
+ <artifactId>camel-bean-validator</artifactId>
19
+ <version>x.y.z</version>
20
+ <!-- use the same version as your Camel core version -->
21
+ </dependency>
22
+
23
+ # URI format
24
+
25
+ bean-validator:label[?options]
26
+
27
+ Where **label** is an arbitrary text value describing the endpoint. You
28
+ can append query options to the URI in the following format:
29
+ `?option=value&option=value&...`
30
+
31
+ # OSGi deployment
32
+
33
+ To use Hibernate Validator in the OSGi environment use dedicated
34
+ `ValidationProviderResolver` implementation, just as
35
+ `org.apache.camel.component.bean.validator.HibernateValidationProviderResolver`.
36
+ The snippet below demonstrates this approach. You can also use
37
+ `HibernateValidationProviderResolver`.
38
+
39
+ ## Using HibernateValidationProviderResolver
40
+
41
+ Java
42
+ from("direct:test").
43
+ to("bean-validator://ValidationProviderResolverTest?validationProviderResolver=#myValidationProviderResolver");
44
+
45
+ XML
46
+ <bean id="myValidationProviderResolver" class="org.apache.camel.component.bean.validator.HibernateValidationProviderResolver"/>
47
+
48
+ If no custom `ValidationProviderResolver` is defined and the validator
49
+ component has been deployed into the OSGi environment, the
50
+ `HibernateValidationProviderResolver` will be automatically used.
51
+
52
+ # Example
53
+
54
+ Assumed we have a java bean with the following annotations
55
+
56
+ **Car.java**
57
+
58
+ public class Car {
59
+
60
+ @NotNull
61
+ private String manufacturer;
62
+
63
+ @NotNull
64
+ @Size(min = 5, max = 14, groups = OptionalChecks.class)
65
+ private String licensePlate;
66
+
67
+ // getter and setter
68
+ }
69
+
70
+ and an interface definition for our custom validation group
71
+
72
+ **OptionalChecks.java**
73
+
74
+ public interface OptionalChecks {
75
+ }
76
+
77
+ with the following Camel route, only the **@NotNull** constraints on the
78
+ attributes `manufacturer` and `licensePlate` will be validated (Camel
79
+ uses the default group `jakarta.validation.groups.Default`).
80
+
81
+ from("direct:start")
82
+ .to("bean-validator://x")
83
+ .to("mock:end")
84
+
85
+ If you want to check the constraints from the group `OptionalChecks`,
86
+ you have to define the route like this
87
+
88
+ from("direct:start")
89
+ .to("bean-validator://x?group=OptionalChecks")
90
+ .to("mock:end")
91
+
92
+ If you want to check the constraints from both groups, you have to
93
+ define a new interface first:
94
+
95
+ **AllChecks.java**
96
+
97
+ @GroupSequence({Default.class, OptionalChecks.class})
98
+ public interface AllChecks {
99
+ }
100
+
101
+ And then your route definition should look like this:
102
+
103
+ from("direct:start")
104
+ .to("bean-validator://x?group=AllChecks")
105
+ .to("mock:end")
106
+
107
+ And if you have to provide your own message interpolator, traversable
108
+ resolver and constraint validator factory, you have to write a route
109
+ like this:
110
+
111
+ Java
112
+ <bean id="myMessageInterpolator" class="my.ConstraintValidatorFactory" />
113
+ <bean id="myTraversableResolver" class="my.TraversableResolver" />
114
+ <bean id="myConstraintValidatorFactory" class="my.ConstraintValidatorFactory" />
115
+
116
+ XML
117
+ from("direct:start")
118
+ .to("bean-validator://x?group=AllChecks\&messageInterpolator=#myMessageInterpolator
119
+ \&traversableResolver=#myTraversableResolver\&constraintValidatorFactory=#myConstraintValidatorFactory")
120
+ .to("mock:end")
121
+
122
+ It’s also possible to describe your constraints as XML and not as Java
123
+ annotations. In this case, you have to provide the files
124
+ `META-INF/validation.xml` and `constraints-car.xml` which could look
125
+ like this:
126
+
127
+ validation.xml
128
+ <validation-config
129
+ xmlns="https://jakarta.ee/xml/ns/validation/configuration"
130
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
131
+ xsi:schemaLocation="https://jakarta.ee/xml/ns/validation/configuration https://jakarta.ee/xml/ns/validation/validation-configuration-3.0.xsd"
132
+ version="3.0">
133
+
134
+ <default-provider>org.hibernate.validator.HibernateValidator</default-provider>
135
+ <message-interpolator>org.hibernate.validator.engine.ResourceBundleMessageInterpolator</message-interpolator>
136
+ <traversable-resolver>org.hibernate.validator.engine.resolver.DefaultTraversableResolver</traversable-resolver>
137
+ <constraint-validator-factory>org.hibernate.validator.engine.ConstraintValidatorFactoryImpl</constraint-validator-factory>
138
+ <constraint-mapping>/constraints-car.xml</constraint-mapping>
139
+
140
+ </validation-config>
141
+
142
+ constraints-car.xml
143
+ <constraint-mappings
144
+ xmlns="https://jakarta.ee/xml/ns/validation/mapping"
145
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
146
+ xsi:schemaLocation="https://jakarta.ee/xml/ns/validation/mapping
147
+ https://jakarta.ee/xml/ns/validation/validation-mapping-3.0.xsd"
148
+ version="3.0">
149
+
150
+ <default-package>org.apache.camel.component.bean.validator</default-package>
151
+
152
+ <bean class="CarWithoutAnnotations" ignore-annotations="true">
153
+ <field name="manufacturer">
154
+ <constraint annotation="jakarta.validation.constraints.NotNull" />
155
+ </field>
156
+
157
+ <field name="licensePlate">
158
+ <constraint annotation="jakarta.validation.constraints.NotNull" />
159
+
160
+ <constraint annotation="jakarta.validation.constraints.Size">
161
+ <groups>
162
+ <value>org.apache.camel.component.bean.validator.OptionalChecks</value>
163
+ </groups>
164
+ <element name="min">5</element>
165
+ <element name="max">14</element>
166
+ </constraint>
167
+ </field>
168
+ </bean>
169
+ </constraint-mappings>
170
+
171
+ Here is the XML syntax for the example route definition where
172
+ **OrderedChecks** can be
173
+ [https://github.com/apache/camel/blob/main/components/camel-bean-validator/src/test/java/org/apache/camel/component/bean/validator/OrderedChecks.java](https://github.com/apache/camel/blob/main/components/camel-bean-validator/src/test/java/org/apache/camel/component/bean/validator/OrderedChecks.java)
174
+
175
+ Note that the body should include an instance of a class to validate.
176
+
177
+ <beans xmlns="http://www.springframework.org/schema/beans"
178
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
179
+ xsi:schemaLocation="
180
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
181
+ http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
182
+
183
+ <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
184
+ <route>
185
+ <from uri="direct:start"/>
186
+ <to uri="bean-validator://x?group=org.apache.camel.component.bean.validator.OrderedChecks"/>
187
+ </route>
188
+ </camelContext>
189
+ </beans>
190
+
191
+ ## Component Configurations
192
+
193
+
194
+ |Name|Description|Default|Type|
195
+ |---|---|---|---|
196
+ |ignoreXmlConfiguration|Whether to ignore data from the META-INF/validation.xml file.|false|boolean|
197
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
198
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
199
+ |constraintValidatorFactory|To use a custom ConstraintValidatorFactory||object|
200
+ |messageInterpolator|To use a custom MessageInterpolator||object|
201
+ |traversableResolver|To use a custom TraversableResolver||object|
202
+ |validationProviderResolver|To use a a custom ValidationProviderResolver||object|
203
+ |validatorFactory|To use a custom ValidatorFactory||object|
204
+
205
+ ## Endpoint Configurations
206
+
207
+
208
+ |Name|Description|Default|Type|
209
+ |---|---|---|---|
210
+ |label|Where label is an arbitrary text value describing the endpoint||string|
211
+ |group|To use a custom validation group|jakarta.validation.groups.Default|string|
212
+ |ignoreXmlConfiguration|Whether to ignore data from the META-INF/validation.xml file.|false|boolean|
213
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
214
+ |constraintValidatorFactory|To use a custom ConstraintValidatorFactory||object|
215
+ |messageInterpolator|To use a custom MessageInterpolator||object|
216
+ |traversableResolver|To use a custom TraversableResolver||object|
217
+ |validationProviderResolver|To use a a custom ValidationProviderResolver||object|
218
+ |validatorFactory|To use a custom ValidatorFactory||object|
camel-bean.md ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Bean
2
+
3
+ **Since Camel 1.0**
4
+
5
+ **Only producer is supported**
6
+
7
+ The Bean component binds beans to Camel message exchanges.
8
+
9
+ # URI format
10
+
11
+ bean:beanName[?options]
12
+
13
+ Where `beanName` can be any string used to look up the bean in the
14
+ Registry
15
+
16
+ # Examples
17
+
18
+ A **bean:** endpoint cannot be defined as the input to the route; i.e.,
19
+ you cannot consume from it, you can only route from some inbound message
20
+ Endpoint to the bean endpoint as output, such as the **direct** endpoint
21
+ as input.
22
+
23
+ Suppose you have the following POJO class to be used by Camel
24
+
25
+ package com.foo;
26
+
27
+ public class MyBean {
28
+
29
+ public String saySomething(String input) {
30
+ return "Hello " + input;
31
+ }
32
+ }
33
+
34
+ Then the bean can be called in a Camel route by the fully qualified
35
+ class name:
36
+
37
+ Java
38
+ from("direct:hello")
39
+ .to("bean:com.foo.MyBean");
40
+
41
+ XML
42
+ <route>
43
+ <from uri="direct:hello"/>
44
+ <to uri="bean:com.foo.MyBean"/>
45
+ </route>
46
+
47
+ What happens is that when the exchange is routed to the MyBean, then
48
+ Camel will use the Bean Binding to invoke the bean, in this case the
49
+ *saySomething* method, by converting the `Exchange` in body to the
50
+ `String` type and storing the output of the method back to the Exchange
51
+ again.
52
+
53
+ The bean component can also call a bean by *bean id* by looking up the
54
+ bean in the [Registry](#manual::registry.adoc) instead of using the
55
+ class name.
56
+
57
+ # Java DSL specific bean syntax
58
+
59
+ Java DSL comes with syntactic sugar for the [Bean](#bean-component.adoc)
60
+ component. Instead of specifying the bean explicitly as the endpoint
61
+ (i.e., `to("bean:beanName")`) you can use the following syntax:
62
+
63
+ // Send a message to the bean endpoint
64
+ // and invoke method using Bean Binding.
65
+ from("direct:start").bean("beanName");
66
+
67
+ // Send a message to the bean endpoint
68
+ // and invoke given method.
69
+ from("direct:start").bean("beanName", "methodName");
70
+
71
+ Instead of passing the name of the reference to the bean (so that Camel
72
+ will look up for it in the [Registry](#manual::registry.adoc)), you can
73
+ specify the bean itself:
74
+
75
+ // Send a message to the given bean instance.
76
+ from("direct:start").bean(new ExampleBean());
77
+
78
+ // Explicit selection of bean method to be invoked.
79
+ from("direct:start").bean(new ExampleBean(), "methodName");
80
+
81
+ // Camel will create the instance of bean and cache it for you.
82
+ from("direct:start").bean(ExampleBean.class);
83
+
84
+ This bean could be a lambda if you cast the lambda to a
85
+ `@FunctionalInterface`
86
+
87
+ @FunctionalInterface
88
+ public interface ExampleInterface() {
89
+ @Handler String methodName();
90
+ }
91
+
92
+ from("direct:start")
93
+ .bean((ExampleInterface) () -> ""))
94
+
95
+ # Bean Binding
96
+
97
+ The [Bean Binding](#manual::bean-binding.adoc) mechanism defines how
98
+ methods to be invoked are chosen (if they are not specified explicitly
99
+ through the **method** parameter) and how parameter values are
100
+ constructed from the Message. These are used throughout all the various
101
+ [Bean Integration](#manual::bean-integration.adoc) mechanisms in Camel.
102
+
103
+ See also related [Bean Language](#languages:bean-language.adoc).
104
+
105
+ ## Component Configurations
106
+
107
+
108
+ |Name|Description|Default|Type|
109
+ |---|---|---|---|
110
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
111
+ |scope|Scope of bean. When using singleton scope (default) the bean is created or looked up only once and reused for the lifetime of the endpoint. The bean should be thread-safe in case concurrent threads is calling the bean at the same time. When using request scope the bean is created or looked up once per request (exchange). This can be used if you want to store state on a bean while processing a request and you want to call the same bean instance multiple times while processing the request. The bean does not have to be thread-safe as the instance is only called from the same request. When using delegate scope, then the bean will be looked up or created per call. However in case of lookup then this is delegated to the bean registry such as Spring or CDI (if in use), which depends on their configuration can act as either singleton or prototype scope. so when using prototype then this depends on the delegated registry.|Singleton|object|
112
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
113
+ |beanInfoCacheSize|Maximum cache size of internal cache for bean introspection. Setting a value of 0 or negative will disable the cache.|1000|integer|
114
+
115
+ ## Endpoint Configurations
116
+
117
+
118
+ |Name|Description|Default|Type|
119
+ |---|---|---|---|
120
+ |beanName|Sets the name of the bean to invoke||string|
121
+ |method|Sets the name of the method to invoke on the bean||string|
122
+ |scope|Scope of bean. When using singleton scope (default) the bean is created or looked up only once and reused for the lifetime of the endpoint. The bean should be thread-safe in case concurrent threads is calling the bean at the same time. When using request scope the bean is created or looked up once per request (exchange). This can be used if you want to store state on a bean while processing a request and you want to call the same bean instance multiple times while processing the request. The bean does not have to be thread-safe as the instance is only called from the same request. When using prototype scope, then the bean will be looked up or created per call. However in case of lookup then this is delegated to the bean registry such as Spring or CDI (if in use), which depends on their configuration can act as either singleton or prototype scope. so when using prototype then this depends on the delegated registry.|Singleton|object|
123
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
124
+ |parameters|Used for configuring additional properties on the bean||object|
camel-bonita.md ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Bonita
2
+
3
+ **Since Camel 2.19**
4
+
5
+ **Only producer is supported**
6
+
7
+ Used for communicating with a remote Bonita BPM process engine.
8
+
9
+ # URI format
10
+
11
+ bonita://[operation]?[options]
12
+
13
+ Where **operation** is the specific action to perform on Bonita.
14
+
15
+ # Body content
16
+
17
+ For the startCase operation, the input variables are retrieved from the
18
+ body message. This one has to contain a `Map<String,Serializable>`.
19
+
20
+ # Examples
21
+
22
+ The following example starts a new case in Bonita:
23
+
24
+ from("direct:start").to("bonita:startCase?hostname=localhost&amp;port=8080&amp;processName=TestProcess&amp;username=install&amp;password=install");
25
+
26
+ # Dependencies
27
+
28
+ To use Bonita in your Camel routes, you need to add a dependency on
29
+ **camel-bonita**, which implements the component.
30
+
31
+ If you use Maven, you can add the following to your pom.xml,
32
+ substituting the version number for the latest and greatest release (see
33
+ the download page for the latest versions).
34
+
35
+ <dependency>
36
+ <groupId>org.apache.camel</groupId>
37
+ <artifactId>camel-bonita</artifactId>
38
+ <version>x.x.x</version>
39
+ </dependency>
40
+
41
+ ## Component Configurations
42
+
43
+
44
+ |Name|Description|Default|Type|
45
+ |---|---|---|---|
46
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
47
+ |autowiredEnabled|Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.|true|boolean|
48
+
49
+ ## Endpoint Configurations
50
+
51
+
52
+ |Name|Description|Default|Type|
53
+ |---|---|---|---|
54
+ |operation|Operation to use||object|
55
+ |hostname|Hostname where Bonita engine runs|localhost|string|
56
+ |port|Port of the server hosting Bonita engine|8080|string|
57
+ |processName|Name of the process involved in the operation||string|
58
+ |lazyStartProducer|Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.|false|boolean|
59
+ |password|Password to authenticate to Bonita engine.||string|
60
+ |username|Username to authenticate to Bonita engine.||string|