
com.microsoft.azure.functions.redis.annotation.RedisPubSubTrigger Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-functions-java-library-redis Show documentation
Show all versions of azure-functions-java-library-redis Show documentation
This package contains Java annotations to interact with Azure Functions Redis Extension.
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 pub/sub message.
*
*
*
* Example function that uses a RedisPubSubTrigger binding:
*
*
*
* @FunctionName("RedisPubSubExample")
* public void run(
* @RedisPubSubTrigger(connection = "ConnectionString", channel = "redischannel") String message,
* final ExecutionContext context) {
* context.getLogger().info("Java Redis PubSub trigger function processed a message: " + message);
* }
*
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
@CustomBinding(direction = "in", name = "", type = "redisPubSubTrigger")
public @interface RedisPubSubTrigger {
/**
* 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();
/**
* Redis pubsub channel.
* @return Redis pubsub channel.
*/
String channel();
/**
* If the given channel is a pattern.
*/
boolean pattern();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy