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 d5a327d42ba9f8eeb5c9d0e006d4f61577eaa0f8 Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Fri Apr 16 15:26:36 2021 +0200 CAMEL-16512 - Camel-Azure components: mark the clients as autowired --- .../org/apache/camel/component/azure/eventhubs/EventHubsComponent.java | 3 ++- .../apache/camel/component/azure/eventhubs/EventHubsComponentTest.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/camel-azure/camel-azure-eventhubs/src/main/java/org/apache/camel/component/azure/eventhubs/EventHubsComponent.java b/components/camel-azure/camel-azure-eventhubs/src/main/java/org/apache/camel/component/azure/eventhubs/EventHubsComponent.java index 61607de..169e0be 100644 --- a/components/camel-azure/camel-azure-eventhubs/src/main/java/org/apache/camel/component/azure/eventhubs/EventHubsComponent.java +++ b/components/camel-azure/camel-azure-eventhubs/src/main/java/org/apache/camel/component/azure/eventhubs/EventHubsComponent.java @@ -50,7 +50,8 @@ public class EventHubsComponent extends DefaultComponent { setProperties(endpoint, parameters); // if we don't have client nor connectionString, we check for params - if (areAzureClientsNotSet(configuration) && ObjectHelper.isEmpty(configuration.getConnectionString())) { + if (areAzureClientsNotSet(configuration) && ObjectHelper.isEmpty(configuration.getConnectionString()) + && ObjectHelper.isEmpty(configuration.getProducerAsyncClient())) { checkAndSetNamespaceAndHubName(configuration, remaining); validateConfigurations(configuration); } diff --git a/components/camel-azure/camel-azure-eventhubs/src/test/java/org/apache/camel/component/azure/eventhubs/EventHubsComponentTest.java b/components/camel-azure/camel-azure-eventhubs/src/test/java/org/apache/camel/component/azure/eventhubs/EventHubsComponentTest.java index 4ef2e20..02ec74e 100644 --- a/components/camel-azure/camel-azure-eventhubs/src/test/java/org/apache/camel/component/azure/eventhubs/EventHubsComponentTest.java +++ b/components/camel-azure/camel-azure-eventhubs/src/test/java/org/apache/camel/component/azure/eventhubs/EventHubsComponentTest.java @@ -101,7 +101,8 @@ class EventHubsComponentTest extends CamelTestSupport { context.getRegistry().bind("producerClient", producerAsyncClient); - final EventHubsEndpoint endpoint = (EventHubsEndpoint) context.getEndpoint("azure-eventhubs:name/hubName"); + final EventHubsEndpoint endpoint + = (EventHubsEndpoint) context.getEndpoint("azure-eventhubs:name/hubName?producerAsyncClient=#producerClient"); assertEquals(producerAsyncClient, endpoint.getConfiguration().getProducerAsyncClient()); }