You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2021/04/15 12:56:26 UTC
[camel] branch master updated (5a7ab23 -> 11c7f8e)
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.
from 5a7ab23 Regen for commit d2524c204ff03d7aad899aad8c527e014e13d9df
new 718b582 CAMEL-16512 - Camel-Azure components: mark the clients as autowired - Storage-Queue
new d6a8d71 CAMEL-16512 - Camel-Azure components: mark the clients as autowired - Storage-Queue
new 78fb502d CAMEL-16506 - Camel-Azure-Storage-queue: Add Azurite IT Tests
new 9d7f371 CAMEL-16506 - Camel-Azure-Storage-queue: Add Azurite IT Tests
new 9347846 CAMEL-16506 - Camel-Azure-Storage-queue: Add Azurite IT Tests
new 1474b83 CAMEL-16512 - Camel-Azure components: mark the clients as autowired - Storage-Blob
new 11c7f8e Camel-Azure-Storage-Queue: The 1.0.2 is using Jackson BOM 2.11.3 and it won't work with Jackson 2.12.x
The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../docs/azure-storage-queue-component.adoc | 4 +-
.../storage/blob/integration/BlobConsumerIT.java | 8 +-
.../storage/blob/integration/BlobProducerIT.java | 2 +-
.../camel-azure/camel-azure-storage-queue/pom.xml | 45 ++++++++
.../storage/queue/QueueComponentConfigurer.java | 5 +
.../storage/queue/QueueEndpointConfigurer.java | 5 +
.../azure/storage/queue/azure-storage-queue.json | 4 +-
.../main/docs/azure-storage-queue-component.adoc | 4 +-
.../azure/storage/queue/QueueConfiguration.java | 2 +
.../storage/queue/integration/QueueConsumerIT.java | 118 ---------------------
.../queue/integration/StorageQueueBase.java} | 29 ++---
.../queue/integration/StorageQueueConsumerIT.java | 71 +++++++++++++
...ProducerIT.java => StorageQueueProducerIT.java} | 92 +---------------
.../ROOT/pages/azure-storage-queue-component.adoc | 4 +-
14 files changed, 159 insertions(+), 234 deletions(-)
delete mode 100644 components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/QueueConsumerIT.java
copy components/camel-azure/{camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/integration/Base.java => camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/StorageQueueBase.java} (75%)
create mode 100644 components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/StorageQueueConsumerIT.java
rename components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/{QueueProducerIT.java => StorageQueueProducerIT.java} (53%)
[camel] 02/07: CAMEL-16512 - Camel-Azure components: mark the
clients as autowired - Storage-Queue
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit d6a8d7187c48f2da1177f17ed55457cb78acc803
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Apr 15 14:06:01 2021 +0200
CAMEL-16512 - Camel-Azure components: mark the clients as autowired - Storage-Queue
---
.../org/apache/camel/catalog/docs/azure-storage-queue-component.adoc | 4 ++--
.../component/azure/storage/queue/QueueComponentConfigurer.java | 5 +++++
.../camel/component/azure/storage/queue/QueueEndpointConfigurer.java | 5 +++++
.../camel/component/azure/storage/queue/azure-storage-queue.json | 4 ++--
.../src/main/docs/azure-storage-queue-component.adoc | 4 ++--
.../components/modules/ROOT/pages/azure-storage-queue-component.adoc | 4 ++--
6 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/azure-storage-queue-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/azure-storage-queue-component.adoc
index ee5af32..2a6c922 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/azure-storage-queue-component.adoc
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/azure-storage-queue-component.adoc
@@ -71,7 +71,7 @@ The Azure Storage Queue Service component supports 16 options, which are listed
| Name | Description | Default | Type
| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
| *configuration* (common) | The component configurations | | QueueConfiguration
-| *serviceClient* (common) | 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 accoun [...]
+| *serviceClient* (common) | *Autowired* 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 o [...]
| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
| *createQueue* (producer) | When is set to true, the queue will be automatically created when sending messages to the queue. | true | boolean
| *lazyStartProducer* (producer) | 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 [...]
@@ -115,7 +115,7 @@ with the following path and query parameters:
|===
| Name | Description | Default | Type
| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
-| *serviceClient* (common) | 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 accoun [...]
+| *serviceClient* (common) | *Autowired* 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 o [...]
| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
| *sendEmptyMessageWhenIdle* (consumer) | If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead. | false | boolean
| *exceptionHandler* (consumer) | 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. | | ExceptionHandler
diff --git a/components/camel-azure/camel-azure-storage-queue/src/generated/java/org/apache/camel/component/azure/storage/queue/QueueComponentConfigurer.java b/components/camel-azure/camel-azure-storage-queue/src/generated/java/org/apache/camel/component/azure/storage/queue/QueueComponentConfigurer.java
index d48cdd2..f9a9e87 100644
--- a/components/camel-azure/camel-azure-storage-queue/src/generated/java/org/apache/camel/component/azure/storage/queue/QueueComponentConfigurer.java
+++ b/components/camel-azure/camel-azure-storage-queue/src/generated/java/org/apache/camel/component/azure/storage/queue/QueueComponentConfigurer.java
@@ -61,6 +61,11 @@ public class QueueComponentConfigurer extends PropertyConfigurerSupport implemen
}
@Override
+ public String[] getAutowiredNames() {
+ return new String[]{"serviceClient"};
+ }
+
+ @Override
public Class<?> getOptionType(String name, boolean ignoreCase) {
switch (ignoreCase ? name.toLowerCase() : name) {
case "accesskey":
diff --git a/components/camel-azure/camel-azure-storage-queue/src/generated/java/org/apache/camel/component/azure/storage/queue/QueueEndpointConfigurer.java b/components/camel-azure/camel-azure-storage-queue/src/generated/java/org/apache/camel/component/azure/storage/queue/QueueEndpointConfigurer.java
index ada4709..cef9328 100644
--- a/components/camel-azure/camel-azure-storage-queue/src/generated/java/org/apache/camel/component/azure/storage/queue/QueueEndpointConfigurer.java
+++ b/components/camel-azure/camel-azure-storage-queue/src/generated/java/org/apache/camel/component/azure/storage/queue/QueueEndpointConfigurer.java
@@ -84,6 +84,11 @@ public class QueueEndpointConfigurer extends PropertyConfigurerSupport implement
}
@Override
+ public String[] getAutowiredNames() {
+ return new String[]{"serviceClient"};
+ }
+
+ @Override
public Class<?> getOptionType(String name, boolean ignoreCase) {
switch (ignoreCase ? name.toLowerCase() : name) {
case "accesskey":
diff --git a/components/camel-azure/camel-azure-storage-queue/src/generated/resources/org/apache/camel/component/azure/storage/queue/azure-storage-queue.json b/components/camel-azure/camel-azure-storage-queue/src/generated/resources/org/apache/camel/component/azure/storage/queue/azure-storage-queue.json
index 0674691..0517674 100644
--- a/components/camel-azure/camel-azure-storage-queue/src/generated/resources/org/apache/camel/component/azure/storage/queue/azure-storage-queue.json
+++ b/components/camel-azure/camel-azure-storage-queue/src/generated/resources/org/apache/camel/component/azure/storage/queue/azure-storage-queue.json
@@ -24,7 +24,7 @@
"componentProperties": {
"autoDiscoverClient": { "kind": "property", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.azure.storage.queue.QueueConfiguration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for a [...]
"configuration": { "kind": "property", "displayName": "Configuration", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.azure.storage.queue.QueueConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "The component configurations" },
- "serviceClient": { "kind": "property", "displayName": "Service Client", "group": "common", "label": "common", "required": false, "type": "object", "javaType": "com.azure.storage.queue.QueueServiceClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.queue.QueueConfiguration", "configurationField": "configuration", "description": "Service client to a storage account to interact with the queue service. This cl [...]
+ "serviceClient": { "kind": "property", "displayName": "Service Client", "group": "common", "label": "common", "required": false, "type": "object", "javaType": "com.azure.storage.queue.QueueServiceClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.queue.QueueConfiguration", "configurationField": "configuration", "description": "Service client to a storage account to interact with the [...]
"bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a me [...]
"createQueue": { "kind": "property", "displayName": "Create Queue", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.azure.storage.queue.QueueConfiguration", "configurationField": "configuration", "description": "When is set to true, the queue will be automatically created when sending messages to the q [...]
"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 [...]
@@ -43,7 +43,7 @@
"accountName": { "kind": "path", "displayName": "Account Name", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.queue.QueueConfiguration", "configurationField": "configuration", "description": "Azure account name to be used for authentication with azure queue services" },
"queueName": { "kind": "path", "displayName": "Queue Name", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.queue.QueueConfiguration", "configurationField": "configuration", "description": "The queue resource name" },
"autoDiscoverClient": { "kind": "parameter", "displayName": "Auto Discover Client", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.azure.storage.queue.QueueConfiguration", "configurationField": "configuration", "description": "Setting the autoDiscoverClient mechanism, if true, the component will look for [...]
- "serviceClient": { "kind": "parameter", "displayName": "Service Client", "group": "common", "label": "common", "required": false, "type": "object", "javaType": "com.azure.storage.queue.QueueServiceClient", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.queue.QueueConfiguration", "configurationField": "configuration", "description": "Service client to a storage account to interact with the queue service. This c [...]
+ "serviceClient": { "kind": "parameter", "displayName": "Service Client", "group": "common", "label": "common", "required": false, "type": "object", "javaType": "com.azure.storage.queue.QueueServiceClient", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.azure.storage.queue.QueueConfiguration", "configurationField": "configuration", "description": "Service client to a storage account to interact with the [...]
"bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a m [...]
"sendEmptyMessageWhenIdle": { "kind": "parameter", "displayName": "Send Empty Message When Idle", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead." },
"exceptionHandler": { "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "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 con [...]
diff --git a/components/camel-azure/camel-azure-storage-queue/src/main/docs/azure-storage-queue-component.adoc b/components/camel-azure/camel-azure-storage-queue/src/main/docs/azure-storage-queue-component.adoc
index ee5af32..2a6c922 100644
--- a/components/camel-azure/camel-azure-storage-queue/src/main/docs/azure-storage-queue-component.adoc
+++ b/components/camel-azure/camel-azure-storage-queue/src/main/docs/azure-storage-queue-component.adoc
@@ -71,7 +71,7 @@ The Azure Storage Queue Service component supports 16 options, which are listed
| Name | Description | Default | Type
| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
| *configuration* (common) | The component configurations | | QueueConfiguration
-| *serviceClient* (common) | 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 accoun [...]
+| *serviceClient* (common) | *Autowired* 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 o [...]
| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
| *createQueue* (producer) | When is set to true, the queue will be automatically created when sending messages to the queue. | true | boolean
| *lazyStartProducer* (producer) | 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 [...]
@@ -115,7 +115,7 @@ with the following path and query parameters:
|===
| Name | Description | Default | Type
| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
-| *serviceClient* (common) | 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 accoun [...]
+| *serviceClient* (common) | *Autowired* 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 o [...]
| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
| *sendEmptyMessageWhenIdle* (consumer) | If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead. | false | boolean
| *exceptionHandler* (consumer) | 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. | | ExceptionHandler
diff --git a/docs/components/modules/ROOT/pages/azure-storage-queue-component.adoc b/docs/components/modules/ROOT/pages/azure-storage-queue-component.adoc
index 6260f9d2..d4ebed1 100644
--- a/docs/components/modules/ROOT/pages/azure-storage-queue-component.adoc
+++ b/docs/components/modules/ROOT/pages/azure-storage-queue-component.adoc
@@ -73,7 +73,7 @@ The Azure Storage Queue Service component supports 16 options, which are listed
| Name | Description | Default | Type
| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
| *configuration* (common) | The component configurations | | QueueConfiguration
-| *serviceClient* (common) | 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 accoun [...]
+| *serviceClient* (common) | *Autowired* 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 o [...]
| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
| *createQueue* (producer) | When is set to true, the queue will be automatically created when sending messages to the queue. | true | boolean
| *lazyStartProducer* (producer) | 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 [...]
@@ -117,7 +117,7 @@ with the following path and query parameters:
|===
| Name | Description | Default | Type
| *autoDiscoverClient* (common) | Setting the autoDiscoverClient mechanism, if true, the component will look for a client instance in the registry automatically otherwise it will skip that checking. | true | boolean
-| *serviceClient* (common) | 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 accoun [...]
+| *serviceClient* (common) | *Autowired* 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 o [...]
| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored. | false | boolean
| *sendEmptyMessageWhenIdle* (consumer) | If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead. | false | boolean
| *exceptionHandler* (consumer) | 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. | | ExceptionHandler
[camel] 05/07: CAMEL-16506 - Camel-Azure-Storage-queue: Add Azurite
IT Tests
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 93478466328cb3c98d748d721d9a29f9e9b64e60
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Apr 15 14:49:49 2021 +0200
CAMEL-16506 - Camel-Azure-Storage-queue: Add Azurite IT Tests
---
.../queue/integration/StorageQueueBase.java | 1 +
.../queue/integration/StorageQueueConsumerIT.java | 55 ++------------
.../queue/integration/StorageQueueProducerIT.java | 88 +---------------------
3 files changed, 8 insertions(+), 136 deletions(-)
diff --git a/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/StorageQueueBase.java b/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/StorageQueueBase.java
index beb643d..4ec3979 100644
--- a/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/StorageQueueBase.java
+++ b/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/StorageQueueBase.java
@@ -80,6 +80,7 @@ public class StorageQueueBase extends CamelTestSupport {
configuration.setQueueName(queueName);
serviceClient = AzureStorageClientUtils.getClient();
+ serviceClient.getQueueClient(queueName).create();
}
}
diff --git a/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/StorageQueueConsumerIT.java b/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/StorageQueueConsumerIT.java
index 1396af6..9634fe1 100644
--- a/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/StorageQueueConsumerIT.java
+++ b/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/StorageQueueConsumerIT.java
@@ -17,55 +17,27 @@
package org.apache.camel.component.azure.storage.queue.integration;
import java.util.List;
-import java.util.Properties;
-import com.azure.storage.common.StorageSharedKeyCredential;
-import com.azure.storage.queue.QueueServiceClient;
-import org.apache.camel.CamelContext;
import org.apache.camel.EndpointInject;
import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.azure.storage.queue.QueueConfiguration;
-import org.apache.camel.component.azure.storage.queue.QueueTestUtils;
-import org.apache.camel.component.azure.storage.queue.client.QueueClientFactory;
-import org.apache.camel.component.azure.storage.queue.client.QueueClientWrapper;
-import org.apache.camel.component.azure.storage.queue.client.QueueServiceClientWrapper;
import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.apache.commons.lang3.RandomStringUtils;
-import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.TestInstance;
-import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
import static org.junit.jupiter.api.Assertions.assertEquals;
-@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class StorageQueueConsumerIT extends StorageQueueBase {
@EndpointInject("mock:result")
private MockEndpoint result;
private String resultName = "mock:result";
- private String queueName;
- private QueueClientWrapper queueClientWrapper;
-
@BeforeAll
- public void prepare() throws Exception {
- queueName = RandomStringUtils.randomAlphabetic(10).toLowerCase();
-
- final QueueConfiguration configuration = new QueueConfiguration();
- configuration.setCredentials(storageSharedKeyCredential());
- configuration.setQueueName(queueName);
-
- final QueueServiceClient serviceClient = QueueClientFactory.createQueueServiceClient(configuration);
- queueClientWrapper = new QueueServiceClientWrapper(serviceClient).getQueueClientWrapper(queueName);
-
- queueClientWrapper.create(null, null);
- queueClientWrapper.sendMessage("test-message-1", null, null, null);
- queueClientWrapper.sendMessage("test-message-2", null, null, null);
- queueClientWrapper.sendMessage("test-message-3", null, null, null);
+ public void setup() {
+ serviceClient.getQueueClient(queueName).sendMessage("test-message-1");
+ serviceClient.getQueueClient(queueName).sendMessage("test-message-2");
+ serviceClient.getQueueClient(queueName).sendMessage("test-message-3");
}
@Test
@@ -85,32 +57,15 @@ class StorageQueueConsumerIT extends StorageQueueBase {
assertEquals("test-message-3", exchanges.get(2).getMessage().getBody());
}
- @AfterAll
- public void tearDown() {
- queueClientWrapper.delete(null);
- }
-
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
- from("azure-storage-queue://cameldev/" + queueName + "?credentials=#creds&maxMessages=5")
+ from("azure-storage-queue://cameldev/" + queueName + "?maxMessages=5")
.to(resultName);
}
};
}
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
- context.getRegistry().bind("creds", storageSharedKeyCredential());
- return context;
- }
-
- private StorageSharedKeyCredential storageSharedKeyCredential() throws Exception {
- final Properties properties = QueueTestUtils.loadAzureAccessFromJvmEnv();
- return new StorageSharedKeyCredential(properties.getProperty("account_name"), properties.getProperty("access_key"));
- }
}
diff --git a/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/StorageQueueProducerIT.java b/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/StorageQueueProducerIT.java
index 47025aa..b10f43f 100644
--- a/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/StorageQueueProducerIT.java
+++ b/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/StorageQueueProducerIT.java
@@ -16,36 +16,20 @@
*/
package org.apache.camel.component.azure.storage.queue.integration;
-import java.util.List;
import java.util.Map;
-import java.util.Properties;
-import java.util.stream.Collectors;
-import com.azure.storage.common.StorageSharedKeyCredential;
-import com.azure.storage.queue.QueueServiceClient;
-import com.azure.storage.queue.models.QueueMessageItem;
-import org.apache.camel.CamelContext;
import org.apache.camel.EndpointInject;
import org.apache.camel.ExchangePattern;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.azure.storage.queue.QueueConfiguration;
import org.apache.camel.component.azure.storage.queue.QueueConstants;
-import org.apache.camel.component.azure.storage.queue.QueueTestUtils;
-import org.apache.camel.component.azure.storage.queue.client.QueueClientFactory;
-import org.apache.camel.component.azure.storage.queue.client.QueueServiceClientWrapper;
import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit5.CamelTestSupport;
import org.apache.commons.lang3.RandomStringUtils;
-import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.TestInstance;
-import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
-@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class StorageQueueProducerIT extends StorageQueueBase {
@EndpointInject
@@ -55,21 +39,8 @@ class StorageQueueProducerIT extends StorageQueueBase {
private MockEndpoint result;
private String resultName = "mock:result";
- private QueueConfiguration configuration;
- private QueueServiceClientWrapper serviceClient;
-
- @BeforeAll
- public void prepare() throws Exception {
- configuration = new QueueConfiguration();
- configuration.setCredentials(storageSharedKeyCredential());
-
- final QueueServiceClient client = QueueClientFactory.createQueueServiceClient(configuration);
- serviceClient = new QueueServiceClientWrapper(client);
- }
-
@Test
public void testCreateDeleteQueue() throws InterruptedException {
- final String queueName = RandomStringUtils.randomAlphabetic(10).toLowerCase();
template.send("direct:createQueue", ExchangePattern.InOnly, exchange -> {
exchange.getIn().setHeader(QueueConstants.QUEUE_NAME, queueName);
@@ -77,9 +48,6 @@ class StorageQueueProducerIT extends StorageQueueBase {
result.assertIsSatisfied();
- // check name
- assertEquals(queueName, serviceClient.listQueues(null, null).get(0).getName());
-
// delete queue
template.send("direct:deleteQueue", ExchangePattern.InOnly, exchange -> {
exchange.getIn().setHeader(QueueConstants.QUEUE_NAME, queueName);
@@ -91,9 +59,8 @@ class StorageQueueProducerIT extends StorageQueueBase {
result.assertIsSatisfied();
// check name
- assertEquals("testqueue", serviceClient.listQueues(null, null).get(0).getName());
+ assertEquals("testqueue", serviceClient.getQueueClient("testqueue").getQueueName());
- serviceClient.getQueueClientWrapper("testqueue").delete(null);
}
@Test
@@ -124,10 +91,6 @@ class StorageQueueProducerIT extends StorageQueueBase {
final Map<String, Object> sentMessageHeaders = result.getExchanges().get(0).getMessage().getHeaders();
- // check message
- assertEquals("test-message-1",
- serviceClient.getQueueClientWrapper(queueName).peekMessages(1, null).get(0).getMessageText());
-
result.reset();
template.send("direct:deleteMessage", ExchangePattern.InOnly, exchange -> {
@@ -136,49 +99,7 @@ class StorageQueueProducerIT extends StorageQueueBase {
exchange.getIn().setHeader(QueueConstants.POP_RECEIPT, sentMessageHeaders.get(QueueConstants.POP_RECEIPT));
});
- // check
- assertTrue(serviceClient.getQueueClientWrapper(queueName).peekMessages(1, null).isEmpty());
-
- result.assertIsSatisfied();
-
- serviceClient.getQueueClientWrapper(queueName).delete(null);
- }
-
- @Test
- public void testReceiveMessages() throws InterruptedException {
- final String queueName = RandomStringUtils.randomAlphabetic(10).toLowerCase();
- serviceClient.getQueueClientWrapper(queueName).create(null, null);
- serviceClient.getQueueClientWrapper(queueName).sendMessage("test-message-1", null, null, null);
- serviceClient.getQueueClientWrapper(queueName).sendMessage("test-message-2", null, null, null);
- serviceClient.getQueueClientWrapper(queueName).sendMessage("test-message-3", null, null, null);
-
- result.expectedMessageCount(1);
-
- template.send("direct:receiveMessages", ExchangePattern.InOnly, exchange -> {
- exchange.getIn().setHeader(QueueConstants.QUEUE_NAME, queueName);
- exchange.getIn().setHeader(QueueConstants.MAX_MESSAGES, 3);
- });
-
result.assertIsSatisfied();
-
- final List<QueueMessageItem> messages = result.getExchanges().get(0).getMessage().getBody(List.class);
- final List<String> messagesText = messages
- .stream()
- .map(QueueMessageItem::getMessageText)
- .collect(Collectors.toList());
-
- assertTrue(messagesText.contains("test-message-1"));
- assertTrue(messagesText.contains("test-message-2"));
- assertTrue(messagesText.contains("test-message-3"));
-
- serviceClient.getQueueClientWrapper(queueName).delete(null);
- }
-
- @Override
- protected CamelContext createCamelContext() throws Exception {
- CamelContext context = super.createCamelContext();
- context.getRegistry().bind("creds", storageSharedKeyCredential());
- return context;
}
@Override
@@ -209,12 +130,7 @@ class StorageQueueProducerIT extends StorageQueueBase {
};
}
- private StorageSharedKeyCredential storageSharedKeyCredential() throws Exception {
- final Properties properties = QueueTestUtils.loadAzureAccessFromJvmEnv();
- return new StorageSharedKeyCredential(properties.getProperty("account_name"), properties.getProperty("access_key"));
- }
-
private String componentUri(final String operation, final String queueName) {
- return String.format("azure-storage-queue://cameldev/%s?credentials=#creds&operation=%s", queueName, operation);
+ return String.format("azure-storage-queue://cameldev/%s?operation=%s", queueName, operation);
}
}
[camel] 07/07: Camel-Azure-Storage-Queue: The 1.0.2 is using
Jackson BOM 2.11.3 and it won't work with Jackson 2.12.x
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 11c7f8ed4aef8f379d3d6cc1d6376eba57ec253f
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Apr 15 14:54:33 2021 +0200
Camel-Azure-Storage-Queue: The 1.0.2 is using Jackson BOM 2.11.3 and it won't work with Jackson 2.12.x
---
.../camel-azure/camel-azure-storage-queue/pom.xml | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/components/camel-azure/camel-azure-storage-queue/pom.xml b/components/camel-azure/camel-azure-storage-queue/pom.xml
index 5e13714..e9db7ce 100644
--- a/components/camel-azure/camel-azure-storage-queue/pom.xml
+++ b/components/camel-azure/camel-azure-storage-queue/pom.xml
@@ -47,6 +47,27 @@
<artifactId>azure-storage-queue</artifactId>
</dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>${azure-jackson2-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-core</artifactId>
+ <version>${azure-jackson2-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ <version>${azure-jackson2-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.dataformat</groupId>
+ <artifactId>jackson-dataformat-xml</artifactId>
+ <version>${azure-jackson2-version}</version>
+ </dependency>
+
<!-- extras -->
<dependency>
<groupId>commons-io</groupId>
[camel] 06/07: CAMEL-16512 - Camel-Azure components: mark the
clients as autowired - Storage-Blob
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 1474b83e25bb7e3a3639341cfb7ef22f7d6cd452
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Apr 15 14:52:07 2021 +0200
CAMEL-16512 - Camel-Azure components: mark the clients as autowired - Storage-Blob
---
.../component/azure/storage/blob/integration/BlobConsumerIT.java | 8 ++++----
.../component/azure/storage/blob/integration/BlobProducerIT.java | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/components/camel-azure/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/integration/BlobConsumerIT.java b/components/camel-azure/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/integration/BlobConsumerIT.java
index f0f3200..17b74f8 100644
--- a/components/camel-azure/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/integration/BlobConsumerIT.java
+++ b/components/camel-azure/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/integration/BlobConsumerIT.java
@@ -215,7 +215,7 @@ class BlobConsumerIT extends Base {
@Override
public void configure() {
from("direct:createBlob")
- .to("azure-storage-blob://cameldev?blobServiceClient=#serviceClient&operation=uploadBlockBlob");
+ .to("azure-storage-blob://cameldev?operation=uploadBlockBlob");
from("azure-storage-blob://cameldev/" + containerName + "?blobName=" + blobName
+ "&blobServiceClient=#serviceClient&fileDir="
@@ -225,15 +225,15 @@ class BlobConsumerIT extends Base {
+ "&blobServiceClient=#serviceClient")
.to("mock:resultOutputStream");
- from("azure-storage-blob://cameldev/" + batchContainerName + "?blobServiceClient=#serviceClient")
+ from("azure-storage-blob://cameldev/" + batchContainerName)
.to("mock:resultBatch");
- from("azure-storage-blob://cameldev/" + batchContainerName + "?blobServiceClient=#serviceClient&fileDir="
+ from("azure-storage-blob://cameldev/" + batchContainerName + "?fileDir="
+ testDir.toString()).to("mock:resultBatchFile");
// if regex is set then prefix should have no effect
from("azure-storage-blob://cameldev/" + batchContainerName
- + "?blobServiceClient=#serviceClient&prefix=aaaa®ex=" + regex)
+ + "?prefix=aaaa®ex=" + regex)
.idempotentConsumer(body(), new MemoryIdempotentRepository())
.to("mock:resultRegex");
}
diff --git a/components/camel-azure/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/integration/BlobProducerIT.java b/components/camel-azure/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/integration/BlobProducerIT.java
index 9f373c6..f3adbec 100644
--- a/components/camel-azure/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/integration/BlobProducerIT.java
+++ b/components/camel-azure/camel-azure-storage-blob/src/test/java/org/apache/camel/component/azure/storage/blob/integration/BlobProducerIT.java
@@ -212,7 +212,7 @@ class BlobProducerIT extends Base {
}
private String componentUri(final String operation) {
- return String.format("azure-storage-blob://cameldev/%s?blobServiceClient=#serviceClient&operation=%s", containerName,
+ return String.format("azure-storage-blob://cameldev/%s?operation=%s", containerName,
operation);
}
}
[camel] 03/07: CAMEL-16506 - Camel-Azure-Storage-queue: Add Azurite
IT Tests
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 78fb502d5c9844923b01c475638c06326e2a381f
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Apr 15 14:06:13 2021 +0200
CAMEL-16506 - Camel-Azure-Storage-queue: Add Azurite IT Tests
---
.../camel-azure/camel-azure-storage-queue/pom.xml | 24 ++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/components/camel-azure/camel-azure-storage-queue/pom.xml b/components/camel-azure/camel-azure-storage-queue/pom.xml
index f7c4780..5e13714 100644
--- a/components/camel-azure/camel-azure-storage-queue/pom.xml
+++ b/components/camel-azure/camel-azure-storage-queue/pom.xml
@@ -75,6 +75,30 @@
<version>${commons-lang3-version}</version>
<scope>test</scope>
</dependency>
+ <!-- test infra -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-test-infra-common</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-test-infra-azure-common</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-test-infra-azure-storage-queue</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
[camel] 01/07: CAMEL-16512 - Camel-Azure components: mark the
clients as autowired - Storage-Queue
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 718b582bb7e980f2f926de7e2a064c299aec7782
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Apr 15 14:03:35 2021 +0200
CAMEL-16512 - Camel-Azure components: mark the clients as autowired - Storage-Queue
---
.../apache/camel/component/azure/storage/queue/QueueConfiguration.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/components/camel-azure/camel-azure-storage-queue/src/main/java/org/apache/camel/component/azure/storage/queue/QueueConfiguration.java b/components/camel-azure/camel-azure-storage-queue/src/main/java/org/apache/camel/component/azure/storage/queue/QueueConfiguration.java
index bb3409e..2fab4be 100644
--- a/components/camel-azure/camel-azure-storage-queue/src/main/java/org/apache/camel/component/azure/storage/queue/QueueConfiguration.java
+++ b/components/camel-azure/camel-azure-storage-queue/src/main/java/org/apache/camel/component/azure/storage/queue/QueueConfiguration.java
@@ -21,6 +21,7 @@ import java.time.Duration;
import com.azure.storage.common.StorageSharedKeyCredential;
import com.azure.storage.queue.QueueServiceClient;
import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.UriParam;
import org.apache.camel.spi.UriParams;
import org.apache.camel.spi.UriPath;
@@ -37,6 +38,7 @@ public class QueueConfiguration implements Cloneable {
@UriParam(label = "security", secret = true)
private String accessKey;
@UriParam(label = "common")
+ @Metadata(autowired = true)
private QueueServiceClient serviceClient;
@UriParam(label = "common", defaultValue = "true")
private boolean autoDiscoverClient = true;
[camel] 04/07: CAMEL-16506 - Camel-Azure-Storage-queue: Add Azurite
IT Tests
Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 9d7f37143f7911a7a599297ca9bcd01c93bf2f3b
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Apr 15 14:13:49 2021 +0200
CAMEL-16506 - Camel-Azure-Storage-queue: Add Azurite IT Tests
---
.../queue/integration/StorageQueueBase.java | 85 ++++++++++++++++++++++
...ConsumerIT.java => StorageQueueConsumerIT.java} | 4 +-
...ProducerIT.java => StorageQueueProducerIT.java} | 4 +-
3 files changed, 87 insertions(+), 6 deletions(-)
diff --git a/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/StorageQueueBase.java b/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/StorageQueueBase.java
new file mode 100644
index 0000000..beb643d
--- /dev/null
+++ b/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/StorageQueueBase.java
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.azure.storage.queue.integration;
+
+import com.azure.storage.common.StorageSharedKeyCredential;
+import com.azure.storage.queue.QueueServiceClient;
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.azure.storage.queue.QueueConfiguration;
+import org.apache.camel.test.infra.azure.common.AzureConfigs;
+import org.apache.camel.test.infra.azure.common.services.AzureService;
+import org.apache.camel.test.infra.azure.storage.queue.clients.AzureStorageClientUtils;
+import org.apache.camel.test.infra.azure.storage.queue.services.AzureStorageQueueServiceFactory;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.TestInstance;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+@TestInstance(TestInstance.Lifecycle.PER_CLASS)
+public class StorageQueueBase extends CamelTestSupport {
+ @RegisterExtension
+ public static AzureService service;
+
+ protected QueueServiceClient serviceClient;
+ protected String queueName;
+ protected QueueConfiguration configuration;
+
+ static {
+ initCredentials();
+
+ service = AzureStorageQueueServiceFactory.createService();
+ }
+
+ /*
+ * The previous behavior of the test code was such that if accessKey or accountName properties were
+ * set, the code would not start the azurite container and would execute against a remote environment.
+ * To avoid breaking tests for environments relying on this behavior, copy the old properties into the
+ * new and set the test as remote.
+ */
+ private static void initCredentials() {
+ String accountName = System.getProperty("accountName");
+ String accessKey = System.getProperty("accessKey");
+
+ if (StringUtils.isNotEmpty(accountName) && StringUtils.isNotEmpty(accessKey)) {
+ System.setProperty(AzureConfigs.ACCOUNT_NAME, accountName);
+ System.setProperty(AzureConfigs.ACCOUNT_KEY, accessKey);
+ System.setProperty("azure.instance.type", "remote");
+ }
+ }
+
+ @Override
+ protected CamelContext createCamelContext() throws Exception {
+ CamelContext context = super.createCamelContext();
+ context.getRegistry().bind("serviceClient", serviceClient);
+ return context;
+ }
+
+ @BeforeAll
+ public void initProperties() {
+ queueName = RandomStringUtils.randomAlphabetic(5).toLowerCase();
+
+ configuration = new QueueConfiguration();
+ configuration.setCredentials(new StorageSharedKeyCredential(
+ service.azureCredentials().accountName(), service.azureCredentials().accountKey()));
+ configuration.setQueueName(queueName);
+
+ serviceClient = AzureStorageClientUtils.getClient();
+ }
+
+}
diff --git a/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/QueueConsumerIT.java b/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/StorageQueueConsumerIT.java
similarity index 94%
rename from components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/QueueConsumerIT.java
rename to components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/StorageQueueConsumerIT.java
index 130a254..1396af6 100644
--- a/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/QueueConsumerIT.java
+++ b/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/StorageQueueConsumerIT.java
@@ -41,10 +41,8 @@ import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
import static org.junit.jupiter.api.Assertions.assertEquals;
-@EnabledIfSystemProperty(named = "accountName", matches = ".*",
- disabledReason = "Make sure to supply azure accessKey or accountName, e.g: mvn verify -DaccountName=myacc -DaccessKey=mykey")
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
-class QueueConsumerIT extends CamelTestSupport {
+class StorageQueueConsumerIT extends StorageQueueBase {
@EndpointInject("mock:result")
private MockEndpoint result;
diff --git a/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/QueueProducerIT.java b/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/StorageQueueProducerIT.java
similarity index 97%
rename from components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/QueueProducerIT.java
rename to components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/StorageQueueProducerIT.java
index 5db9801..47025aa 100644
--- a/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/QueueProducerIT.java
+++ b/components/camel-azure/camel-azure-storage-queue/src/test/java/org/apache/camel/component/azure/storage/queue/integration/StorageQueueProducerIT.java
@@ -45,10 +45,8 @@ import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
-@EnabledIfSystemProperty(named = "accountName", matches = ".*",
- disabledReason = "Make sure to supply azure accessKey or accountName, e.g: mvn verify -DaccountName=myacc -DaccessKey=mykey")
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
-class QueueProducerIT extends CamelTestSupport {
+class StorageQueueProducerIT extends StorageQueueBase {
@EndpointInject
private ProducerTemplate template;