initialPartitionEventPosition = new HashMap<>();
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/properties/EventHubBindingProperties.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/properties/EventHubBindingProperties.java
deleted file mode 100644
index d4c89d268ab95..0000000000000
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/properties/EventHubBindingProperties.java
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-package com.azure.spring.cloud.stream.binder.eventhubs.properties;
-
-import org.springframework.cloud.stream.binder.BinderSpecificPropertiesProvider;
-
-/**
- * @author Warren Zhu
- */
-public class EventHubBindingProperties implements BinderSpecificPropertiesProvider {
-
- private EventHubConsumerProperties consumer = new EventHubConsumerProperties();
- private EventHubProducerProperties producer = new EventHubProducerProperties();
-
- public EventHubConsumerProperties getConsumer() {
- return consumer;
- }
-
- public void setConsumer(EventHubConsumerProperties consumer) {
- this.consumer = consumer;
- }
-
- public EventHubProducerProperties getProducer() {
- return producer;
- }
-
- public void setProducer(EventHubProducerProperties producer) {
- this.producer = producer;
- }
-}
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/properties/EventHubConsumerProperties.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/properties/EventHubConsumerProperties.java
deleted file mode 100644
index 2949682081bd0..0000000000000
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/properties/EventHubConsumerProperties.java
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-package com.azure.spring.cloud.stream.binder.eventhubs.properties;
-
-import com.azure.spring.eventhubs.core.properties.ProcessorProperties;
-import com.azure.spring.messaging.checkpoint.CheckpointConfig;
-
-/**
- *
- */
-public class EventHubConsumerProperties extends ProcessorProperties {
-// /**
-// * Whether the consumer receives messages from the beginning or end of event hub.
-// * If {@link StartPosition#EARLIEST}, from beginning. If {@link StartPosition#LATEST}, from end.
-// *
-// * Default: {@link StartPosition#LATEST}
-// */
-// private EventProcessingProperties.StartPosition startPosition = EventProcessingProperties.StartPosition.LATEST;
- private final CheckpointConfig checkpoint = new CheckpointConfig();
-
-// public EventProcessingProperties.StartPosition getStartPosition() {
-// return startPosition;
-// }
-//
-// public void setStartPosition(EventProcessingProperties.StartPosition startPosition) {
-// this.startPosition = startPosition;
-// }
-//
- public CheckpointConfig getCheckpoint() {
- return checkpoint;
- }
-
-}
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/properties/EventHubsBindingProperties.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/properties/EventHubsBindingProperties.java
new file mode 100644
index 0000000000000..71a1874947c41
--- /dev/null
+++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/properties/EventHubsBindingProperties.java
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.spring.cloud.stream.binder.eventhubs.properties;
+
+import org.springframework.cloud.stream.binder.BinderSpecificPropertiesProvider;
+
+/**
+ *
+ */
+public class EventHubsBindingProperties implements BinderSpecificPropertiesProvider {
+
+ private EventHubsConsumerProperties consumer = new EventHubsConsumerProperties();
+ private EventHubsProducerProperties producer = new EventHubsProducerProperties();
+
+ public EventHubsConsumerProperties getConsumer() {
+ return consumer;
+ }
+
+ public void setConsumer(EventHubsConsumerProperties consumer) {
+ this.consumer = consumer;
+ }
+
+ public EventHubsProducerProperties getProducer() {
+ return producer;
+ }
+
+ public void setProducer(EventHubsProducerProperties producer) {
+ this.producer = producer;
+ }
+}
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/properties/EventHubsConsumerProperties.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/properties/EventHubsConsumerProperties.java
new file mode 100644
index 0000000000000..6ef8073ca3674
--- /dev/null
+++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/properties/EventHubsConsumerProperties.java
@@ -0,0 +1,30 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.spring.cloud.stream.binder.eventhubs.properties;
+
+import com.azure.spring.eventhubs.core.properties.ProcessorProperties;
+import com.azure.spring.messaging.checkpoint.CheckpointConfig;
+
+/**
+ *
+ */
+public class EventHubsConsumerProperties extends ProcessorProperties {
+
+ // TODO (xiada): should we support this for the entire binding, but we should figure out how to iterate partitions
+ // first
+ // /**
+ // * Whether the consumer receives messages from the beginning or end of event hub.
+ // * If {@link StartPosition#EARLIEST}, from beginning. If {@link StartPosition#LATEST}, from end.
+ // *
+ // * Default: {@link StartPosition#LATEST}
+ // */
+ // private EventProcessingProperties.StartPosition startPosition = EventProcessingProperties.StartPosition.LATEST;
+
+ private final CheckpointConfig checkpoint = new CheckpointConfig();
+
+ public CheckpointConfig getCheckpoint() {
+ return checkpoint;
+ }
+
+}
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/properties/EventHubExtendedBindingProperties.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/properties/EventHubsExtendedBindingProperties.java
similarity index 57%
rename from sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/properties/EventHubExtendedBindingProperties.java
rename to sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/properties/EventHubsExtendedBindingProperties.java
index c4d015dd06d7d..9371c55f5813c 100644
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/properties/EventHubExtendedBindingProperties.java
+++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/properties/EventHubsExtendedBindingProperties.java
@@ -12,11 +12,12 @@
/**
*
*/
-@ConfigurationProperties("spring.cloud.stream.eventhub")
-public class EventHubExtendedBindingProperties
- extends AbstractExtendedBindingProperties {
+@ConfigurationProperties(EventHubsExtendedBindingProperties.PREFIX)
+public class EventHubsExtendedBindingProperties
+ extends AbstractExtendedBindingProperties {
- private static final String DEFAULTS_PREFIX = "spring.cloud.stream.eventhub.default";
+ public static final String PREFIX = "spring.cloud.stream.eventhubs";
+ private static final String DEFAULTS_PREFIX = PREFIX + ".default";
@Override
public String getDefaultsPrefix() {
@@ -25,10 +26,10 @@ public String getDefaultsPrefix() {
@Override
public Class extends BinderSpecificPropertiesProvider> getExtendedPropertiesEntryClass() {
- return EventHubBindingProperties.class;
+ return EventHubsBindingProperties.class;
}
- public Map getBindings() {
+ public Map getBindings() {
return doGetBindings();
}
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/properties/EventHubProducerProperties.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/properties/EventHubsProducerProperties.java
similarity index 92%
rename from sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/properties/EventHubProducerProperties.java
rename to sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/properties/EventHubsProducerProperties.java
index b7b34622ec5c7..9a6f763bc338c 100644
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/properties/EventHubProducerProperties.java
+++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/properties/EventHubsProducerProperties.java
@@ -6,9 +6,9 @@
import com.azure.spring.eventhubs.core.properties.ProducerProperties;
/**
- * @author Warren Zhu
+ *
*/
-public class EventHubProducerProperties extends ProducerProperties {
+public class EventHubsProducerProperties extends ProducerProperties {
/**
* Whether the producer should act in a synchronous manner with respect to sending messages into destination.
* If true, the producer will wait for a response from Event Hub after a send operation before sending next message.
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubChannelResourceManagerProvisioner.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubChannelResourceManagerProvisioner.java
deleted file mode 100644
index 2dbd47064ccf7..0000000000000
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubChannelResourceManagerProvisioner.java
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-package com.azure.spring.cloud.stream.binder.eventhubs.provisioning;
-
-import org.springframework.lang.NonNull;
-import org.springframework.util.Assert;
-
-/**
- * @author Warren Zhu
- */
-public class EventHubChannelResourceManagerProvisioner extends EventHubChannelProvisioner {
-
- private final String namespace;
- private final EventHubProvisioner eventHubProvisioner;
-
- public EventHubChannelResourceManagerProvisioner(@NonNull String namespace,
- @NonNull EventHubProvisioner eventHubProvisioner) {
- Assert.hasText(namespace, "The namespace can't be null or empty");
- this.namespace = namespace;
- this.eventHubProvisioner = eventHubProvisioner;
- }
-
- @Override
- protected void validateOrCreateForConsumer(String name, String group) {
- eventHubProvisioner.provisionConsumerGroup(this.namespace, name, group);
- }
-
- @Override
- protected void validateOrCreateForProducer(String name) {
- eventHubProvisioner.provisionEventHub(this.namespace, name);
- }
-}
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubProvisioner.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubProvisioner.java
deleted file mode 100644
index 77868e22e09f5..0000000000000
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubProvisioner.java
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-package com.azure.spring.cloud.stream.binder.eventhubs.provisioning;
-
-/**
- * An interface to provision Event Hubs resources.
- */
-public interface EventHubProvisioner {
-
- void provisionNamespace(String namespace);
-
- void provisionEventHub(String namespace, String eventHub);
-
- void provisionConsumerGroup(String namespace, String eventHub, String consumerGroup);
-
-}
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubChannelProvisioner.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubsChannelProvisioner.java
similarity index 70%
rename from sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubChannelProvisioner.java
rename to sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubsChannelProvisioner.java
index 1888f210ed148..1bc2a315759c4 100644
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubChannelProvisioner.java
+++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubsChannelProvisioner.java
@@ -3,8 +3,8 @@
package com.azure.spring.cloud.stream.binder.eventhubs.provisioning;
-import com.azure.spring.cloud.stream.binder.eventhubs.properties.EventHubProducerProperties;
-import com.azure.spring.cloud.stream.binder.eventhubs.properties.EventHubConsumerProperties;
+import com.azure.spring.cloud.stream.binder.eventhubs.properties.EventHubsProducerProperties;
+import com.azure.spring.cloud.stream.binder.eventhubs.properties.EventHubsConsumerProperties;
import org.springframework.cloud.stream.binder.ExtendedConsumerProperties;
import org.springframework.cloud.stream.binder.ExtendedProducerProperties;
import org.springframework.cloud.stream.provisioning.ConsumerDestination;
@@ -13,24 +13,24 @@
import org.springframework.cloud.stream.provisioning.ProvisioningProvider;
/**
- * @author Warren Zhu
+ *
*/
-public class EventHubChannelProvisioner implements
- ProvisioningProvider,
- ExtendedProducerProperties> {
+public class EventHubsChannelProvisioner implements
+ ProvisioningProvider,
+ ExtendedProducerProperties> {
@Override
public ProducerDestination provisionProducerDestination(String name,
- ExtendedProducerProperties properties) throws ProvisioningException {
+ ExtendedProducerProperties properties) throws ProvisioningException {
validateOrCreateForProducer(name);
- return new EventHubProducerDestination(name);
+ return new EventHubsProducerDestination(name);
}
@Override
public ConsumerDestination provisionConsumerDestination(String name, String group,
- ExtendedConsumerProperties properties) throws ProvisioningException {
+ ExtendedConsumerProperties properties) throws ProvisioningException {
validateOrCreateForConsumer(name, group);
- return new EventHubConsumerDestination(name);
+ return new EventHubsConsumerDestination(name);
}
protected void validateOrCreateForConsumer(String name, String group) {
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubsChannelResourceManagerProvisioner.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubsChannelResourceManagerProvisioner.java
new file mode 100644
index 0000000000000..cbd30fee65fe3
--- /dev/null
+++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubsChannelResourceManagerProvisioner.java
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.spring.cloud.stream.binder.eventhubs.provisioning;
+
+import com.azure.spring.eventhubs.provisioning.EventHubsProvisioner;
+import org.springframework.lang.NonNull;
+import org.springframework.util.Assert;
+
+/**
+ *
+ */
+public class EventHubsChannelResourceManagerProvisioner extends EventHubsChannelProvisioner {
+
+ private final String namespace;
+ private final EventHubsProvisioner eventHubsProvisioner;
+
+ public EventHubsChannelResourceManagerProvisioner(@NonNull String namespace,
+ @NonNull EventHubsProvisioner eventHubsProvisioner) {
+ Assert.hasText(namespace, "The namespace can't be null or empty");
+ this.namespace = namespace;
+ this.eventHubsProvisioner = eventHubsProvisioner;
+ }
+
+ @Override
+ protected void validateOrCreateForConsumer(String name, String group) {
+ eventHubsProvisioner.provisionConsumerGroup(this.namespace, name, group);
+ }
+
+ @Override
+ protected void validateOrCreateForProducer(String name) {
+ eventHubsProvisioner.provisionEventHub(this.namespace, name);
+ }
+}
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubConsumerDestination.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubsConsumerDestination.java
similarity index 77%
rename from sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubConsumerDestination.java
rename to sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubsConsumerDestination.java
index 5cb7d4c7d936d..5dd95413eea9a 100644
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubConsumerDestination.java
+++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubsConsumerDestination.java
@@ -6,13 +6,13 @@
import org.springframework.cloud.stream.provisioning.ConsumerDestination;
/**
- * @author Warren Zhu
+ *
*/
-public class EventHubConsumerDestination implements ConsumerDestination {
+public class EventHubsConsumerDestination implements ConsumerDestination {
private final String name;
- public EventHubConsumerDestination(String name) {
+ public EventHubsConsumerDestination(String name) {
this.name = name;
}
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubProducerDestination.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubsProducerDestination.java
similarity index 71%
rename from sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubProducerDestination.java
rename to sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubsProducerDestination.java
index d2b169b1f2842..2d8b6df493185 100644
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubProducerDestination.java
+++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/provisioning/EventHubsProducerDestination.java
@@ -6,13 +6,13 @@
import org.springframework.cloud.stream.provisioning.ProducerDestination;
/**
- * @author Warren Zhu
+ *
*/
-public class EventHubProducerDestination implements ProducerDestination {
+public class EventHubsProducerDestination implements ProducerDestination {
private final String name;
- public EventHubProducerDestination(String name) {
+ public EventHubsProducerDestination(String name) {
this.name = name;
}
@@ -28,6 +28,6 @@ public String getNameForPartition(int partition) {
@Override
public String toString() {
- return "EventHubProducerDestination{" + "name='" + name + '\'' + '}';
+ return "EventHubsProducerDestination{" + "name='" + name + '\'' + '}';
}
}
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/CHANGELOG.md b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/CHANGELOG.md
index e75c68fd91060..f3bea1c5dcf99 100644
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/CHANGELOG.md
+++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/CHANGELOG.md
@@ -6,6 +6,8 @@
### Breaking Changes
- Change artifact id from `azure-spring-cloud-stream-binder-eventhubs` to `spring-cloud-azure-stream-binder-eventhubs`.
+- Change the binder type from `eventhub` to `eventhubs`.
+- Change the Spring Cloud Stream Binding extended properties prefix from `spring.cloud.stream.eventhub` to `spring.cloud.stream.eventhubs`.
### Bugs Fixed
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/README.md b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/README.md
index f4f2c6bfb57bd..935d67f1dfc6f 100644
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/README.md
+++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/README.md
@@ -1,7 +1,7 @@
# Azure Event Hubs Spring Cloud Stream Binder client library for Java
-The project provides **Spring Cloud Stream Binder for Azure Event Hub** which allows you to build message-driven
-microservice using **Spring Cloud Stream** based on [Azure Event Hub][azure_event_hub] service.
+The project provides **Spring Cloud Stream Binder for Azure Event Hubs** which allows you to build message-driven
+microservice using **Spring Cloud Stream** based on [Azure Event Hubs][azure_event_hub] service.
[Source code][src] | [Package (Maven)][package] | [API reference documentation][refdocs] | [Product documentation][docs] | [Samples][sample]
@@ -24,7 +24,7 @@ microservice using **Spring Cloud Stream** based on [Azure Event Hub][azure_even
### EventHub Binder Overview
-The Spring Cloud Stream Binder for Azure Event Hub provides the binding implementation for the Spring Cloud Stream.
+The Spring Cloud Stream Binder for Azure Event Hubs provides the binding implementation for the Spring Cloud Stream.
This implementation uses Spring Integration Event Hub Channel Adapters at its foundation. From design's perspective,
Event Hub is similar as Kafka. Also, Event Hub could be accessed via Kafka API. If your project has tight dependency
on Kafka API, you can try [Event Hub with Kafka API Sample][kafka_sample]
@@ -33,7 +33,7 @@ on Kafka API, you can try [Event Hub with Kafka API Sample][kafka_sample]
Event Hub provides similar support of consumer group as Apache Kafka, but with slight different logic. While Kafka
stores all committed offsets in the broker, you have to store offsets of event hub messages
being processed manually. Event Hub SDK provide the function to store such offsets inside Azure Storage Account. So
-that's why you have to fill `spring.cloud.stream.eventhub.checkpoint-storage-account`.
+that's why you have to fill `spring.cloud.stream.eventhubs.checkpoint-storage-account`.
#### Partitioning Support
@@ -105,7 +105,7 @@ For more information about setting partition for the producer properties, please
#### Event Hub Producer Properties ####
-It supports the following configurations with the format of `spring.cloud.stream.eventhub.bindings..producer`.
+It supports the following configurations with the format of `spring.cloud.stream.eventhubs.bindings..producer`.
**_sync_**
@@ -122,7 +122,7 @@ Default: `10000`
#### Event Hub Consumer Properties ####
-It supports the following configurations with the format of `spring.cloud.stream.eventhub.bindings..consumer`.
+It supports the following configurations with the format of `spring.cloud.stream.eventhubs.bindings..consumer`.
**_start-position_**
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubHealthIndicator.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsHealthIndicator.java
similarity index 83%
rename from sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubHealthIndicator.java
rename to sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsHealthIndicator.java
index 442a4bbf88e2a..0725b1ecbedf0 100644
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubHealthIndicator.java
+++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsHealthIndicator.java
@@ -4,7 +4,7 @@
package com.azure.spring.cloud.stream.binder.eventhubs;
import com.azure.messaging.eventhubs.EventHubProducerAsyncClient;
-import com.azure.spring.eventhubs.core.producer.EventHubProducerFactory;
+import com.azure.spring.eventhubs.core.producer.EventHubsProducerFactory;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
@@ -14,19 +14,19 @@
/**
* Health indicator for Event Hubs.
*/
-public class EventHubHealthIndicator implements HealthIndicator {
+public class EventHubsHealthIndicator implements HealthIndicator {
private static final int DEFAULT_TIMEOUT = 30;
- private final EventHubMessageChannelBinder binder;
+ private final EventHubsMessageChannelBinder binder;
- private final EventHubProducerFactory producerFactory;
+ private final EventHubsProducerFactory producerFactory;
private EventHubProducerAsyncClient producerAsyncClient;
private int timeout = DEFAULT_TIMEOUT;
- public EventHubHealthIndicator(EventHubMessageChannelBinder binder, EventHubProducerFactory producerFactory) {
+ public EventHubsHealthIndicator(EventHubsMessageChannelBinder binder, EventHubsProducerFactory producerFactory) {
this.binder = binder;
this.producerFactory = producerFactory;
}
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubMessageChannelBinder.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsMessageChannelBinder.java
similarity index 77%
rename from sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubMessageChannelBinder.java
rename to sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsMessageChannelBinder.java
index 7d79043adcc4e..0e0ea446ae1ef 100644
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubMessageChannelBinder.java
+++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsMessageChannelBinder.java
@@ -4,18 +4,18 @@
package com.azure.spring.cloud.stream.binder.eventhubs;
import com.azure.messaging.eventhubs.CheckpointStore;
-import com.azure.spring.cloud.stream.binder.eventhubs.properties.EventHubConsumerProperties;
-import com.azure.spring.cloud.stream.binder.eventhubs.properties.EventHubExtendedBindingProperties;
-import com.azure.spring.cloud.stream.binder.eventhubs.properties.EventHubProducerProperties;
-import com.azure.spring.cloud.stream.binder.eventhubs.provisioning.EventHubChannelProvisioner;
-import com.azure.spring.eventhubs.core.EventHubProcessorContainer;
+import com.azure.spring.cloud.stream.binder.eventhubs.properties.EventHubsConsumerProperties;
+import com.azure.spring.cloud.stream.binder.eventhubs.properties.EventHubsExtendedBindingProperties;
+import com.azure.spring.cloud.stream.binder.eventhubs.properties.EventHubsProducerProperties;
+import com.azure.spring.cloud.stream.binder.eventhubs.provisioning.EventHubsChannelProvisioner;
+import com.azure.spring.eventhubs.core.EventHubsProcessorContainer;
import com.azure.spring.eventhubs.core.EventHubsTemplate;
-import com.azure.spring.eventhubs.core.processor.DefaultEventHubNamespaceProcessorFactory;
-import com.azure.spring.eventhubs.core.producer.DefaultEventHubNamespaceProducerFactory;
+import com.azure.spring.eventhubs.core.processor.DefaultEventHubsNamespaceProcessorFactory;
+import com.azure.spring.eventhubs.core.producer.DefaultEventHubsNamespaceProducerFactory;
import com.azure.spring.eventhubs.core.properties.NamespaceProperties;
import com.azure.spring.eventhubs.core.properties.ProcessorProperties;
import com.azure.spring.eventhubs.core.properties.ProducerProperties;
-import com.azure.spring.integration.eventhubs.inbound.EventHubInboundChannelAdapter;
+import com.azure.spring.integration.eventhubs.inbound.EventHubsInboundChannelAdapter;
import com.azure.spring.integration.handler.DefaultMessageHandler;
import com.azure.spring.messaging.PropertiesSupplier;
import org.slf4j.Logger;
@@ -47,36 +47,36 @@
/**
*
*/
-public class EventHubMessageChannelBinder extends
+public class EventHubsMessageChannelBinder extends
// @formatter:off
- AbstractMessageChannelBinder, ExtendedProducerProperties, EventHubChannelProvisioner>
+ AbstractMessageChannelBinder, ExtendedProducerProperties, EventHubsChannelProvisioner>
// @formatter:on
implements
- ExtendedPropertiesBinder {
+ ExtendedPropertiesBinder {
- private static final Logger LOGGER = LoggerFactory.getLogger(EventHubMessageChannelBinder.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(EventHubsMessageChannelBinder.class);
private static final ExpressionParser EXPRESSION_PARSER = new SpelExpressionParser();
private NamespaceProperties namespaceProperties;
private EventHubsTemplate eventHubsTemplate;
private CheckpointStore checkpointStore;
- private EventHubProcessorContainer processorContainer;
- private EventHubExtendedBindingProperties bindingProperties = new EventHubExtendedBindingProperties();
- private final Map>
+ private EventHubsProcessorContainer processorContainer;
+ private EventHubsExtendedBindingProperties bindingProperties = new EventHubsExtendedBindingProperties();
+ private final Map>
extendedProducerPropertiesMap = new ConcurrentHashMap<>();
- private final Map, ExtendedConsumerProperties>
+ private final Map, ExtendedConsumerProperties>
extendedConsumerPropertiesMap = new ConcurrentHashMap<>();
private final Map eventHubsInUse = new ConcurrentHashMap<>();
- public EventHubMessageChannelBinder(String[] headersToEmbed, EventHubChannelProvisioner provisioningProvider) {
+ public EventHubsMessageChannelBinder(String[] headersToEmbed, EventHubsChannelProvisioner provisioningProvider) {
super(headersToEmbed, provisioningProvider);
}
@Override
protected MessageHandler createProducerMessageHandler(
ProducerDestination destination,
- ExtendedProducerProperties producerProperties,
+ ExtendedProducerProperties producerProperties,
MessageChannel errorChannel) {
extendedProducerPropertiesMap.put(destination.getName(), producerProperties);
Assert.notNull(getEventHubTemplate(), "eventHubsTemplate can't be null when create a producer");
@@ -101,7 +101,7 @@ protected MessageHandler createProducerMessageHandler(
@Override
protected MessageProducer createConsumerEndpoint(ConsumerDestination destination, String group,
- ExtendedConsumerProperties properties) {
+ ExtendedConsumerProperties properties) {
extendedConsumerPropertiesMap.put(Tuples.of(destination.getName(), group), properties);
Assert.notNull(getProcessorContainer(), "eventProcessorsContainer can't be null when create a consumer");
@@ -112,7 +112,7 @@ protected MessageProducer createConsumerEndpoint(ConsumerDestination destination
group = "anonymous." + UUID.randomUUID();
}
- EventHubInboundChannelAdapter inboundAdapter = new EventHubInboundChannelAdapter(this.processorContainer,
+ EventHubsInboundChannelAdapter inboundAdapter = new EventHubsInboundChannelAdapter(this.processorContainer,
destination.getName(), group, properties.getExtension().getCheckpoint());
inboundAdapter.setBeanFactory(getBeanFactory());
@@ -124,12 +124,12 @@ protected MessageProducer createConsumerEndpoint(ConsumerDestination destination
}
@Override
- public EventHubConsumerProperties getExtendedConsumerProperties(String destination) {
+ public EventHubsConsumerProperties getExtendedConsumerProperties(String destination) {
return this.bindingProperties.getExtendedConsumerProperties(destination);
}
@Override
- public EventHubProducerProperties getExtendedProducerProperties(String destination) {
+ public EventHubsProducerProperties getExtendedProducerProperties(String destination) {
return this.bindingProperties.getExtendedProducerProperties(destination);
}
@@ -143,7 +143,7 @@ public Class extends BinderSpecificPropertiesProvider> getExtendedPropertiesEn
return this.bindingProperties.getExtendedPropertiesEntryClass();
}
- public void setBindingProperties(EventHubExtendedBindingProperties bindingProperties) {
+ public void setBindingProperties(EventHubsExtendedBindingProperties bindingProperties) {
this.bindingProperties = bindingProperties;
}
@@ -167,8 +167,8 @@ public String getConsumerGroup() {
private PropertiesSupplier getProducerPropertiesSupplier() {
return key -> {
if (this.extendedProducerPropertiesMap.containsKey(key)) {
- EventHubProducerProperties producerProperties = this.extendedProducerPropertiesMap.get(key)
- .getExtension();
+ EventHubsProducerProperties producerProperties = this.extendedProducerPropertiesMap.get(key)
+ .getExtension();
producerProperties.setEventHubName(key);
return producerProperties;
} else {
@@ -181,8 +181,8 @@ private PropertiesSupplier getProducerPropertiesSupp
private PropertiesSupplier, ProcessorProperties> getProcessorPropertiesSupplier() {
return key -> {
if (this.extendedConsumerPropertiesMap.containsKey(key)) {
- EventHubConsumerProperties consumerProperties = this.extendedConsumerPropertiesMap.get(key)
- .getExtension();
+ EventHubsConsumerProperties consumerProperties = this.extendedConsumerPropertiesMap.get(key)
+ .getExtension();
consumerProperties.setEventHubName(key.getT1());
consumerProperties.setConsumerGroup(key.getT2());
return consumerProperties;
@@ -195,14 +195,14 @@ private PropertiesSupplier, ProcessorProperties> getProce
private EventHubsTemplate getEventHubTemplate() {
if (this.eventHubsTemplate == null) {
- this.eventHubsTemplate = new EventHubsTemplate(new DefaultEventHubNamespaceProducerFactory(this.namespaceProperties, getProducerPropertiesSupplier()));
+ this.eventHubsTemplate = new EventHubsTemplate(new DefaultEventHubsNamespaceProducerFactory(this.namespaceProperties, getProducerPropertiesSupplier()));
}
return this.eventHubsTemplate;
}
- private EventHubProcessorContainer getProcessorContainer() {
+ private EventHubsProcessorContainer getProcessorContainer() {
if (this.processorContainer == null) {
- this.processorContainer = new EventHubProcessorContainer(new DefaultEventHubNamespaceProcessorFactory(this.checkpointStore, this.namespaceProperties, getProcessorPropertiesSupplier()));
+ this.processorContainer = new EventHubsProcessorContainer(new DefaultEventHubsNamespaceProcessorFactory(this.checkpointStore, this.namespaceProperties, getProcessorPropertiesSupplier()));
}
return this.processorContainer;
}
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/config/EventHubBinderConfiguration.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/config/EventHubsBinderConfiguration.java
similarity index 51%
rename from sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/config/EventHubBinderConfiguration.java
rename to sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/config/EventHubsBinderConfiguration.java
index 7bf64cefac7d7..5dcb3d498a1c6 100644
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/config/EventHubBinderConfiguration.java
+++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/config/EventHubsBinderConfiguration.java
@@ -5,17 +5,17 @@
import com.azure.messaging.eventhubs.CheckpointStore;
import com.azure.spring.cloud.autoconfigure.context.AzureGlobalPropertiesAutoConfiguration;
-import com.azure.spring.cloud.autoconfigure.eventhubs.AzureEventHubAutoConfiguration;
-import com.azure.spring.cloud.autoconfigure.eventhubs.AzureEventHubMessagingAutoConfiguration;
-import com.azure.spring.cloud.autoconfigure.eventhubs.properties.AzureEventHubProperties;
-import com.azure.spring.cloud.autoconfigure.resourcemanager.AzureEventHubResourceManagerAutoConfiguration;
+import com.azure.spring.cloud.autoconfigure.eventhubs.AzureEventHubsAutoConfiguration;
+import com.azure.spring.cloud.autoconfigure.eventhubs.AzureEventHubsMessagingAutoConfiguration;
+import com.azure.spring.cloud.autoconfigure.eventhubs.properties.AzureEventHubsProperties;
+import com.azure.spring.cloud.autoconfigure.resourcemanager.AzureEventHubsResourceManagerAutoConfiguration;
import com.azure.spring.cloud.autoconfigure.resourcemanager.AzureResourceManagerAutoConfiguration;
-import com.azure.spring.cloud.stream.binder.eventhubs.EventHubMessageChannelBinder;
-import com.azure.spring.cloud.stream.binder.eventhubs.properties.EventHubExtendedBindingProperties;
-import com.azure.spring.cloud.stream.binder.eventhubs.provisioning.EventHubChannelProvisioner;
-import com.azure.spring.cloud.stream.binder.eventhubs.provisioning.EventHubChannelResourceManagerProvisioner;
-import com.azure.spring.cloud.stream.binder.eventhubs.provisioning.EventHubProvisioner;
+import com.azure.spring.cloud.stream.binder.eventhubs.EventHubsMessageChannelBinder;
+import com.azure.spring.cloud.stream.binder.eventhubs.properties.EventHubsExtendedBindingProperties;
+import com.azure.spring.cloud.stream.binder.eventhubs.provisioning.EventHubsChannelProvisioner;
+import com.azure.spring.cloud.stream.binder.eventhubs.provisioning.EventHubsChannelResourceManagerProvisioner;
import com.azure.spring.eventhubs.core.properties.NamespaceProperties;
+import com.azure.spring.eventhubs.provisioning.EventHubsProvisioner;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
@@ -33,38 +33,38 @@
@Import({
AzureGlobalPropertiesAutoConfiguration.class,
AzureResourceManagerAutoConfiguration.class,
- AzureEventHubResourceManagerAutoConfiguration.class,
- AzureEventHubAutoConfiguration.class,
- AzureEventHubMessagingAutoConfiguration.class,
- EventHubBinderHealthIndicatorConfiguration.class
+ AzureEventHubsResourceManagerAutoConfiguration.class,
+ AzureEventHubsAutoConfiguration.class,
+ AzureEventHubsMessagingAutoConfiguration.class,
+ EventHubsBinderHealthIndicatorConfiguration.class
})
-@EnableConfigurationProperties(EventHubExtendedBindingProperties.class)
-public class EventHubBinderConfiguration {
+@EnableConfigurationProperties(EventHubsExtendedBindingProperties.class)
+public class EventHubsBinderConfiguration {
@Bean
@ConditionalOnMissingBean
- @ConditionalOnBean({ EventHubProvisioner.class, AzureEventHubProperties.class })
- public EventHubChannelProvisioner eventHubChannelArmProvisioner(AzureEventHubProperties eventHubProperties,
- EventHubProvisioner eventHubProvisioner) {
+ @ConditionalOnBean({ EventHubsProvisioner.class, AzureEventHubsProperties.class })
+ public EventHubsChannelProvisioner eventHubChannelArmProvisioner(
+ AzureEventHubsProperties eventHubsProperties, EventHubsProvisioner eventHubsProvisioner) {
- return new EventHubChannelResourceManagerProvisioner(eventHubProperties.getNamespace(),
- eventHubProvisioner);
+ return new EventHubsChannelResourceManagerProvisioner(eventHubsProperties.getNamespace(),
+ eventHubsProvisioner);
}
@Bean
- @ConditionalOnMissingBean({ EventHubProvisioner.class, EventHubChannelProvisioner.class })
- public EventHubChannelProvisioner eventHubChannelProvisioner() {
- return new EventHubChannelProvisioner();
+ @ConditionalOnMissingBean({ EventHubsProvisioner.class, EventHubsChannelProvisioner.class })
+ public EventHubsChannelProvisioner eventHubChannelProvisioner() {
+ return new EventHubsChannelProvisioner();
}
@Bean
@ConditionalOnMissingBean
- public EventHubMessageChannelBinder eventHubBinder(EventHubChannelProvisioner eventHubChannelProvisioner,
- EventHubExtendedBindingProperties bindingProperties,
- ObjectProvider namespaceProperties,
- CheckpointStore checkpointStore) {
- EventHubMessageChannelBinder binder = new EventHubMessageChannelBinder(null, eventHubChannelProvisioner);
+ public EventHubsMessageChannelBinder eventHubBinder(EventHubsChannelProvisioner channelProvisioner,
+ EventHubsExtendedBindingProperties bindingProperties,
+ ObjectProvider namespaceProperties,
+ CheckpointStore checkpointStore) {
+ EventHubsMessageChannelBinder binder = new EventHubsMessageChannelBinder(null, channelProvisioner);
binder.setBindingProperties(bindingProperties);
binder.setNamespaceProperties(namespaceProperties.getIfAvailable());
binder.setCheckpointStore(checkpointStore);
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/config/EventHubBinderHealthIndicatorConfiguration.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/config/EventHubsBinderHealthIndicatorConfiguration.java
similarity index 53%
rename from sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/config/EventHubBinderHealthIndicatorConfiguration.java
rename to sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/config/EventHubsBinderHealthIndicatorConfiguration.java
index bd40c8e0ce0ac..2adde860271c0 100644
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/config/EventHubBinderHealthIndicatorConfiguration.java
+++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/java/com/azure/spring/cloud/stream/binder/eventhubs/config/EventHubsBinderHealthIndicatorConfiguration.java
@@ -3,9 +3,9 @@
package com.azure.spring.cloud.stream.binder.eventhubs.config;
-import com.azure.spring.cloud.stream.binder.eventhubs.EventHubHealthIndicator;
-import com.azure.spring.cloud.stream.binder.eventhubs.EventHubMessageChannelBinder;
-import com.azure.spring.eventhubs.core.producer.EventHubProducerFactory;
+import com.azure.spring.cloud.stream.binder.eventhubs.EventHubsHealthIndicator;
+import com.azure.spring.cloud.stream.binder.eventhubs.EventHubsMessageChannelBinder;
+import com.azure.spring.eventhubs.core.producer.EventHubsProducerFactory;
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
@@ -15,12 +15,12 @@
@Configuration
@ConditionalOnClass(HealthIndicator.class)
@ConditionalOnEnabledHealthIndicator("binders")
-class EventHubBinderHealthIndicatorConfiguration {
+class EventHubsBinderHealthIndicatorConfiguration {
@Bean
- EventHubHealthIndicator eventHubHealthIndicator(EventHubMessageChannelBinder binder,
- EventHubProducerFactory producerFactory) {
- return new EventHubHealthIndicator(binder, producerFactory);
+ EventHubsHealthIndicator eventHubHealthIndicator(EventHubsMessageChannelBinder binder,
+ EventHubsProducerFactory producerFactory) {
+ return new EventHubsHealthIndicator(binder, producerFactory);
}
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/resources/META-INF/spring.binders b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/resources/META-INF/spring.binders
index 347cd5b5def74..81716db596ea1 100644
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/resources/META-INF/spring.binders
+++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/main/resources/META-INF/spring.binders
@@ -1 +1 @@
-eventhub=com.azure.spring.cloud.stream.binder.eventhubs.config.EventHubBinderConfiguration
+eventhubs=com.azure.spring.cloud.stream.binder.eventhubs.config.EventHubsBinderConfiguration
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubTestBinder.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubTestBinder.java
index 3401f0424239f..f98b505e8fd60 100644
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubTestBinder.java
+++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubTestBinder.java
@@ -3,9 +3,9 @@
package com.azure.spring.cloud.stream.binder.eventhubs;
-import com.azure.spring.cloud.stream.binder.eventhubs.properties.EventHubConsumerProperties;
-import com.azure.spring.cloud.stream.binder.eventhubs.properties.EventHubProducerProperties;
-import com.azure.spring.cloud.stream.binder.eventhubs.provisioning.EventHubChannelProvisioner;
+import com.azure.spring.cloud.stream.binder.eventhubs.properties.EventHubsConsumerProperties;
+import com.azure.spring.cloud.stream.binder.eventhubs.properties.EventHubsProducerProperties;
+import com.azure.spring.cloud.stream.binder.eventhubs.provisioning.EventHubsChannelProvisioner;
import org.springframework.cloud.stream.binder.AbstractTestBinder;
import org.springframework.cloud.stream.binder.BinderHeaders;
import org.springframework.cloud.stream.binder.ExtendedConsumerProperties;
@@ -17,12 +17,12 @@
*/
public class EventHubTestBinder extends
- AbstractTestBinder,
- ExtendedProducerProperties> {
+ AbstractTestBinder,
+ ExtendedProducerProperties> {
EventHubTestBinder() {
- EventHubMessageChannelBinder binder = new EventHubMessageChannelBinder(BinderHeaders.STANDARD_HEADERS,
- new EventHubChannelProvisioner());
+ EventHubsMessageChannelBinder binder = new EventHubsMessageChannelBinder(BinderHeaders.STANDARD_HEADERS,
+ new EventHubsChannelProvisioner());
binder.setApplicationContext(new GenericApplicationContext());
this.setBinder(binder);
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubBinderBatchModeIT.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsBinderBatchModeIT.java
similarity index 84%
rename from sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubBinderBatchModeIT.java
rename to sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsBinderBatchModeIT.java
index efd8e4dd004b9..e66b3c240c7c2 100644
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubBinderBatchModeIT.java
+++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsBinderBatchModeIT.java
@@ -24,17 +24,17 @@
import static org.assertj.core.api.Assertions.assertThat;
-@SpringBootTest(classes = EventHubBinderBatchModeIT.TestConfig.class)
+@SpringBootTest(classes = EventHubsBinderBatchModeIT.TestConfig.class)
@TestPropertySource(properties =
{
- "spring.cloud.stream.eventhub.bindings.consume-in-0.consumer.checkpoint.mode=BATCH",
+ "spring.cloud.stream.eventhubs.bindings.consume-in-0.consumer.checkpoint.mode=BATCH",
"spring.cloud.stream.bindings.consume-in-0.destination=test-eventhub-batch",
"spring.cloud.stream.bindings.supply-out-0.destination=test-eventhub-batch",
"spring.cloud.azure.eventhubs.processor.checkpoint-store.container-name=test-eventhub-batch"
})
-public class EventHubBinderBatchModeIT {
+public class EventHubsBinderBatchModeIT {
- private static final Logger LOGGER = LoggerFactory.getLogger(EventHubBinderBatchModeIT.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(EventHubsBinderBatchModeIT.class);
private static final String MESSAGE = UUID.randomUUID().toString();
@@ -62,7 +62,7 @@ public Supplier>> supply(Sinks.Many> many)
public Consumer> consume() {
return message -> {
LOGGER.info("EventHubBinderBatchModeIT: New message received: '{}'", message.getPayload());
- if (message.getPayload().equals(EventHubBinderBatchModeIT.MESSAGE)) {
+ if (message.getPayload().equals(EventHubsBinderBatchModeIT.MESSAGE)) {
LATCH.countDown();
}
};
@@ -72,10 +72,10 @@ public Consumer> consume() {
@Test
public void testSendAndReceiveMessage() throws InterruptedException {
LOGGER.info("EventHubBinderBatchModeIT begin.");
- EventHubBinderBatchModeIT.LATCH.await(15, TimeUnit.SECONDS);
+ EventHubsBinderBatchModeIT.LATCH.await(15, TimeUnit.SECONDS);
LOGGER.info("Send a message:" + MESSAGE + ".");
many.emitNext(new GenericMessage<>(MESSAGE), Sinks.EmitFailureHandler.FAIL_FAST);
- assertThat(EventHubBinderBatchModeIT.LATCH.await(600, TimeUnit.SECONDS)).isTrue();
+ assertThat(EventHubsBinderBatchModeIT.LATCH.await(600, TimeUnit.SECONDS)).isTrue();
LOGGER.info("EventHubBinderBatchModeIT end.");
}
}
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubBinderConfigurationTest.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsBinderConfigurationTest.java
similarity index 83%
rename from sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubBinderConfigurationTest.java
rename to sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsBinderConfigurationTest.java
index 44f0204fe91da..59cc2d425206b 100644
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubBinderConfigurationTest.java
+++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsBinderConfigurationTest.java
@@ -3,15 +3,15 @@
package com.azure.spring.cloud.stream.binder.eventhubs;
-import com.azure.spring.cloud.autoconfigure.eventhubs.AzureEventHubAutoConfiguration;
-import com.azure.spring.cloud.autoconfigure.eventhubs.AzureEventHubMessagingAutoConfiguration;
-import com.azure.spring.cloud.autoconfigure.resourcemanager.AzureEventHubResourceManagerAutoConfiguration;
+import com.azure.spring.cloud.autoconfigure.eventhubs.AzureEventHubsAutoConfiguration;
+import com.azure.spring.cloud.autoconfigure.eventhubs.AzureEventHubsMessagingAutoConfiguration;
+import com.azure.spring.cloud.autoconfigure.resourcemanager.AzureEventHubsResourceManagerAutoConfiguration;
import com.azure.spring.cloud.autoconfigure.resourcemanager.AzureResourceManagerAutoConfiguration;
-import com.azure.spring.cloud.stream.binder.eventhubs.config.EventHubBinderConfiguration;
+import com.azure.spring.cloud.stream.binder.eventhubs.config.EventHubsBinderConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
-public class EventHubBinderConfigurationTest {
+public class EventHubsBinderConfigurationTest {
private static final String EVENT_HUB_PROPERTY_PREFIX = "spring.cloud.azure.eventhub.";
private static final String AZURE_PROPERTY_PREFIX = "spring.cloud.azure.";
@@ -24,10 +24,10 @@ public class EventHubBinderConfigurationTest {
.withPropertyValues(AZURE_PROPERTY_PREFIX + "stream.function.definition=supply")
.withPropertyValues(AZURE_PROPERTY_PREFIX + "stream.bindings.supply-out-0.destination=eventhub1")
.withConfiguration(AutoConfigurations.of(AzureResourceManagerAutoConfiguration.class,
- AzureEventHubResourceManagerAutoConfiguration.class,
- AzureEventHubAutoConfiguration.class,
- AzureEventHubMessagingAutoConfiguration.class,
- EventHubBinderConfiguration.class));
+ AzureEventHubsResourceManagerAutoConfiguration.class,
+ AzureEventHubsAutoConfiguration.class,
+ AzureEventHubsMessagingAutoConfiguration.class,
+ EventHubsBinderConfiguration.class));
/*
// TODO (xiada): tests
@Test
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubBinderConsumeErrorIT.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsBinderConsumeErrorIT.java
similarity index 93%
rename from sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubBinderConsumeErrorIT.java
rename to sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsBinderConsumeErrorIT.java
index b21b44d9e5df7..2b215b2b1faa0 100644
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubBinderConsumeErrorIT.java
+++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsBinderConsumeErrorIT.java
@@ -25,16 +25,16 @@
import java.util.function.Consumer;
import java.util.function.Supplier;
-@SpringBootTest(classes = EventHubBinderConsumeErrorIT.TestConfig.class)
+@SpringBootTest(classes = EventHubsBinderConsumeErrorIT.TestConfig.class)
@TestPropertySource(properties = {
- "spring.cloud.stream.eventhub.default.consumer.checkpoint.mode=MANUAL",
+ "spring.cloud.stream.eventhubs.default.consumer.checkpoint.mode=MANUAL",
"spring.cloud.stream.bindings.consume-in-0.destination=test-eventhub-message",
"spring.cloud.stream.bindings.supply-out-0.destination=test-eventhub-message",
"spring.cloud.azure.eventhubs.processor.checkpoint-store.container-name=test-eventhub-message"
})
-public class EventHubBinderConsumeErrorIT {
+public class EventHubsBinderConsumeErrorIT {
- private static final Logger LOGGER = LoggerFactory.getLogger(EventHubBinderConsumeErrorIT.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(EventHubsBinderConsumeErrorIT.class);
private static final String MESSAGE = "Azure Spring Cloud EventHub Test";
@Autowired
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubBinderHealthIT.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsBinderHealthIT.java
similarity index 97%
rename from sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubBinderHealthIT.java
rename to sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsBinderHealthIT.java
index baa89306605b9..fa1262d327f71 100644
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubBinderHealthIT.java
+++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsBinderHealthIT.java
@@ -21,9 +21,9 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
-public class EventHubBinderHealthIT {
+public class EventHubsBinderHealthIT {
- private static final Logger LOGGER = LoggerFactory.getLogger(EventHubBinderHealthIT.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(EventHubsBinderHealthIT.class);
private final RestTemplate restTemplate = new RestTemplate();
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubBinderHealthIndicatorTest.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsBinderHealthIndicatorTest.java
similarity index 73%
rename from sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubBinderHealthIndicatorTest.java
rename to sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsBinderHealthIndicatorTest.java
index ae716e7db2d5d..e8f8e8e9a51fe 100644
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubBinderHealthIndicatorTest.java
+++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsBinderHealthIndicatorTest.java
@@ -5,7 +5,7 @@
import com.azure.messaging.eventhubs.EventHubProducerAsyncClient;
import com.azure.messaging.eventhubs.EventHubProperties;
-import com.azure.spring.eventhubs.core.producer.EventHubProducerFactory;
+import com.azure.spring.eventhubs.core.producer.EventHubsProducerFactory;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
@@ -23,24 +23,24 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-public class EventHubBinderHealthIndicatorTest {
+public class EventHubsBinderHealthIndicatorTest {
@Mock
- private EventHubMessageChannelBinder binder;
+ private EventHubsMessageChannelBinder binder;
@Mock
- private EventHubProducerFactory producerFactory;
+ private EventHubsProducerFactory producerFactory;
@Mock
private EventHubProducerAsyncClient producerAsyncClient;
- private EventHubHealthIndicator healthIndicator;
+ private EventHubsHealthIndicator healthIndicator;
@BeforeEach
public void init() {
MockitoAnnotations.openMocks(this);
when(producerFactory.createProducer(anyString())).thenReturn(producerAsyncClient);
- healthIndicator = new EventHubHealthIndicator(binder, producerFactory);
+ healthIndicator = new EventHubsHealthIndicator(binder, producerFactory);
}
@Test
@@ -52,8 +52,8 @@ public void testNoEventHubsInUse() {
@Test
public void testEventHubIsUp() {
- Map eventHubsInUse = new HashMap<>();
- eventHubsInUse.put("eventhub-1", new EventHubMessageChannelBinder.EventHubInformation(null));
+ Map eventHubsInUse = new HashMap<>();
+ eventHubsInUse.put("eventhub-1", new EventHubsMessageChannelBinder.EventHubInformation(null));
EventHubProperties eventHubProperties = mock(EventHubProperties.class);
@@ -66,8 +66,8 @@ public void testEventHubIsUp() {
@Test
public void testEventHubIsDown() {
- Map eventHubsInUse = new HashMap<>();
- eventHubsInUse.put("eventhub-1", new EventHubMessageChannelBinder.EventHubInformation(null));
+ Map eventHubsInUse = new HashMap<>();
+ eventHubsInUse.put("eventhub-1", new EventHubsMessageChannelBinder.EventHubInformation(null));
when(binder.getEventHubsInUse()).thenReturn(eventHubsInUse);
when(producerAsyncClient.getEventHubProperties()).thenThrow(new IllegalStateException());
@@ -81,8 +81,8 @@ public void testEventHubIsDown() {
public void testGetEventHubInfoTimeout() {
healthIndicator.setTimeout(1);
- Map eventHubsInUse = new HashMap<>();
- eventHubsInUse.put("eventhub-1", new EventHubMessageChannelBinder.EventHubInformation(null));
+ Map eventHubsInUse = new HashMap<>();
+ eventHubsInUse.put("eventhub-1", new EventHubsMessageChannelBinder.EventHubInformation(null));
EventHubProperties eventHubProperties = mock(EventHubProperties.class);
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubBinderManualModeIT.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsBinderManualModeIT.java
similarity index 86%
rename from sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubBinderManualModeIT.java
rename to sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsBinderManualModeIT.java
index 1ef73822e0edd..b757b6b23aa9d 100644
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubBinderManualModeIT.java
+++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsBinderManualModeIT.java
@@ -27,17 +27,17 @@
import static org.assertj.core.api.Assertions.assertThat;
-@SpringBootTest(classes = EventHubBinderManualModeIT.TestConfig.class)
+@SpringBootTest(classes = EventHubsBinderManualModeIT.TestConfig.class)
@TestPropertySource(properties =
{
- "spring.cloud.stream.eventhub.default.consumer.checkpoint.mode=MANUAL",
+ "spring.cloud.stream.eventhubs.default.consumer.checkpoint.mode=MANUAL",
"spring.cloud.stream.bindings.consume-in-0.destination=test-eventhub-manual",
"spring.cloud.stream.bindings.supply-out-0.destination=test-eventhub-manual",
"spring.cloud.azure.eventhubs.processor.checkpoint-store.container-name=test-eventhub-manual"
})
-public class EventHubBinderManualModeIT {
+public class EventHubsBinderManualModeIT {
- private static final Logger LOGGER = LoggerFactory.getLogger(EventHubBinderManualModeIT.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(EventHubsBinderManualModeIT.class);
private static final String MESSAGE = UUID.randomUUID().toString();
private static final CountDownLatch LATCH = new CountDownLatch(1);
@@ -63,7 +63,7 @@ public Supplier>> supply(Sinks.Many> many)
public Consumer> consume() {
return message -> {
LOGGER.info("EventHubBinderManualModeIT: New message received: '{}'", message.getPayload());
- if (message.getPayload().equals(EventHubBinderManualModeIT.MESSAGE)) {
+ if (message.getPayload().equals(EventHubsBinderManualModeIT.MESSAGE)) {
Checkpointer checkpointer = (Checkpointer) message.getHeaders().get(AzureHeaders.CHECKPOINTER);
checkpointer.success().handle((r, ex) -> {
Assertions.assertNull(ex);
@@ -77,10 +77,10 @@ public Consumer> consume() {
@Test
public void testSendAndReceiveMessage() throws InterruptedException {
LOGGER.info("EventHubBinderManualModeIT begin.");
- EventHubBinderManualModeIT.LATCH.await(15, TimeUnit.SECONDS);
+ EventHubsBinderManualModeIT.LATCH.await(15, TimeUnit.SECONDS);
LOGGER.info("Send a message:" + MESSAGE + ".");
many.emitNext(new GenericMessage<>(MESSAGE), Sinks.EmitFailureHandler.FAIL_FAST);
- assertThat(EventHubBinderManualModeIT.LATCH.await(30, TimeUnit.SECONDS)).isTrue();
+ assertThat(EventHubsBinderManualModeIT.LATCH.await(30, TimeUnit.SECONDS)).isTrue();
LOGGER.info("EventHubBinderManualModeIT end.");
}
}
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubBinderRecordModeIT.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsBinderRecordModeIT.java
similarity index 84%
rename from sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubBinderRecordModeIT.java
rename to sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsBinderRecordModeIT.java
index 391476c85ad14..08535e150f347 100644
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubBinderRecordModeIT.java
+++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsBinderRecordModeIT.java
@@ -24,17 +24,17 @@
import static org.assertj.core.api.Assertions.assertThat;
-@SpringBootTest(classes = EventHubBinderRecordModeIT.TestConfig.class)
+@SpringBootTest(classes = EventHubsBinderRecordModeIT.TestConfig.class)
@TestPropertySource(properties =
{
- "spring.cloud.stream.eventhub.bindings.consume-in-0.consumer.checkpoint.mode=RECORD",
+ "spring.cloud.stream.eventhubs.bindings.consume-in-0.consumer.checkpoint.mode=RECORD",
"spring.cloud.stream.bindings.consume-in-0.destination=test-eventhub-record",
"spring.cloud.stream.bindings.supply-out-0.destination=test-eventhub-record",
"spring.cloud.azure.eventhubs.processor.checkpoint-store.container-name=test-eventhub-record"
})
-public class EventHubBinderRecordModeIT {
+public class EventHubsBinderRecordModeIT {
- private static final Logger LOGGER = LoggerFactory.getLogger(EventHubBinderRecordModeIT.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(EventHubsBinderRecordModeIT.class);
private static final String MESSAGE = UUID.randomUUID().toString();
private static final CountDownLatch LATCH = new CountDownLatch(1);
@@ -60,7 +60,7 @@ public Supplier>> supply(Sinks.Many> many)
public Consumer> consume() {
return message -> {
LOGGER.info("EventHubBinderRecordModeIT: New message received: '{}'", message.getPayload());
- if (message.getPayload().equals(EventHubBinderRecordModeIT.MESSAGE)) {
+ if (message.getPayload().equals(EventHubsBinderRecordModeIT.MESSAGE)) {
LATCH.countDown();
}
};
@@ -70,10 +70,10 @@ public Consumer> consume() {
@Test
public void testSendAndReceiveMessage() throws InterruptedException {
LOGGER.info("EventHubBinderRecordModeIT begin.");
- EventHubBinderRecordModeIT.LATCH.await(15, TimeUnit.SECONDS);
+ EventHubsBinderRecordModeIT.LATCH.await(15, TimeUnit.SECONDS);
LOGGER.info("Send a message:" + MESSAGE + ".");
many.emitNext(new GenericMessage<>(MESSAGE), Sinks.EmitFailureHandler.FAIL_FAST);
- assertThat(EventHubBinderRecordModeIT.LATCH.await(30, TimeUnit.SECONDS)).isTrue();
+ assertThat(EventHubsBinderRecordModeIT.LATCH.await(30, TimeUnit.SECONDS)).isTrue();
LOGGER.info("EventHubBinderRecordModeIT end.");
}
}
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubBinderSyncModeIT.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsBinderSyncModeIT.java
similarity index 84%
rename from sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubBinderSyncModeIT.java
rename to sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsBinderSyncModeIT.java
index a3374c49d9b31..a4a84e74396cb 100644
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubBinderSyncModeIT.java
+++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsBinderSyncModeIT.java
@@ -26,17 +26,17 @@
import static org.assertj.core.api.Assertions.assertThat;
-@SpringBootTest(classes = EventHubBinderSyncModeIT.TestConfig.class)
+@SpringBootTest(classes = EventHubsBinderSyncModeIT.TestConfig.class)
@TestPropertySource(properties =
{
- "spring.cloud.stream.eventhub.bindings.supply-out-0.producer.sync=true",
+ "spring.cloud.stream.eventhubs.bindings.supply-out-0.producer.sync=true",
"spring.cloud.stream.bindings.consume-in-0.destination=test-eventhub-sync",
"spring.cloud.stream.bindings.supply-out-0.destination=test-eventhub-sync",
"spring.cloud.azure.eventhubs.processor.checkpoint-store.container-name=test-eventhub-sync"
})
-public class EventHubBinderSyncModeIT {
+public class EventHubsBinderSyncModeIT {
- private static final Logger LOGGER = LoggerFactory.getLogger(EventHubBinderSyncModeIT.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(EventHubsBinderSyncModeIT.class);
private static final String MESSAGE = UUID.randomUUID().toString();
@Autowired
@@ -66,7 +66,7 @@ public Supplier>> supply(Sinks.Many> many)
public Consumer> consume() {
return message -> {
LOGGER.info("EventHubBinderRecordModeIT: New message received: '{}'", message.getPayload());
- if (message.getPayload().equals(EventHubBinderSyncModeIT.MESSAGE) && message.getHeaders().containsKey("x-opt-enqueued-time")) {
+ if (message.getPayload().equals(EventHubsBinderSyncModeIT.MESSAGE) && message.getHeaders().containsKey("x-opt-enqueued-time")) {
LATCH.countDown();
}
};
@@ -76,10 +76,10 @@ public Consumer> consume() {
@Test
public void testSendAndReceiveMessage() throws InterruptedException {
LOGGER.info("EventHubBinderSyncModeIT begin.");
- EventHubBinderSyncModeIT.LATCH.await(15, TimeUnit.SECONDS);
+ EventHubsBinderSyncModeIT.LATCH.await(15, TimeUnit.SECONDS);
LOGGER.info("Send a message:" + MESSAGE + ".");
many.emitNext(new GenericMessage<>(MESSAGE), Sinks.EmitFailureHandler.FAIL_FAST);
- assertThat(EventHubBinderSyncModeIT.LATCH.await(30, TimeUnit.SECONDS)).isTrue();
+ assertThat(EventHubsBinderSyncModeIT.LATCH.await(30, TimeUnit.SECONDS)).isTrue();
LOGGER.info("EventHubBinderSyncModeIT end.");
}
}
diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsTestTemplate.java b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsTestTemplate.java
index 4ca74fcb41f04..0dda077b51861 100644
--- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsTestTemplate.java
+++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/src/test/java/com/azure/spring/cloud/stream/binder/eventhubs/EventHubsTestTemplate.java
@@ -6,8 +6,8 @@
import com.azure.messaging.eventhubs.EventData;
import com.azure.messaging.eventhubs.models.EventContext;
import com.azure.spring.eventhubs.core.EventHubsTemplate;
-import com.azure.spring.eventhubs.core.producer.EventHubProducerFactory;
-import com.azure.spring.eventhubs.support.converter.EventHubMessageConverter;
+import com.azure.spring.eventhubs.core.producer.EventHubsProducerFactory;
+import com.azure.spring.eventhubs.support.converter.EventHubsMessageConverter;
import com.azure.spring.messaging.PartitionSupplier;
import com.azure.spring.service.eventhubs.processor.RecordEventProcessingListener;
import org.springframework.lang.NonNull;
@@ -22,10 +22,10 @@
*/
public class EventHubsTestTemplate extends EventHubsTemplate {
- private final EventHubMessageConverter messageConverter = new EventHubMessageConverter();
+ private final EventHubsMessageConverter messageConverter = new EventHubsMessageConverter();
private final RecordEventProcessingListener listener;
- public EventHubsTestTemplate(EventHubProducerFactory producerFactory,
+ public EventHubsTestTemplate(EventHubsProducerFactory producerFactory,
RecordEventProcessingListener listener) {
super(producerFactory);
this.listener = listener;
diff --git a/sdk/spring/spring-integration-azure-eventhubs/src/main/java/com/azure/spring/integration/eventhubs/inbound/EventHubInboundChannelAdapter.java b/sdk/spring/spring-integration-azure-eventhubs/src/main/java/com/azure/spring/integration/eventhubs/inbound/EventHubsInboundChannelAdapter.java
similarity index 81%
rename from sdk/spring/spring-integration-azure-eventhubs/src/main/java/com/azure/spring/integration/eventhubs/inbound/EventHubInboundChannelAdapter.java
rename to sdk/spring/spring-integration-azure-eventhubs/src/main/java/com/azure/spring/integration/eventhubs/inbound/EventHubsInboundChannelAdapter.java
index 514296dcc460a..961cb8c5a83a9 100644
--- a/sdk/spring/spring-integration-azure-eventhubs/src/main/java/com/azure/spring/integration/eventhubs/inbound/EventHubInboundChannelAdapter.java
+++ b/sdk/spring/spring-integration-azure-eventhubs/src/main/java/com/azure/spring/integration/eventhubs/inbound/EventHubsInboundChannelAdapter.java
@@ -7,8 +7,8 @@
import com.azure.messaging.eventhubs.models.EventContext;
import com.azure.messaging.eventhubs.models.PartitionContext;
import com.azure.spring.eventhubs.checkpoint.CheckpointManager;
-import com.azure.spring.eventhubs.core.EventHubProcessorContainer;
-import com.azure.spring.eventhubs.support.converter.EventHubMessageConverter;
+import com.azure.spring.eventhubs.core.EventHubsProcessorContainer;
+import com.azure.spring.eventhubs.support.converter.EventHubsMessageConverter;
import com.azure.spring.messaging.AzureHeaders;
import com.azure.spring.messaging.ListenerMode;
import com.azure.spring.messaging.checkpoint.AzureCheckpointer;
@@ -31,12 +31,12 @@
import java.util.Map;
/**
- * Inbound channel adapter for Event Hubs.
+ * Inbound channel adapter for Azure Event Hubs.
*/
-public class EventHubInboundChannelAdapter extends MessageProducerSupport {
+public class EventHubsInboundChannelAdapter extends MessageProducerSupport {
- private static final Logger LOGGER = LoggerFactory.getLogger(EventHubInboundChannelAdapter.class);
- private final EventHubProcessorContainer processorContainer;
+ private static final Logger LOGGER = LoggerFactory.getLogger(EventHubsInboundChannelAdapter.class);
+ private final EventHubsProcessorContainer processorContainer;
private final String eventHubName;
private final String consumerGroup;
private final ListenerMode listenerMode;
@@ -45,16 +45,16 @@ public class EventHubInboundChannelAdapter extends MessageProducerSupport {
private EventProcessingListener listener;
private CheckpointManager checkpointManager;
- public EventHubInboundChannelAdapter(EventHubProcessorContainer processorContainer,
- String eventHubName, String consumerGroup,
- CheckpointConfig checkpointConfig) {
+ public EventHubsInboundChannelAdapter(EventHubsProcessorContainer processorContainer,
+ String eventHubName, String consumerGroup,
+ CheckpointConfig checkpointConfig) {
this(processorContainer, eventHubName, consumerGroup, ListenerMode.RECORD, checkpointConfig);
}
- public EventHubInboundChannelAdapter(EventHubProcessorContainer eventProcessorsContainer,
- String eventHubName, String consumerGroup,
- ListenerMode listenerMode,
- CheckpointConfig checkpointConfig) {
+ public EventHubsInboundChannelAdapter(EventHubsProcessorContainer eventProcessorsContainer,
+ String eventHubName, String consumerGroup,
+ ListenerMode listenerMode,
+ CheckpointConfig checkpointConfig) {
Assert.notNull(eventHubName, "eventhubName must be provided");
Assert.notNull(consumerGroup, "consumerGroup must be provided");
@@ -85,7 +85,7 @@ protected void doStop() {
this.processorContainer.stop();
}
- public void setMessageConverter(EventHubMessageConverter messageConverter) {
+ public void setMessageConverter(EventHubsMessageConverter messageConverter) {
this.recordEventProcessor.setMessageConverter(messageConverter);
}
@@ -95,7 +95,7 @@ public void setPayloadType(Class> payloadType) {
private class IntegrationRecordEventProcessingListener implements RecordEventProcessingListener {
- private EventHubMessageConverter messageConverter = new EventHubMessageConverter();
+ private EventHubsMessageConverter messageConverter = new EventHubsMessageConverter();
private Class> payloadType = byte[].class;
@@ -145,7 +145,7 @@ public InitializationContextConsumer getInitializationContextConsumer() {
initializationContext.getPartitionContext().getPartitionId());
}
- public void setMessageConverter(EventHubMessageConverter converter) {
+ public void setMessageConverter(EventHubsMessageConverter converter) {
this.messageConverter = converter;
}
diff --git a/sdk/spring/spring-integration-azure-eventhubs/src/test/java/com/azure/spring/integration/eventhubs/inbound/EventHubInboundAdapterTest.java b/sdk/spring/spring-integration-azure-eventhubs/src/test/java/com/azure/spring/integration/eventhubs/inbound/EventHubsInboundAdapterTest.java
similarity index 78%
rename from sdk/spring/spring-integration-azure-eventhubs/src/test/java/com/azure/spring/integration/eventhubs/inbound/EventHubInboundAdapterTest.java
rename to sdk/spring/spring-integration-azure-eventhubs/src/test/java/com/azure/spring/integration/eventhubs/inbound/EventHubsInboundAdapterTest.java
index c8c2f8e8c14f8..40aac0e1610ca 100644
--- a/sdk/spring/spring-integration-azure-eventhubs/src/test/java/com/azure/spring/integration/eventhubs/inbound/EventHubInboundAdapterTest.java
+++ b/sdk/spring/spring-integration-azure-eventhubs/src/test/java/com/azure/spring/integration/eventhubs/inbound/EventHubsInboundAdapterTest.java
@@ -3,7 +3,7 @@
package com.azure.spring.integration.eventhubs.inbound;
-import com.azure.spring.eventhubs.core.EventHubProcessorContainer;
+import com.azure.spring.eventhubs.core.EventHubsProcessorContainer;
import com.azure.spring.messaging.checkpoint.CheckpointConfig;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
@@ -21,9 +21,9 @@
import static org.mockito.Mockito.mock;
-class EventHubInboundAdapterTest {
+class EventHubsInboundAdapterTest {
- private TestEventHubInboundChannelAdapter adapter;
+ private TestEventHubsInboundChannelAdapter adapter;
private final String consumerGroup = "group";
private final String eventHub = "dest";
@@ -35,13 +35,13 @@ class EventHubInboundAdapterTest {
@BeforeEach
void setUp() {
- EventHubProcessorContainer processorsContainer = mock(EventHubProcessorContainer.class);
+ EventHubsProcessorContainer processorsContainer = mock(EventHubsProcessorContainer.class);
// EventProcessorClient processorClient = mock(EventProcessorClient.class);
// when(processorsContainer.subscribe(eventHub, consumerGroup, processorProperties)).thenReturn
// (processorClient);
//
- this.adapter = new TestEventHubInboundChannelAdapter(processorsContainer, this.eventHub, this.consumerGroup,
+ this.adapter = new TestEventHubsInboundChannelAdapter(processorsContainer, this.eventHub, this.consumerGroup,
new CheckpointConfig());
}
@@ -71,12 +71,12 @@ void sendAndReceive() throws InterruptedException {
}
}
- static class TestEventHubInboundChannelAdapter extends EventHubInboundChannelAdapter {
+ static class TestEventHubsInboundChannelAdapter extends EventHubsInboundChannelAdapter {
- TestEventHubInboundChannelAdapter(EventHubProcessorContainer eventProcessorsContainer,
- String eventHubName, String consumerGroup,
- CheckpointConfig checkpointConfig) {
+ TestEventHubsInboundChannelAdapter(EventHubsProcessorContainer eventProcessorsContainer,
+ String eventHubName, String consumerGroup,
+ CheckpointConfig checkpointConfig) {
super(eventProcessorsContainer, eventHubName, consumerGroup, checkpointConfig);
}
diff --git a/sdk/spring/spring-integration-azure-eventhubs/src/test/java/com/azure/spring/integration/eventhubs/outbound/EventHubMessageHandlerTest.java b/sdk/spring/spring-integration-azure-eventhubs/src/test/java/com/azure/spring/integration/eventhubs/outbound/EventHubsMessageHandlerTest.java
similarity index 98%
rename from sdk/spring/spring-integration-azure-eventhubs/src/test/java/com/azure/spring/integration/eventhubs/outbound/EventHubMessageHandlerTest.java
rename to sdk/spring/spring-integration-azure-eventhubs/src/test/java/com/azure/spring/integration/eventhubs/outbound/EventHubsMessageHandlerTest.java
index 064378a8e8c10..867750e8a695d 100644
--- a/sdk/spring/spring-integration-azure-eventhubs/src/test/java/com/azure/spring/integration/eventhubs/outbound/EventHubMessageHandlerTest.java
+++ b/sdk/spring/spring-integration-azure-eventhubs/src/test/java/com/azure/spring/integration/eventhubs/outbound/EventHubsMessageHandlerTest.java
@@ -33,7 +33,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-public class EventHubMessageHandlerTest extends MessageHandlerTest {
+public class EventHubsMessageHandlerTest extends MessageHandlerTest {
private static final ExpressionParser EXPRESSION_PARSER = new SpelExpressionParser();
private static final String TO_PARTITION_SUPPLIER_METHOD_NAME = "toPartitionSupplier";
diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/EventHubRuntimeException.java b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/EventHubRuntimeException.java
deleted file mode 100644
index 1f909a702f483..0000000000000
--- a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/EventHubRuntimeException.java
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-package com.azure.spring.eventhubs.core;
-
-import org.springframework.core.NestedRuntimeException;
-
-/**
- * The Azure Event Hub specific {@link NestedRuntimeException}.
- *
- * @author Warren Zhu
- */
-public class EventHubRuntimeException extends NestedRuntimeException {
-
- public EventHubRuntimeException(String msg) {
- super(msg);
- }
-
- public EventHubRuntimeException(String msg, Throwable cause) {
- super(msg, cause);
- }
-}
diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/EventHubProcessorContainer.java b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/EventHubsProcessorContainer.java
similarity index 84%
rename from sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/EventHubProcessorContainer.java
rename to sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/EventHubsProcessorContainer.java
index 32e12cda01f58..15203d63e08fb 100644
--- a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/EventHubProcessorContainer.java
+++ b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/EventHubsProcessorContainer.java
@@ -4,7 +4,7 @@
package com.azure.spring.eventhubs.core;
import com.azure.messaging.eventhubs.EventProcessorClient;
-import com.azure.spring.eventhubs.core.processor.EventHubProcessorFactory;
+import com.azure.spring.eventhubs.core.processor.EventHubsProcessorFactory;
import com.azure.spring.service.eventhubs.processor.EventProcessingListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -19,15 +19,15 @@
/**
*
*/
-public class EventHubProcessorContainer implements Lifecycle, DisposableBean {
+public class EventHubsProcessorContainer implements Lifecycle, DisposableBean {
- private static final Logger LOGGER = LoggerFactory.getLogger(EventHubProcessorContainer.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(EventHubsProcessorContainer.class);
- private final EventHubProcessorFactory processorFactory;
+ private final EventHubsProcessorFactory processorFactory;
private final List clients = new ArrayList<>();
private final AtomicBoolean isRunning = new AtomicBoolean(false);
- public EventHubProcessorContainer(EventHubProcessorFactory processorFactory) {
+ public EventHubsProcessorContainer(EventHubsProcessorFactory processorFactory) {
this.processorFactory = processorFactory;
}
diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/EventHubsRuntimeException.java b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/EventHubsRuntimeException.java
new file mode 100644
index 0000000000000..e1196fceac7d9
--- /dev/null
+++ b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/EventHubsRuntimeException.java
@@ -0,0 +1,21 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+package com.azure.spring.eventhubs.core;
+
+import org.springframework.core.NestedRuntimeException;
+
+/**
+ * The Azure Event Hubs specific {@link NestedRuntimeException}.
+ *
+ */
+public class EventHubsRuntimeException extends NestedRuntimeException {
+
+ public EventHubsRuntimeException(String msg) {
+ super(msg);
+ }
+
+ public EventHubsRuntimeException(String msg, Throwable cause) {
+ super(msg, cause);
+ }
+}
diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/EventHubsTemplate.java b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/EventHubsTemplate.java
index ec860994b9bfa..80694b49a048c 100644
--- a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/EventHubsTemplate.java
+++ b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/EventHubsTemplate.java
@@ -7,8 +7,8 @@
import com.azure.messaging.eventhubs.EventData;
import com.azure.messaging.eventhubs.EventHubProducerAsyncClient;
import com.azure.messaging.eventhubs.models.CreateBatchOptions;
-import com.azure.spring.eventhubs.core.producer.EventHubProducerFactory;
-import com.azure.spring.eventhubs.support.converter.EventHubMessageConverter;
+import com.azure.spring.eventhubs.core.producer.EventHubsProducerFactory;
+import com.azure.spring.eventhubs.support.converter.EventHubsMessageConverter;
import com.azure.spring.messaging.PartitionSupplier;
import com.azure.spring.messaging.core.BatchSendOperation;
import com.azure.spring.messaging.core.SendOperation;
@@ -29,10 +29,10 @@ public class EventHubsTemplate implements SendOperation, BatchSendOperation {
private static final Logger LOGGER = LoggerFactory.getLogger(EventHubsTemplate.class);
- private final EventHubProducerFactory producerFactory;
- private EventHubMessageConverter messageConverter = new EventHubMessageConverter();
+ private final EventHubsProducerFactory producerFactory;
+ private EventHubsMessageConverter messageConverter = new EventHubsMessageConverter();
- public EventHubsTemplate(EventHubProducerFactory producerFactory) {
+ public EventHubsTemplate(EventHubsProducerFactory producerFactory) {
this.producerFactory = producerFactory;
}
@@ -72,7 +72,7 @@ private CreateBatchOptions buildCreateBatchOptions(PartitionSupplier partitionSu
.setPartitionKey(partitionSupplier != null ? partitionSupplier.getPartitionKey() : null);
}
- public void setMessageConverter(EventHubMessageConverter messageConverter) {
+ public void setMessageConverter(EventHubsMessageConverter messageConverter) {
this.messageConverter = messageConverter;
}
}
diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/processor/DefaultEventHubNamespaceProcessorFactory.java b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/processor/DefaultEventHubsNamespaceProcessorFactory.java
similarity index 81%
rename from sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/processor/DefaultEventHubNamespaceProcessorFactory.java
rename to sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/processor/DefaultEventHubsNamespaceProcessorFactory.java
index de64e469a421f..7e514c4e88bc6 100644
--- a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/processor/DefaultEventHubNamespaceProcessorFactory.java
+++ b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/processor/DefaultEventHubsNamespaceProcessorFactory.java
@@ -30,9 +30,9 @@
* configuration entry is provided at both processor and namespace level, the processor level configuration will take
* advantage.
*/
-public class DefaultEventHubNamespaceProcessorFactory implements EventHubProcessorFactory, DisposableBean {
+public class DefaultEventHubsNamespaceProcessorFactory implements EventHubsProcessorFactory, DisposableBean {
- private static final Logger LOGGER = LoggerFactory.getLogger(DefaultEventHubNamespaceProcessorFactory.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(DefaultEventHubsNamespaceProcessorFactory.class);
private final List listeners = new ArrayList<>();
private final NamespaceProperties namespaceProperties;
@@ -41,23 +41,23 @@ public class DefaultEventHubNamespaceProcessorFactory implements EventHubProcess
private final Map, EventProcessorClient> processorClientMap = new ConcurrentHashMap<>();
private final ProcessorPropertiesParentMerger propertiesMerger = new ProcessorPropertiesParentMerger();
- public DefaultEventHubNamespaceProcessorFactory(CheckpointStore checkpointStore) {
+ public DefaultEventHubsNamespaceProcessorFactory(CheckpointStore checkpointStore) {
this(checkpointStore, null, null);
}
- public DefaultEventHubNamespaceProcessorFactory(CheckpointStore checkpointStore,
- NamespaceProperties namespaceProperties) {
+ public DefaultEventHubsNamespaceProcessorFactory(CheckpointStore checkpointStore,
+ NamespaceProperties namespaceProperties) {
this(checkpointStore, namespaceProperties, key -> null);
}
- public DefaultEventHubNamespaceProcessorFactory(CheckpointStore checkpointStore,
- PropertiesSupplier,
- ProcessorProperties> supplier) {
+ public DefaultEventHubsNamespaceProcessorFactory(CheckpointStore checkpointStore,
+ PropertiesSupplier,
+ ProcessorProperties> supplier) {
this(checkpointStore, null, supplier);
}
- public DefaultEventHubNamespaceProcessorFactory(CheckpointStore checkpointStore,
- NamespaceProperties namespaceProperties,
- PropertiesSupplier,
+ public DefaultEventHubsNamespaceProcessorFactory(CheckpointStore checkpointStore,
+ NamespaceProperties namespaceProperties,
+ PropertiesSupplier,
ProcessorProperties> supplier) {
Assert.notNull(checkpointStore, "CheckpointStore must be provided.");
this.checkpointStore = checkpointStore;
diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/processor/EventHubProcessorFactory.java b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/processor/EventHubsProcessorFactory.java
similarity index 95%
rename from sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/processor/EventHubProcessorFactory.java
rename to sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/processor/EventHubsProcessorFactory.java
index aeb9b04768a20..5329dfd958055 100644
--- a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/processor/EventHubProcessorFactory.java
+++ b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/processor/EventHubsProcessorFactory.java
@@ -9,7 +9,7 @@
/**
* The strategy to produce {@link EventProcessorClient} instance.
*/
-public interface EventHubProcessorFactory {
+public interface EventHubsProcessorFactory {
EventProcessorClient createProcessor(String eventHub, String consumerGroup, EventProcessingListener listener);
diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/producer/DefaultEventHubNamespaceProducerFactory.java b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/producer/DefaultEventHubsNamespaceProducerFactory.java
similarity index 87%
rename from sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/producer/DefaultEventHubNamespaceProducerFactory.java
rename to sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/producer/DefaultEventHubsNamespaceProducerFactory.java
index fa1c5736162e3..9b5dadd139401 100644
--- a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/producer/DefaultEventHubNamespaceProducerFactory.java
+++ b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/producer/DefaultEventHubsNamespaceProducerFactory.java
@@ -22,7 +22,7 @@
* if a configuration entry is provided at both producer and namespace level, the producer level configuration will
* take advantage.
*/
-public final class DefaultEventHubNamespaceProducerFactory implements EventHubProducerFactory, DisposableBean {
+public final class DefaultEventHubsNamespaceProducerFactory implements EventHubsProducerFactory, DisposableBean {
private final List listeners = new ArrayList<>();
private final NamespaceProperties namespaceProperties;
@@ -30,12 +30,12 @@ public final class DefaultEventHubNamespaceProducerFactory implements EventHubPr
private final Map clients = new ConcurrentHashMap<>();
private final ProducerPropertiesParentMerger parentMerger = new ProducerPropertiesParentMerger();
- public DefaultEventHubNamespaceProducerFactory(NamespaceProperties namespaceProperties) {
+ public DefaultEventHubsNamespaceProducerFactory(NamespaceProperties namespaceProperties) {
this(namespaceProperties, key -> null);
}
- public DefaultEventHubNamespaceProducerFactory(NamespaceProperties namespaceProperties,
- PropertiesSupplier supplier) {
+ public DefaultEventHubsNamespaceProducerFactory(NamespaceProperties namespaceProperties,
+ PropertiesSupplier supplier) {
this.namespaceProperties = namespaceProperties;
this.propertiesSupplier = supplier;
}
diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/producer/EventHubProducerFactory.java b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/producer/EventHubsProducerFactory.java
similarity index 94%
rename from sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/producer/EventHubProducerFactory.java
rename to sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/producer/EventHubsProducerFactory.java
index e17a8c2ee205d..e8bd8d5a911f6 100644
--- a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/producer/EventHubProducerFactory.java
+++ b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/producer/EventHubsProducerFactory.java
@@ -8,7 +8,7 @@
/**
* The strategy to produce {@link EventHubProducerAsyncClient} instance.
*/
-public interface EventHubProducerFactory {
+public interface EventHubsProducerFactory {
EventHubProducerAsyncClient createProducer(String eventHub);
diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/properties/CommonProperties.java b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/properties/CommonProperties.java
index 3484eb0f23729..34c882f9dedf7 100644
--- a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/properties/CommonProperties.java
+++ b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/properties/CommonProperties.java
@@ -4,14 +4,14 @@
package com.azure.spring.eventhubs.core.properties;
import com.azure.spring.core.aware.authentication.ConnectionStringAware;
-import com.azure.spring.core.connectionstring.implementation.EventHubConnectionString;
+import com.azure.spring.core.connectionstring.implementation.EventHubsConnectionString;
import com.azure.spring.core.properties.AbstractAzureAmqpSdkProperties;
-import com.azure.spring.service.eventhubs.properties.EventHubCommonDescriptor;
+import com.azure.spring.service.eventhubs.properties.EventHubsCommonDescriptor;
/**
* Common properties shared by event hub namespace, a producer, and a consumer.
*/
-abstract class CommonProperties extends AbstractAzureAmqpSdkProperties implements EventHubCommonDescriptor, ConnectionStringAware {
+abstract class CommonProperties extends AbstractAzureAmqpSdkProperties implements EventHubsCommonDescriptor, ConnectionStringAware {
private String domainName = "servicebus.windows.net";
@@ -24,14 +24,14 @@ private String extractFqdnFromConnectionString() {
if (this.connectionString == null) {
return null;
}
- return new EventHubConnectionString(this.connectionString).getFullyQualifiedNamespace();
+ return new EventHubsConnectionString(this.connectionString).getFullyQualifiedNamespace();
}
private String extractEventHubNameFromConnectionString() {
if (this.connectionString == null) {
return null;
}
- return new EventHubConnectionString(this.connectionString).getEntityPath();
+ return new EventHubsConnectionString(this.connectionString).getEntityPath();
}
diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/properties/ConsumerProperties.java b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/properties/ConsumerProperties.java
index 7531a24d2fdfc..ec6a56b3565df 100644
--- a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/properties/ConsumerProperties.java
+++ b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/properties/ConsumerProperties.java
@@ -3,12 +3,12 @@
package com.azure.spring.eventhubs.core.properties;
-import com.azure.spring.service.eventhubs.properties.EventHubConsumerDescriptor;
+import com.azure.spring.service.eventhubs.properties.EventHubsConsumerDescriptor;
/**
* An event hub consumer related properties.
*/
-public class ConsumerProperties extends CommonProperties implements EventHubConsumerDescriptor {
+public class ConsumerProperties extends CommonProperties implements EventHubsConsumerDescriptor {
protected String consumerGroup;
protected Integer prefetchCount;
diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/properties/NamespaceProperties.java b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/properties/NamespaceProperties.java
index eb20a95e30dbf..d600fc2fb4dcb 100644
--- a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/properties/NamespaceProperties.java
+++ b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/properties/NamespaceProperties.java
@@ -3,12 +3,12 @@
package com.azure.spring.eventhubs.core.properties;
-import com.azure.spring.service.eventhubs.properties.EventHubNamespaceDescriptor;
+import com.azure.spring.service.eventhubs.properties.EventHubsNamespaceDescriptor;
/**
* An event hub namespace related properties.
*/
-public class NamespaceProperties extends CommonProperties implements EventHubNamespaceDescriptor {
+public class NamespaceProperties extends CommonProperties implements EventHubsNamespaceDescriptor {
private Boolean sharedConnection;
diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/properties/ProcessorProperties.java b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/properties/ProcessorProperties.java
index 4ef55e8016a2b..7eb864e46adf0 100644
--- a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/properties/ProcessorProperties.java
+++ b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/properties/ProcessorProperties.java
@@ -3,7 +3,7 @@
package com.azure.spring.eventhubs.core.properties;
-import com.azure.spring.service.eventhubs.properties.EventHubProcessorDescriptor;
+import com.azure.spring.service.eventhubs.properties.EventHubsProcessorDescriptor;
import java.time.Duration;
import java.util.HashMap;
@@ -12,9 +12,9 @@
/**
* An event hub processor related properties.
*/
-public class ProcessorProperties extends ConsumerProperties implements EventHubProcessorDescriptor {
+public class ProcessorProperties extends ConsumerProperties implements EventHubsProcessorDescriptor {
- private final Map initialPartitionEventPosition = new HashMap<>();
+ private final Map initialPartitionEventPosition = new HashMap<>();
private final LoadBalancing loadBalancing = new LoadBalancing();
private final Batch batch = new Batch();
private Boolean trackLastEnqueuedEventProperties;
diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/properties/ProducerProperties.java b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/properties/ProducerProperties.java
index bca398357f85a..725b798191e1d 100644
--- a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/properties/ProducerProperties.java
+++ b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/core/properties/ProducerProperties.java
@@ -3,11 +3,11 @@
package com.azure.spring.eventhubs.core.properties;
-import com.azure.spring.service.eventhubs.properties.EventHubProducerDescriptor;
+import com.azure.spring.service.eventhubs.properties.EventHubsProducerDescriptor;
/**
* An event hub producer related properties.
*/
-public class ProducerProperties extends CommonProperties implements EventHubProducerDescriptor {
+public class ProducerProperties extends CommonProperties implements EventHubsProducerDescriptor {
}
diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/provisioning/EventHubProvisioner.java b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/provisioning/EventHubsProvisioner.java
similarity index 91%
rename from sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/provisioning/EventHubProvisioner.java
rename to sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/provisioning/EventHubsProvisioner.java
index d4b5446ef3023..62728fbf53971 100644
--- a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/provisioning/EventHubProvisioner.java
+++ b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/provisioning/EventHubsProvisioner.java
@@ -6,7 +6,7 @@
/**
* An interface to provision Event Hubs resources.
*/
-public interface EventHubProvisioner {
+public interface EventHubsProvisioner {
void provisionNamespace(String namespace);
diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/provisioning/arm/DefaultEventHubProvisioner.java b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/provisioning/arm/DefaultEventHubsProvisioner.java
similarity index 58%
rename from sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/provisioning/arm/DefaultEventHubProvisioner.java
rename to sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/provisioning/arm/DefaultEventHubsProvisioner.java
index 1b3fd91e4695f..b8ac0b89b27eb 100644
--- a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/provisioning/arm/DefaultEventHubProvisioner.java
+++ b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/provisioning/arm/DefaultEventHubsProvisioner.java
@@ -4,27 +4,27 @@
package com.azure.spring.eventhubs.provisioning.arm;
import com.azure.resourcemanager.AzureResourceManager;
-import com.azure.spring.cloud.resourcemanager.implementation.crud.EventHubConsumerGroupCrud;
-import com.azure.spring.cloud.resourcemanager.implementation.crud.EventHubCrud;
+import com.azure.spring.cloud.resourcemanager.implementation.crud.EventHubsConsumerGroupCrud;
+import com.azure.spring.cloud.resourcemanager.implementation.crud.EventHubsCrud;
import com.azure.spring.cloud.resourcemanager.implementation.crud.EventHubNamespaceCrud;
import com.azure.spring.core.properties.resource.AzureResourceMetadata;
-import com.azure.spring.eventhubs.provisioning.EventHubProvisioner;
+import com.azure.spring.eventhubs.provisioning.EventHubsProvisioner;
import reactor.util.function.Tuples;
/**
- * Default implementation to provision an Event Hub.
+ * Default implementation to provision resources in Azure Event Hubs.
*/
-public class DefaultEventHubProvisioner implements EventHubProvisioner {
+public class DefaultEventHubsProvisioner implements EventHubsProvisioner {
private final EventHubNamespaceCrud namespaceCrud;
- private final EventHubCrud eventHubCrud;
- private final EventHubConsumerGroupCrud consumerGroupCrud;
+ private final EventHubsCrud eventHubsCrud;
+ private final EventHubsConsumerGroupCrud consumerGroupCrud;
- public DefaultEventHubProvisioner(AzureResourceManager azureResourceManager,
- AzureResourceMetadata azureResourceMetadata) {
+ public DefaultEventHubsProvisioner(AzureResourceManager azureResourceManager,
+ AzureResourceMetadata azureResourceMetadata) {
this.namespaceCrud = new EventHubNamespaceCrud(azureResourceManager, azureResourceMetadata);
- this.eventHubCrud = new EventHubCrud(azureResourceManager, azureResourceMetadata);
- this.consumerGroupCrud = new EventHubConsumerGroupCrud(azureResourceManager, azureResourceMetadata);
+ this.eventHubsCrud = new EventHubsCrud(azureResourceManager, azureResourceMetadata);
+ this.consumerGroupCrud = new EventHubsConsumerGroupCrud(azureResourceManager, azureResourceMetadata);
}
@Override
@@ -34,7 +34,7 @@ public void provisionNamespace(String namespace) {
@Override
public void provisionEventHub(String namespace, String eventHub) {
- this.eventHubCrud.getOrCreate(Tuples.of(namespace, eventHub));
+ this.eventHubsCrud.getOrCreate(Tuples.of(namespace, eventHub));
}
@Override
diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/support/EventHubHeaders.java b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/support/EventHubsHeaders.java
similarity index 80%
rename from sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/support/EventHubHeaders.java
rename to sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/support/EventHubsHeaders.java
index 15679a6ef35d0..d0484780236fb 100644
--- a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/support/EventHubHeaders.java
+++ b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/support/EventHubsHeaders.java
@@ -5,9 +5,9 @@
import com.azure.spring.messaging.AzureHeaders;
/**
- * Azure Event Hub internal headers for Spring Messaging messages.
+ * Azure Event Hubs internal headers for Spring Messaging messages.
*/
-public class EventHubHeaders extends AzureHeaders {
+public class EventHubsHeaders extends AzureHeaders {
private static final String PREFIX = AzureHeaders.PREFIX + "eventhub_";
diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/support/converter/EventHubMessageConverter.java b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/support/converter/EventHubsMessageConverter.java
similarity index 76%
rename from sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/support/converter/EventHubMessageConverter.java
rename to sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/support/converter/EventHubsMessageConverter.java
index ba1af3ede6248..0f7e960343290 100644
--- a/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/support/converter/EventHubMessageConverter.java
+++ b/sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/eventhubs/support/converter/EventHubsMessageConverter.java
@@ -4,7 +4,7 @@
package com.azure.spring.eventhubs.support.converter;
import com.azure.messaging.eventhubs.EventData;
-import com.azure.spring.eventhubs.support.EventHubHeaders;
+import com.azure.spring.eventhubs.support.EventHubsHeaders;
import com.azure.spring.messaging.converter.AbstractAzureMessageConverter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -22,17 +22,16 @@
/**
* A converter to turn a {@link Message} to {@link EventData} and vice versa.
*
- * @author Warren Zhu
*/
-public class EventHubMessageConverter extends AbstractAzureMessageConverter {
+public class EventHubsMessageConverter extends AbstractAzureMessageConverter {
- private static final Logger LOGGER = LoggerFactory.getLogger(EventHubMessageConverter.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(EventHubsMessageConverter.class);
private static final Set SYSTEM_HEADERS = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
- EventHubHeaders.PARTITION_KEY,
- EventHubHeaders.ENQUEUED_TIME,
- EventHubHeaders.OFFSET,
- EventHubHeaders.SEQUENCE_NUMBER)));
+ EventHubsHeaders.PARTITION_KEY,
+ EventHubsHeaders.ENQUEUED_TIME,
+ EventHubsHeaders.OFFSET,
+ EventHubsHeaders.SEQUENCE_NUMBER)));
@Override
protected byte[] getPayload(EventData azureMessage) {
@@ -67,7 +66,6 @@ protected Map buildCustomHeaders(EventData azureMessage) {
Map headers = super.buildCustomHeaders(azureMessage);
headers.putAll(getSystemProperties(azureMessage));
-
headers.putAll(azureMessage.getProperties());
return headers;
}
@@ -75,10 +73,10 @@ protected Map buildCustomHeaders(EventData azureMessage) {
private Map getSystemProperties(EventData azureMessage) {
Map result = new HashMap<>();
result.putAll(azureMessage.getSystemProperties());
- result.put(EventHubHeaders.ENQUEUED_TIME, azureMessage.getEnqueuedTime());
- result.put(EventHubHeaders.OFFSET, azureMessage.getOffset());
- result.put(EventHubHeaders.SEQUENCE_NUMBER, azureMessage.getSequenceNumber());
- result.put(EventHubHeaders.PARTITION_KEY, azureMessage.getPartitionKey());
+ result.put(EventHubsHeaders.ENQUEUED_TIME, azureMessage.getEnqueuedTime());
+ result.put(EventHubsHeaders.OFFSET, azureMessage.getOffset());
+ result.put(EventHubsHeaders.SEQUENCE_NUMBER, azureMessage.getSequenceNumber());
+ result.put(EventHubsHeaders.PARTITION_KEY, azureMessage.getPartitionKey());
return result;
}
}
diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/core/EventHubProcessorsContainerTest.java b/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/core/EventHubsProcessorsContainerTest.java
similarity index 91%
rename from sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/core/EventHubProcessorsContainerTest.java
rename to sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/core/EventHubsProcessorsContainerTest.java
index 252432be8bcfe..e765077f5a258 100644
--- a/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/core/EventHubProcessorsContainerTest.java
+++ b/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/core/EventHubsProcessorsContainerTest.java
@@ -4,7 +4,7 @@
package com.azure.spring.eventhubs.core;
import com.azure.messaging.eventhubs.EventProcessorClient;
-import com.azure.spring.eventhubs.core.processor.EventHubProcessorFactory;
+import com.azure.spring.eventhubs.core.processor.EventHubsProcessorFactory;
import com.azure.spring.service.eventhubs.processor.EventProcessingListener;
import com.azure.spring.service.eventhubs.processor.RecordEventProcessingListener;
import org.junit.jupiter.api.AfterEach;
@@ -23,10 +23,10 @@
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-class EventHubProcessorsContainerTest {
+class EventHubsProcessorsContainerTest {
@Mock
- private EventHubProcessorFactory mockProcessorFactory;
+ private EventHubsProcessorFactory mockProcessorFactory;
@Mock
private EventProcessorClient oneEventProcessorClient;
@@ -34,7 +34,7 @@ class EventHubProcessorsContainerTest {
@Mock
private EventProcessorClient anotherEventProcessorClient;
- private EventHubProcessorContainer processorContainer;
+ private EventHubsProcessorContainer processorContainer;
private final RecordEventProcessingListener listener = eventContext -> { };
private AutoCloseable closeable;
@@ -51,7 +51,7 @@ void setUp() {
when(this.mockProcessorFactory.createProcessor(eq(destination), eq(anotherConsumerGroup), isA(EventProcessingListener.class)))
.thenReturn(this.anotherEventProcessorClient);
- this.processorContainer = new EventHubProcessorContainer(mockProcessorFactory);
+ this.processorContainer = new EventHubsProcessorContainer(mockProcessorFactory);
doNothing().when(this.oneEventProcessorClient).stop();
doNothing().when(this.oneEventProcessorClient).start();
}
diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/core/EventHubTemplateSendTest.java b/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/core/EventHubsTemplateSendTest.java
similarity index 86%
rename from sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/core/EventHubTemplateSendTest.java
rename to sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/core/EventHubsTemplateSendTest.java
index eae58324bc476..7d6f38e5d0f40 100644
--- a/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/core/EventHubTemplateSendTest.java
+++ b/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/core/EventHubsTemplateSendTest.java
@@ -7,7 +7,7 @@
import com.azure.messaging.eventhubs.EventDataBatch;
import com.azure.messaging.eventhubs.EventHubProducerAsyncClient;
import com.azure.messaging.eventhubs.models.CreateBatchOptions;
-import com.azure.spring.eventhubs.core.producer.EventHubProducerFactory;
+import com.azure.spring.eventhubs.core.producer.EventHubsProducerFactory;
import com.azure.spring.messaging.core.SendOperationTest;
import org.junit.jupiter.api.BeforeEach;
import reactor.core.publisher.Mono;
@@ -20,15 +20,15 @@
import static org.mockito.Mockito.when;
-public class EventHubTemplateSendTest extends SendOperationTest {
+public class EventHubsTemplateSendTest extends SendOperationTest {
- private EventHubProducerFactory producerFactory;
+ private EventHubsProducerFactory producerFactory;
private EventHubProducerAsyncClient mockProducerClient;
@BeforeEach
public void setUp() {
this.mockProducerClient = mock(EventHubProducerAsyncClient.class);
- this.producerFactory = mock(EventHubProducerFactory.class);
+ this.producerFactory = mock(EventHubsProducerFactory.class);
EventDataBatch eventDataBatch = mock(EventDataBatch.class);
when(this.producerFactory.createProducer(eq(this.destination))).thenReturn(this.mockProducerClient);
@@ -48,7 +48,7 @@ protected void verifySendCalled(int times) {
@Override
protected void whenSendWithException() {
when(this.producerFactory.createProducer(this.destination))
- .thenThrow(EventHubRuntimeException.class);
+ .thenThrow(EventHubsRuntimeException.class);
}
@Override
diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/core/processor/DefaultEventHubNamespaceProcessorFactoryTest.java b/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/core/processor/DefaultEventHubsNamespaceProcessorFactoryTest.java
similarity index 88%
rename from sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/core/processor/DefaultEventHubNamespaceProcessorFactoryTest.java
rename to sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/core/processor/DefaultEventHubsNamespaceProcessorFactoryTest.java
index deaecae73cca1..6a932d39930bf 100644
--- a/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/core/processor/DefaultEventHubNamespaceProcessorFactoryTest.java
+++ b/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/core/processor/DefaultEventHubsNamespaceProcessorFactoryTest.java
@@ -14,9 +14,9 @@
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.powermock.api.mockito.PowerMockito.mock;
-class DefaultEventHubNamespaceProcessorFactoryTest {
+class DefaultEventHubsNamespaceProcessorFactoryTest {
- private EventHubProcessorFactory processorFactory;
+ private EventHubsProcessorFactory processorFactory;
private final String eventHubName = "eventHub";
private final String consumerGroup = "group";
private final String anotherConsumerGroup = "group2";
@@ -27,10 +27,10 @@ class DefaultEventHubNamespaceProcessorFactoryTest {
void setUp() {
NamespaceProperties namespaceProperties = new NamespaceProperties();
namespaceProperties.setNamespace("test-namespace");
- this.processorFactory = new DefaultEventHubNamespaceProcessorFactory(mock(CheckpointStore.class),
+ this.processorFactory = new DefaultEventHubsNamespaceProcessorFactory(mock(CheckpointStore.class),
namespaceProperties);
processorAddedTimes = 0;
- this.processorFactory.addListener(new EventHubProcessorFactory.Listener() {
+ this.processorFactory.addListener(new EventHubsProcessorFactory.Listener() {
@Override
public void processorAdded(String eventHub, String consumerGroup) {
processorAddedTimes++;
diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/core/producer/DefaultEventHubNamespaceProducerFactoryTest.java b/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/core/producer/DefaultEventHubsNamespaceProducerFactoryTest.java
similarity index 86%
rename from sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/core/producer/DefaultEventHubNamespaceProducerFactoryTest.java
rename to sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/core/producer/DefaultEventHubsNamespaceProducerFactoryTest.java
index b0357fbe7a2ad..44105b6abe82f 100644
--- a/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/core/producer/DefaultEventHubNamespaceProducerFactoryTest.java
+++ b/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/core/producer/DefaultEventHubsNamespaceProducerFactoryTest.java
@@ -11,9 +11,9 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
-class DefaultEventHubNamespaceProducerFactoryTest {
+class DefaultEventHubsNamespaceProducerFactoryTest {
- private EventHubProducerFactory producerFactory;
+ private EventHubsProducerFactory producerFactory;
private final String eventHubName = "eventHub";
private int producerAddedTimes = 0;
@@ -21,9 +21,9 @@ class DefaultEventHubNamespaceProducerFactoryTest {
void setUp() {
NamespaceProperties namespaceProperties = new NamespaceProperties();
namespaceProperties.setNamespace("test-namespace");
- this.producerFactory = new DefaultEventHubNamespaceProducerFactory(namespaceProperties);
+ this.producerFactory = new DefaultEventHubsNamespaceProducerFactory(namespaceProperties);
producerAddedTimes = 0;
- this.producerFactory.addListener(new EventHubProducerFactory.Listener() {
+ this.producerFactory.addListener(new EventHubsProducerFactory.Listener() {
@Override
public void producerAdded(String name) {
producerAddedTimes++;
diff --git a/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/support/converter/EventHubMessageConverterTest.java b/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/support/converter/EventHubsMessageConverterTest.java
similarity index 77%
rename from sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/support/converter/EventHubMessageConverterTest.java
rename to sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/support/converter/EventHubsMessageConverterTest.java
index 2a27d057a30f8..5acfb62a1d334 100644
--- a/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/support/converter/EventHubMessageConverterTest.java
+++ b/sdk/spring/spring-messaging-azure-eventhubs/src/test/java/com/azure/spring/eventhubs/support/converter/EventHubsMessageConverterTest.java
@@ -4,7 +4,7 @@
package com.azure.spring.eventhubs.support.converter;
import com.azure.messaging.eventhubs.EventData;
-import com.azure.spring.eventhubs.support.EventHubHeaders;
+import com.azure.spring.eventhubs.support.EventHubsHeaders;
import com.azure.spring.messaging.converter.AzureMessageConverter;
import com.azure.spring.messaging.converter.UnaryAzureMessageConverterTest;
import org.junit.jupiter.api.Test;
@@ -24,7 +24,7 @@
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.springframework.messaging.support.NativeMessageHeaderAccessor.NATIVE_HEADERS;
-public class EventHubMessageConverterTest extends UnaryAzureMessageConverterTest {
+public class EventHubsMessageConverterTest extends UnaryAzureMessageConverterTest {
private static final String EVENT_DATA = "event-hub-test-string";
@@ -35,7 +35,7 @@ public class EventHubMessageConverterTest extends UnaryAzureMessageConverterTest
@Override
public AzureMessageConverter getConverter() {
- return new EventHubMessageConverter();
+ return new EventHubsMessageConverter();
}
@Override
@@ -65,7 +65,7 @@ public void testConvertCustomHeadersToEventData() {
EventData eventData = new EventData(EVENT_DATA);
- EventHubMessageConverter converter = new EventHubMessageConverter();
+ EventHubsMessageConverter converter = new EventHubsMessageConverter();
converter.setCustomHeaders(headers, eventData);
assertEquals(eventData.getProperties().get("fake-header"), "fake-value");
@@ -77,7 +77,7 @@ public void testCustomHeadersFromEventData() {
EventData eventData = new EventData(EVENT_DATA);
eventData.getProperties().put("fake-header", "fake-value");
- EventHubMessageConverter converter = new EventHubMessageConverter();
+ EventHubsMessageConverter converter = new EventHubsMessageConverter();
Map headerHeadersMap = converter.buildCustomHeaders(eventData);
assertEquals(headerHeadersMap.get("fake-header"), "fake-value");
assertEquals(eventData.getBodyAsString(), EVENT_DATA);
@@ -89,7 +89,7 @@ public void testNativeHeadersFromEventData() {
String nativeHeadersString = "{\"spanId\":[\"spanId-1\", \"spanId-2\"],\"spanTraceId\":[\"spanTraceId-1\", \"spanTraceId-2\"]}";
eventData.getProperties().put(NATIVE_HEADERS, nativeHeadersString);
- EventHubMessageConverter converter = new EventHubMessageConverter();
+ EventHubsMessageConverter converter = new EventHubsMessageConverter();
Map headerHeadersMap = converter.buildCustomHeaders(eventData);
assertEquals(headerHeadersMap.get(NATIVE_HEADERS).getClass(), String.class);
}
@@ -97,33 +97,33 @@ public void testNativeHeadersFromEventData() {
@Test
public void testSystemPropertiesScreenedOut() {
Map headerMap = new HashMap<>();
- headerMap.put(EventHubHeaders.PARTITION_KEY, PARTITION_KEY);
- headerMap.put(EventHubHeaders.ENQUEUED_TIME, ENQUEUED_TIME);
- headerMap.put(EventHubHeaders.OFFSET, OFFSET);
- headerMap.put(EventHubHeaders.SEQUENCE_NUMBER, SEQUENCE_NUMBER);
+ headerMap.put(EventHubsHeaders.PARTITION_KEY, PARTITION_KEY);
+ headerMap.put(EventHubsHeaders.ENQUEUED_TIME, ENQUEUED_TIME);
+ headerMap.put(EventHubsHeaders.OFFSET, OFFSET);
+ headerMap.put(EventHubsHeaders.SEQUENCE_NUMBER, SEQUENCE_NUMBER);
MessageHeaders headers = new MessageHeaders(headerMap);
EventData eventData = new EventData(EVENT_DATA);
- EventHubMessageConverter converter = new EventHubMessageConverter();
+ EventHubsMessageConverter converter = new EventHubsMessageConverter();
converter.setCustomHeaders(headers, eventData);
- assertFalse(eventData.getProperties().containsKey(EventHubHeaders.PARTITION_KEY));
- assertFalse(eventData.getProperties().containsKey(EventHubHeaders.ENQUEUED_TIME));
- assertFalse(eventData.getProperties().containsKey(EventHubHeaders.OFFSET));
- assertFalse(eventData.getProperties().containsKey(EventHubHeaders.SEQUENCE_NUMBER));
+ assertFalse(eventData.getProperties().containsKey(EventHubsHeaders.PARTITION_KEY));
+ assertFalse(eventData.getProperties().containsKey(EventHubsHeaders.ENQUEUED_TIME));
+ assertFalse(eventData.getProperties().containsKey(EventHubsHeaders.OFFSET));
+ assertFalse(eventData.getProperties().containsKey(EventHubsHeaders.SEQUENCE_NUMBER));
}
@Test
public void testSystemPropertiesConvertedFromEventData() {
EventData eventData = new EventData(EVENT_DATA);
- EventHubMessageConverter converter = new EventHubMessageConverter();
+ EventHubsMessageConverter converter = new EventHubsMessageConverter();
Map headerHeadersMap = converter.buildCustomHeaders(eventData);
- assertTrue(headerHeadersMap.containsKey(EventHubHeaders.ENQUEUED_TIME));
- assertTrue(headerHeadersMap.containsKey(EventHubHeaders.OFFSET));
- assertTrue(headerHeadersMap.containsKey(EventHubHeaders.SEQUENCE_NUMBER));
- assertTrue(headerHeadersMap.containsKey(EventHubHeaders.PARTITION_KEY));
+ assertTrue(headerHeadersMap.containsKey(EventHubsHeaders.ENQUEUED_TIME));
+ assertTrue(headerHeadersMap.containsKey(EventHubsHeaders.OFFSET));
+ assertTrue(headerHeadersMap.containsKey(EventHubsHeaders.SEQUENCE_NUMBER));
+ assertTrue(headerHeadersMap.containsKey(EventHubsHeaders.PARTITION_KEY));
}
}
diff --git a/sdk/spring/spring-reference.yml b/sdk/spring/spring-reference.yml
index 1db4fb2f032d6..993f787b7fb83 100644
--- a/sdk/spring/spring-reference.yml
+++ b/sdk/spring/spring-reference.yml
@@ -494,7 +494,7 @@
groupId: com.azure.spring
versionGA: 4.0.0
versionPreview: 2.0.0-beta.1
- description: Microsoft's Spring Cloud Stream Binder provides Spring Cloud Stream Binder for Azure Event Hub which allows you to build message-driven microservice using Spring Cloud Stream based on Azure Event Hub service.
+ description: Microsoft's Spring Cloud Stream Binder provides Spring Cloud Stream Binder for Azure Event Hubs which allows you to build message-driven microservice using Spring Cloud Stream based on Azure Event Hubs service.
type: spring
links:
repopath: https://search.maven.org/artifact/com.azure.spring/spring-cloud-azure-stream-binder-eventhubs
@@ -517,7 +517,7 @@
- artifactId: spring-cloud-azure-starter-stream-eventhubs
groupId: com.azure.spring
versionPreview: 4.0.0-beta.1
- description: Microsoft's Spring Cloud Stream Binder Starter provides Spring Cloud Stream Binder for Azure Event Hub which allows you to build message-driven microservice using Spring Cloud Stream based on Azure Event Hub service.
+ description: Microsoft's Spring Cloud Stream Binder Starter provides Spring Cloud Stream Binder for Azure Event Hubs which allows you to build message-driven microservice using Spring Cloud Stream based on Azure Event Hubs service.
type: spring
links:
repopath: https://search.maven.org/artifact/com.azure.spring/spring-cloud-azure-starter-stream-eventhubs