diff --git a/README.md b/README.md index 4037c6c..71daee6 100644 --- a/README.md +++ b/README.md @@ -226,6 +226,11 @@ public class Function { } ``` +For trigger metadata containing a batch of values, use a concrete array or collection type that +matches the metadata. For example, a Kafka trigger with `cardinality = Cardinality.MANY` can bind +topics as `@BindingName("TopicArray") String[] topics` and offsets as +`@BindingName("OffsetArray") long[] offsets`. `Object[]` is not supported for collection metadata. + ### License This project is under the benevolent umbrella of the [.NET Foundation](http://www.dotnetfoundation.org/) and is licensed under the MIT License. diff --git a/src/main/java/com/microsoft/azure/functions/annotation/BindingName.java b/src/main/java/com/microsoft/azure/functions/annotation/BindingName.java index da3812f..c7b68a3 100644 --- a/src/main/java/com/microsoft/azure/functions/annotation/BindingName.java +++ b/src/main/java/com/microsoft/azure/functions/annotation/BindingName.java @@ -18,6 +18,14 @@ * bindings in function.json manually. *

* + *

+ * For batch trigger metadata, use an array or collection whose element type matches the metadata + * value. For example, Kafka metadata can be bound with + * {@code @BindingName("TopicArray") String[] topics} and + * {@code @BindingName("OffsetArray") long[] offsets}. {@code Object[]} is not supported for + * collection metadata. + *

+ * * @since 1.0.0 */ @Target(ElementType.PARAMETER)