All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.microsoft.azure.functions.redis.annotation.RedisStreamTrigger Maven / Gradle / Ivy

The newest version!
/**
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 */

package com.microsoft.azure.functions.redis.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import com.microsoft.azure.functions.annotation.CustomBinding;

/**
 * 

* Java annotation used to bind a parameter to a Redis stream entry. *

* *

* Example function that uses a RedisStreamTrigger binding: *

* *
 * @FunctionName("RedisStreamExample")
 * public void run(
 *         @RedisStreamTrigger(connection = "ConnectionString", key = "streamkey") String entry,
 *         final ExecutionContext context) {
 *     context.getLogger().info("Java Redis Stream trigger function processed a entry: " + entry);
 * }
 * 
*/ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.PARAMETER) @CustomBinding(direction = "in", name = "", type = "redisStreamTrigger") public @interface RedisStreamTrigger { /** * The variable name used in function.json. * @return The variable name used in function.json. */ String name(); /** *

Defines how Functions runtime should treat the parameter value. Possible values are:

*
    *
  • "": get the value as a string, and try to deserialize to actual parameter type like POJO
  • *
  • string: always get the value as a string
  • *
  • binary: get the value as a binary data, and try to deserialize to actual parameter type byte[]
  • *
* @return The dataType which will be used by the Functions runtime. */ String dataType() default ""; /** * App setting name that contains Redis connection information. */ String connection(); /** * Key to read from. * @return Key to read from. */ String key(); /** * How often to poll Redis in milliseconds. * @return How often to poll Redis in milliseconds. */ int pollingIntervalInMs(); /** * Number of entries to pull from Redis at one time. * @return Number of entries to pull from Redis at one time. */ int maxBatchSize(); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy