This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-3.14.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.14.x by this push:
new 26e0f41 CAMEL-17593: camel-aws-sqs - Added option so you can choose
what to do when sending to sqs when hitting maximum number of message headers.
(#7146)
26e0f41 is described below
commit 26e0f4173817edbdaf2d7f71ef22da069f53ef84
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue Mar 8 11:06:49 2022 +0100
CAMEL-17593: camel-aws-sqs - Added option so you can choose what to do when
sending to sqs when hitting maximum number of message headers. (#7146)
---
.../aws2/sqs/Sqs2ComponentConfigurer.java | 6 ++++
.../component/aws2/sqs/Sqs2EndpointConfigurer.java | 6 ++++
.../component/aws2/sqs/Sqs2EndpointUriFactory.java | 3 +-
.../apache/camel/component/aws2/sqs/aws2-sqs.json | 10 ++++---
.../component/aws2/sqs/Sqs2Configuration.java | 34 +++++++++++++++++-----
.../camel/component/aws2/sqs/Sqs2Producer.java | 18 ++++++++++--
6 files changed, 61 insertions(+), 16 deletions(-)
diff --git
a/components/camel-aws/camel-aws2-sqs/src/generated/java/org/apache/camel/component/aws2/sqs/Sqs2ComponentConfigurer.java
b/components/camel-aws/camel-aws2-sqs/src/generated/java/org/apache/camel/component/aws2/sqs/Sqs2ComponentConfigurer.java
index be5a50a..c58d855 100644
---
a/components/camel-aws/camel-aws2-sqs/src/generated/java/org/apache/camel/component/aws2/sqs/Sqs2ComponentConfigurer.java
+++
b/components/camel-aws/camel-aws2-sqs/src/generated/java/org/apache/camel/component/aws2/sqs/Sqs2ComponentConfigurer.java
@@ -73,6 +73,8 @@ public class Sqs2ComponentConfigurer extends
PropertyConfigurerSupport implement
case "messageDeduplicationIdStrategy":
getOrCreateConfiguration(target).setMessageDeduplicationIdStrategy(property(camelContext,
java.lang.String.class, value)); return true;
case "messagegroupidstrategy":
case "messageGroupIdStrategy":
getOrCreateConfiguration(target).setMessageGroupIdStrategy(property(camelContext,
java.lang.String.class, value)); return true;
+ case "messageheaderexceededlimit":
+ case "messageHeaderExceededLimit":
getOrCreateConfiguration(target).setMessageHeaderExceededLimit(property(camelContext,
java.lang.String.class, value)); return true;
case "messageretentionperiod":
case "messageRetentionPeriod":
getOrCreateConfiguration(target).setMessageRetentionPeriod(property(camelContext,
java.lang.Integer.class, value)); return true;
case "operation":
getOrCreateConfiguration(target).setOperation(property(camelContext,
org.apache.camel.component.aws2.sqs.Sqs2Operations.class, value)); return true;
@@ -166,6 +168,8 @@ public class Sqs2ComponentConfigurer extends
PropertyConfigurerSupport implement
case "messageDeduplicationIdStrategy": return java.lang.String.class;
case "messagegroupidstrategy":
case "messageGroupIdStrategy": return java.lang.String.class;
+ case "messageheaderexceededlimit":
+ case "messageHeaderExceededLimit": return java.lang.String.class;
case "messageretentionperiod":
case "messageRetentionPeriod": return java.lang.Integer.class;
case "operation": return
org.apache.camel.component.aws2.sqs.Sqs2Operations.class;
@@ -255,6 +259,8 @@ public class Sqs2ComponentConfigurer extends
PropertyConfigurerSupport implement
case "messageDeduplicationIdStrategy": return
getOrCreateConfiguration(target).getMessageDeduplicationIdStrategy();
case "messagegroupidstrategy":
case "messageGroupIdStrategy": return
getOrCreateConfiguration(target).getMessageGroupIdStrategy();
+ case "messageheaderexceededlimit":
+ case "messageHeaderExceededLimit": return
getOrCreateConfiguration(target).getMessageHeaderExceededLimit();
case "messageretentionperiod":
case "messageRetentionPeriod": return
getOrCreateConfiguration(target).getMessageRetentionPeriod();
case "operation": return
getOrCreateConfiguration(target).getOperation();
diff --git
a/components/camel-aws/camel-aws2-sqs/src/generated/java/org/apache/camel/component/aws2/sqs/Sqs2EndpointConfigurer.java
b/components/camel-aws/camel-aws2-sqs/src/generated/java/org/apache/camel/component/aws2/sqs/Sqs2EndpointConfigurer.java
index 835997f..8f4b390 100644
---
a/components/camel-aws/camel-aws2-sqs/src/generated/java/org/apache/camel/component/aws2/sqs/Sqs2EndpointConfigurer.java
+++
b/components/camel-aws/camel-aws2-sqs/src/generated/java/org/apache/camel/component/aws2/sqs/Sqs2EndpointConfigurer.java
@@ -81,6 +81,8 @@ public class Sqs2EndpointConfigurer extends
PropertyConfigurerSupport implements
case "messageDeduplicationIdStrategy":
target.getConfiguration().setMessageDeduplicationIdStrategy(property(camelContext,
java.lang.String.class, value)); return true;
case "messagegroupidstrategy":
case "messageGroupIdStrategy":
target.getConfiguration().setMessageGroupIdStrategy(property(camelContext,
java.lang.String.class, value)); return true;
+ case "messageheaderexceededlimit":
+ case "messageHeaderExceededLimit":
target.getConfiguration().setMessageHeaderExceededLimit(property(camelContext,
java.lang.String.class, value)); return true;
case "messageretentionperiod":
case "messageRetentionPeriod":
target.getConfiguration().setMessageRetentionPeriod(property(camelContext,
java.lang.Integer.class, value)); return true;
case "operation":
target.getConfiguration().setOperation(property(camelContext,
org.apache.camel.component.aws2.sqs.Sqs2Operations.class, value)); return true;
@@ -208,6 +210,8 @@ public class Sqs2EndpointConfigurer extends
PropertyConfigurerSupport implements
case "messageDeduplicationIdStrategy": return java.lang.String.class;
case "messagegroupidstrategy":
case "messageGroupIdStrategy": return java.lang.String.class;
+ case "messageheaderexceededlimit":
+ case "messageHeaderExceededLimit": return java.lang.String.class;
case "messageretentionperiod":
case "messageRetentionPeriod": return java.lang.Integer.class;
case "operation": return
org.apache.camel.component.aws2.sqs.Sqs2Operations.class;
@@ -331,6 +335,8 @@ public class Sqs2EndpointConfigurer extends
PropertyConfigurerSupport implements
case "messageDeduplicationIdStrategy": return
target.getConfiguration().getMessageDeduplicationIdStrategy();
case "messagegroupidstrategy":
case "messageGroupIdStrategy": return
target.getConfiguration().getMessageGroupIdStrategy();
+ case "messageheaderexceededlimit":
+ case "messageHeaderExceededLimit": return
target.getConfiguration().getMessageHeaderExceededLimit();
case "messageretentionperiod":
case "messageRetentionPeriod": return
target.getConfiguration().getMessageRetentionPeriod();
case "operation": return target.getConfiguration().getOperation();
diff --git
a/components/camel-aws/camel-aws2-sqs/src/generated/java/org/apache/camel/component/aws2/sqs/Sqs2EndpointUriFactory.java
b/components/camel-aws/camel-aws2-sqs/src/generated/java/org/apache/camel/component/aws2/sqs/Sqs2EndpointUriFactory.java
index 444fb32..9893d69 100644
---
a/components/camel-aws/camel-aws2-sqs/src/generated/java/org/apache/camel/component/aws2/sqs/Sqs2EndpointUriFactory.java
+++
b/components/camel-aws/camel-aws2-sqs/src/generated/java/org/apache/camel/component/aws2/sqs/Sqs2EndpointUriFactory.java
@@ -20,9 +20,10 @@ public class Sqs2EndpointUriFactory extends
org.apache.camel.support.component.E
private static final Set<String> PROPERTY_NAMES;
private static final Set<String> SECRET_PROPERTY_NAMES;
static {
- Set<String> props = new HashSet<>(62);
+ Set<String> props = new HashSet<>(63);
props.add("queueUrl");
props.add("initialDelay");
+ props.add("messageHeaderExceededLimit");
props.add("proxyPort");
props.add("protocol");
props.add("attributeNames");
diff --git
a/components/camel-aws/camel-aws2-sqs/src/generated/resources/org/apache/camel/component/aws2/sqs/aws2-sqs.json
b/components/camel-aws/camel-aws2-sqs/src/generated/resources/org/apache/camel/component/aws2/sqs/aws2-sqs.json
index dd1d6f5..e65b419 100644
---
a/components/camel-aws/camel-aws2-sqs/src/generated/resources/org/apache/camel/component/aws2/sqs/aws2-sqs.json
+++
b/components/camel-aws/camel-aws2-sqs/src/generated/resources/org/apache/camel/component/aws2/sqs/aws2-sqs.json
@@ -26,7 +26,7 @@
"amazonSQSClient": { "kind": "property", "displayName": "Amazon
SQSClient", "group": "common", "label": "", "required": false, "type":
"object", "javaType": "software.amazon.awssdk.services.sqs.SqsClient",
"deprecated": false, "deprecationNote": "", "autowired": true, "secret": false,
"configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration",
"configurationField": "configuration", "description": "To use the AmazonSQS as
client" },
"autoCreateQueue": { "kind": "property", "displayName": "Auto Create
Queue", "group": "common", "label": "", "required": false, "type": "boolean",
"javaType": "boolean", "deprecated": false, "autowired": false, "secret":
false, "defaultValue": false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "Setting the autocreation of the queue" },
"configuration": { "kind": "property", "displayName": "Configuration",
"group": "common", "label": "", "required": false, "type": "object",
"javaType": "org.apache.camel.component.aws2.sqs.Sqs2Configuration",
"deprecated": false, "autowired": false, "secret": false, "description": "The
AWS SQS default configuration" },
- "overrideEndpoint": { "kind": "property", "displayName": "Override
Endpoint", "group": "common", "label": "", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "Set the need for overidding the endpoint. This
option needs to be used in combination with uriEndpoint [...]
+ "overrideEndpoint": { "kind": "property", "displayName": "Override
Endpoint", "group": "common", "label": "", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "Set the need for overriding the endpoint. This
option needs to be used in combination with uriEndpoint [...]
"protocol": { "kind": "property", "displayName": "Protocol", "group":
"common", "label": "", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": "https", "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "The underlying protocol used to communicate
with SQS" },
"proxyProtocol": { "kind": "property", "displayName": "Proxy Protocol",
"group": "common", "label": "", "required": false, "type": "object",
"javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS"
], "deprecated": false, "autowired": false, "secret": false, "defaultValue":
"HTTPS", "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "To define a proxy protocol when instantiating
the [...]
"queueOwnerAWSAccountId": { "kind": "property", "displayName": "Queue
Owner AWSAccount Id", "group": "common", "label": "", "required": false,
"type": "string", "javaType": "java.lang.String", "deprecated": false,
"autowired": false, "secret": true, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "Specify the queue owner aws account id when
you need to connect the queue with different account owner." },
@@ -52,15 +52,16 @@
"lazyStartProducer": { "kind": "property", "displayName": "Lazy Start
Producer", "group": "producer", "label": "producer", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": false, "description": "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 star [...]
"messageDeduplicationIdStrategy": { "kind": "property", "displayName":
"Message Deduplication Id Strategy", "group": "producer", "label": "producer",
"required": false, "type": "string", "javaType": "java.lang.String", "enum": [
"useExchangeId", "useContentBasedDeduplication" ], "deprecated": false,
"autowired": false, "secret": false, "defaultValue": "useExchangeId",
"configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration",
"configurationField": "configuration", [...]
"messageGroupIdStrategy": { "kind": "property", "displayName": "Message
Group Id Strategy", "group": "producer", "label": "producer", "required":
false, "type": "string", "javaType": "java.lang.String", "enum": [
"useConstant", "useExchangeId", "usePropertyValue" ], "deprecated": false,
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "Only for FIFO queues. Strateg [...]
+ "messageHeaderExceededLimit": { "kind": "property", "displayName":
"Message Header Exceeded Limit", "group": "producer", "label": "producer",
"required": false, "type": "string", "javaType": "java.lang.String", "enum": [
"WARN", "WARN_ONCE", "IGNORE", "FAIL" ], "deprecated": false, "autowired":
false, "secret": false, "defaultValue": "WARN", "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "What to do [...]
"operation": { "kind": "property", "displayName": "Operation", "group":
"producer", "label": "producer", "required": false, "type": "object",
"javaType": "org.apache.camel.component.aws2.sqs.Sqs2Operations", "enum": [
"sendBatchMessage", "deleteMessage", "listQueues", "purgeQueue", "deleteQueue"
], "deprecated": false, "autowired": false, "secret": false,
"configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration",
"configurationField": "configuration", "description [...]
"autowiredEnabled": { "kind": "property", "displayName": "Autowired
Enabled", "group": "advanced", "label": "advanced", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": true, "description": "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 t [...]
"delayQueue": { "kind": "property", "displayName": "Delay Queue", "group":
"advanced", "label": "advanced", "required": false, "type": "boolean",
"javaType": "boolean", "deprecated": false, "autowired": false, "secret":
false, "defaultValue": false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "Define if you want to apply delaySeconds
option to the queue or on single messages" },
- "queueUrl": { "kind": "property", "displayName": "Queue Url", "group":
"advanced", "label": "advanced", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "autowired": false,
"secret": false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "To define the queueUrl explicitly. All other
parameters, which would influence the queueUrl, are ignored. This parameter is
[...]
"proxyHost": { "kind": "property", "displayName": "Proxy Host", "group":
"proxy", "label": "proxy", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration",
"configurationField": "configuration", "description": "To define a proxy host
when instantiating the SQS client" },
"proxyPort": { "kind": "property", "displayName": "Proxy Port", "group":
"proxy", "label": "proxy", "required": false, "type": "integer", "javaType":
"java.lang.Integer", "deprecated": false, "autowired": false, "secret": false,
"configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration",
"configurationField": "configuration", "description": "To define a proxy port
when instantiating the SQS client" },
"maximumMessageSize": { "kind": "property", "displayName": "Maximum
Message Size", "group": "queue", "label": "queue", "required": false, "type":
"integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired":
false, "secret": false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "The maximumMessageSize (in bytes) an SQS
message can contain for this queue." },
"messageRetentionPeriod": { "kind": "property", "displayName": "Message
Retention Period", "group": "queue", "label": "queue", "required": false,
"type": "integer", "javaType": "java.lang.Integer", "deprecated": false,
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "The messageRetentionPeriod (in seconds) a
message will be retained by SQS for this queue." },
"policy": { "kind": "property", "displayName": "Policy", "group": "queue",
"label": "queue", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration",
"configurationField": "configuration", "description": "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 [...]
+ "queueUrl": { "kind": "property", "displayName": "Queue Url", "group":
"queue", "label": "queue", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration",
"configurationField": "configuration", "description": "To define the queueUrl
explicitly. All other parameters, which would influence the queueUrl, are
ignored. This parameter is inten [...]
"receiveMessageWaitTimeSeconds": { "kind": "property", "displayName":
"Receive Message Wait Time Seconds", "group": "queue", "label": "queue",
"required": false, "type": "integer", "javaType": "java.lang.Integer",
"deprecated": false, "autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "If you do not specify WaitTimeSeconds in the
request, the queue attribute ReceiveM [...]
"redrivePolicy": { "kind": "property", "displayName": "Redrive Policy",
"group": "queue", "label": "queue", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "autowired": false,
"secret": false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "Specify the policy that send message to
DeadLetter queue. See detail at Amazon docs." },
"accessKey": { "kind": "property", "displayName": "Access Key", "group":
"security", "label": "security", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "autowired": false,
"secret": true, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "Amazon AWS Access Key" },
@@ -72,7 +73,7 @@
"amazonSQSClient": { "kind": "parameter", "displayName": "Amazon
SQSClient", "group": "common", "label": "", "required": false, "type":
"object", "javaType": "software.amazon.awssdk.services.sqs.SqsClient",
"deprecated": false, "deprecationNote": "", "autowired": true, "secret": false,
"configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration",
"configurationField": "configuration", "description": "To use the AmazonSQS as
client" },
"autoCreateQueue": { "kind": "parameter", "displayName": "Auto Create
Queue", "group": "common", "label": "", "required": false, "type": "boolean",
"javaType": "boolean", "deprecated": false, "autowired": false, "secret":
false, "defaultValue": false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "Setting the autocreation of the queue" },
"headerFilterStrategy": { "kind": "parameter", "displayName": "Header
Filter Strategy", "group": "common", "label": "", "required": false, "type":
"object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy",
"deprecated": false, "autowired": false, "secret": false, "description": "To
use a custom HeaderFilterStrategy to map headers to\/from Camel." },
- "overrideEndpoint": { "kind": "parameter", "displayName": "Override
Endpoint", "group": "common", "label": "", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "Set the need for overidding the endpoint. This
option needs to be used in combination with uriEndpoin [...]
+ "overrideEndpoint": { "kind": "parameter", "displayName": "Override
Endpoint", "group": "common", "label": "", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "Set the need for overriding the endpoint. This
option needs to be used in combination with uriEndpoin [...]
"protocol": { "kind": "parameter", "displayName": "Protocol", "group":
"common", "label": "", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": "https", "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "The underlying protocol used to communicate
with SQS" },
"proxyProtocol": { "kind": "parameter", "displayName": "Proxy Protocol",
"group": "common", "label": "", "required": false, "type": "object",
"javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS"
], "deprecated": false, "autowired": false, "secret": false, "defaultValue":
"HTTPS", "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "To define a proxy protocol when instantiating
th [...]
"queueOwnerAWSAccountId": { "kind": "parameter", "displayName": "Queue
Owner AWSAccount Id", "group": "common", "label": "", "required": false,
"type": "string", "javaType": "java.lang.String", "deprecated": false,
"autowired": false, "secret": true, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "Specify the queue owner aws account id when
you need to connect the queue with different account owner." },
@@ -103,14 +104,15 @@
"lazyStartProducer": { "kind": "parameter", "displayName": "Lazy Start
Producer", "group": "producer", "label": "producer", "required": false, "type":
"boolean", "javaType": "boolean", "deprecated": false, "autowired": false,
"secret": false, "defaultValue": false, "description": "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 sta [...]
"messageDeduplicationIdStrategy": { "kind": "parameter", "displayName":
"Message Deduplication Id Strategy", "group": "producer", "label": "producer",
"required": false, "type": "string", "javaType": "java.lang.String", "enum": [
"useExchangeId", "useContentBasedDeduplication" ], "deprecated": false,
"autowired": false, "secret": false, "defaultValue": "useExchangeId",
"configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration",
"configurationField": "configuration" [...]
"messageGroupIdStrategy": { "kind": "parameter", "displayName": "Message
Group Id Strategy", "group": "producer", "label": "producer", "required":
false, "type": "string", "javaType": "java.lang.String", "enum": [
"useConstant", "useExchangeId", "usePropertyValue" ], "deprecated": false,
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "Only for FIFO queues. Strate [...]
+ "messageHeaderExceededLimit": { "kind": "parameter", "displayName":
"Message Header Exceeded Limit", "group": "producer", "label": "producer",
"required": false, "type": "string", "javaType": "java.lang.String", "enum": [
"WARN", "WARN_ONCE", "IGNORE", "FAIL" ], "deprecated": false, "autowired":
false, "secret": false, "defaultValue": "WARN", "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "What to d [...]
"operation": { "kind": "parameter", "displayName": "Operation", "group":
"producer", "label": "producer", "required": false, "type": "object",
"javaType": "org.apache.camel.component.aws2.sqs.Sqs2Operations", "enum": [
"sendBatchMessage", "deleteMessage", "listQueues", "purgeQueue", "deleteQueue"
], "deprecated": false, "autowired": false, "secret": false,
"configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration",
"configurationField": "configuration", "descriptio [...]
"delayQueue": { "kind": "parameter", "displayName": "Delay Queue",
"group": "advanced", "label": "advanced", "required": false, "type": "boolean",
"javaType": "boolean", "deprecated": false, "autowired": false, "secret":
false, "defaultValue": false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "Define if you want to apply delaySeconds
option to the queue or on single messages" },
- "queueUrl": { "kind": "parameter", "displayName": "Queue Url", "group":
"advanced", "label": "advanced", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "autowired": false,
"secret": false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "To define the queueUrl explicitly. All other
parameters, which would influence the queueUrl, are ignored. This parameter i
[...]
"proxyHost": { "kind": "parameter", "displayName": "Proxy Host", "group":
"proxy", "label": "proxy", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration",
"configurationField": "configuration", "description": "To define a proxy host
when instantiating the SQS client" },
"proxyPort": { "kind": "parameter", "displayName": "Proxy Port", "group":
"proxy", "label": "proxy", "required": false, "type": "integer", "javaType":
"java.lang.Integer", "deprecated": false, "autowired": false, "secret": false,
"configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration",
"configurationField": "configuration", "description": "To define a proxy port
when instantiating the SQS client" },
"maximumMessageSize": { "kind": "parameter", "displayName": "Maximum
Message Size", "group": "queue", "label": "queue", "required": false, "type":
"integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired":
false, "secret": false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "The maximumMessageSize (in bytes) an SQS
message can contain for this queue." },
"messageRetentionPeriod": { "kind": "parameter", "displayName": "Message
Retention Period", "group": "queue", "label": "queue", "required": false,
"type": "integer", "javaType": "java.lang.Integer", "deprecated": false,
"autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "The messageRetentionPeriod (in seconds) a
message will be retained by SQS for this queue." },
"policy": { "kind": "parameter", "displayName": "Policy", "group":
"queue", "label": "queue", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration",
"configurationField": "configuration", "description": "The policy for this
queue. It can be loaded by default from classpath, but you can prefix with
classpath:, file:, or http: to load th [...]
+ "queueUrl": { "kind": "parameter", "displayName": "Queue Url", "group":
"queue", "label": "queue", "required": false, "type": "string", "javaType":
"java.lang.String", "deprecated": false, "autowired": false, "secret": false,
"configurationClass": "org.apache.camel.component.aws2.sqs.Sqs2Configuration",
"configurationField": "configuration", "description": "To define the queueUrl
explicitly. All other parameters, which would influence the queueUrl, are
ignored. This parameter is inte [...]
"receiveMessageWaitTimeSeconds": { "kind": "parameter", "displayName":
"Receive Message Wait Time Seconds", "group": "queue", "label": "queue",
"required": false, "type": "integer", "javaType": "java.lang.Integer",
"deprecated": false, "autowired": false, "secret": false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "If you do not specify WaitTimeSeconds in the
request, the queue attribute Receive [...]
"redrivePolicy": { "kind": "parameter", "displayName": "Redrive Policy",
"group": "queue", "label": "queue", "required": false, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "autowired": false,
"secret": false, "configurationClass":
"org.apache.camel.component.aws2.sqs.Sqs2Configuration", "configurationField":
"configuration", "description": "Specify the policy that send message to
DeadLetter queue. See detail at Amazon docs." },
"backoffErrorThreshold": { "kind": "parameter", "displayName": "Backoff
Error Threshold", "group": "scheduler", "label": "consumer,scheduler",
"required": false, "type": "integer", "javaType": "int", "deprecated": false,
"autowired": false, "secret": false, "description": "The number of subsequent
error polls (failed due some error) that should happen before the
backoffMultipler should kick-in." },
diff --git
a/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Configuration.java
b/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Configuration.java
index 909c91f..908a7d2 100644
---
a/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Configuration.java
+++
b/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Configuration.java
@@ -55,6 +55,10 @@ public class Sqs2Configuration implements Cloneable {
private boolean overrideEndpoint;
@UriParam
private String uriEndpointOverride;
+ @UriParam(label = "producer")
+ private Integer delaySeconds;
+ @UriParam(label = "advanced")
+ private boolean delayQueue;
// consumer properties
@UriParam(label = "consumer", defaultValue = "true")
@@ -81,15 +85,8 @@ public class Sqs2Configuration implements Cloneable {
private boolean serverSideEncryptionEnabled;
@UriParam(label = "consumer", defaultValue = "1")
private int concurrentConsumers = 1;
- @UriParam(label = "advanced")
- private String queueUrl;
// producer properties
- @UriParam(label = "producer")
- private Integer delaySeconds;
- // producer properties
- @UriParam(label = "advanced")
- private boolean delayQueue;
@UriParam(label = "producer", javaType = "java.lang.String", enums =
"useConstant,useExchangeId,usePropertyValue")
private MessageGroupIdStrategy messageGroupIdStrategy;
@UriParam(label = "producer", javaType = "java.lang.String", defaultValue
= "useExchangeId",
@@ -99,6 +96,8 @@ public class Sqs2Configuration implements Cloneable {
private Sqs2Operations operation;
@UriParam(label = "producer", defaultValue = ",")
private String batchSeparator = ",";
+ @UriParam(label = "producer", defaultValue = "WARN", enums =
"WARN,WARN_ONCE,IGNORE,FAIL")
+ private String messageHeaderExceededLimit = "WARN";
// queue properties
@UriParam(label = "queue")
@@ -109,6 +108,8 @@ public class Sqs2Configuration implements Cloneable {
private Integer receiveMessageWaitTimeSeconds;
@UriParam(label = "queue")
private String policy;
+ @UriParam(label = "queue")
+ private String queueUrl;
// dead letter queue properties
@UriParam(label = "queue")
@@ -588,12 +589,29 @@ public class Sqs2Configuration implements Cloneable {
this.batchSeparator = batchSeparator;
}
+ public String getMessageHeaderExceededLimit() {
+ return messageHeaderExceededLimit;
+ }
+
+ /**
+ * What to do if sending to AWS SQS has more messages than AWS allows
(currently only maximum 10 message headers is
+ * 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.
+ */
+ public void setMessageHeaderExceededLimit(String
messageHeaderExceededLimit) {
+ this.messageHeaderExceededLimit = messageHeaderExceededLimit;
+ }
+
public boolean isOverrideEndpoint() {
return overrideEndpoint;
}
/**
- * Set the need for overidding the endpoint. This option needs to be used
in combination with uriEndpointOverride
+ * Set the need for overriding the endpoint. This option needs to be used
in combination with uriEndpointOverride
* option
*/
public void setOverrideEndpoint(boolean overrideEndpoint) {
diff --git
a/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Producer.java
b/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Producer.java
index 3ca128b..b894703 100644
---
a/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Producer.java
+++
b/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Producer.java
@@ -303,9 +303,21 @@ public class Sqs2Producer extends DefaultProducer {
if (mav != null) {
result.put(entry.getKey(), mav);
} else {
- // cannot translate the message header to message
attribute value
- LOG.warn("Cannot put the message header key={},
value={} into Sqs MessageAttribute", entry.getKey(),
- entry.getValue());
+ String action =
getConfiguration().getMessageHeaderExceededLimit();
+ if ("WARN".equalsIgnoreCase(action) ||
"WARN_ONCE".equalsIgnoreCase(action)) {
+ // cannot translate the message header to message
attribute value
+ LOG.warn("Cannot put the message header key={},
value={} into SQS MessageAttribute", entry.getKey(),
+ entry.getValue());
+ if ("WARN_ONCE".equalsIgnoreCase(action)) {
+ break;
+ }
+ } else if ("IGNORE".equalsIgnoreCase(action)) {
+ break;
+ } else if ("FAIL".equalsIgnoreCase(action)) {
+ throw new IllegalArgumentException(
+ "Number of message headers exceeded. At
most " + MAX_ATTRIBUTES
+ + " headers is
allowed when sending to AWS SQS.");
+ }
}
}
}