Releases: Azure/azure-functions-java-library
Release azure-functions-java-library 3.1.0
What's Changed
- Additional Annotations for Kafka Trigger and Output Binding by @jainharsh98 in #200
- Release java library 3.1.0 by @kamperiadis in #202
New Contributors
- @jainharsh98 made their first contribution in #200
Full Changelog: 3.0.0...3.1.0
Release azure-functions-java-library 3.0.0
New
azure-functions-java-library v3 - Updating cosmos DB annotations to support v4 extension bundle. #188
azure-functions-java-library v2 - will continue to use the old annotations supporting v3 extension bundle.
Release azure-functions-java-library 3.0.0-SNAPSHOT
New
azure-functions-java-library v3 - Updating cosmos DB annotations to support v4 extension bundle. #188
azure-functions-java-library v2 - will continue to use the old annotations supporting v3 extension bundle.
Release azure-functions-java-library 2.2.0
New
- Update azure-functions-core-library to 1.2.0 #186
Release azure-functions-java-library 2.1.0
New
- Update azure-functions-java-core-library to 1.1.0
- Add warmuptrigger #183
Release azure-functions-java-library 2.0.1
release lib verion 2.0.1
Release azure-functions-java-library 2.0.1-SNAPSHOT
Add a new annotation HasImplicitOutput which support function return value if it's value is set to true (By default it's true).
Release azure-functions-java-library 2.0.0
Restructured azure-functions-java-library. Now, it only contains annotations related to triggers and bindings. The rest files can be find in azure-functions-java-core-library. This help to decouple between java library and java worker.
Azure Functions Java Library 1.4.2
Azure Functions Java Library 1.4.2-SNAPSHOT
Add support for Retry policies
For more details
- https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-error-pages?tabs=java#fixed-delay-retry
- https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-error-pages?tabs=java#exponential-backoff-retry
FixedDelayRetry sample
@FunctionName("HttpExampleRetry")
@FixedDelayRetry(maxRetryCount = 3, delayInterval = "00:00:05")
public HttpResponseMessage runRetry(
@HttpTrigger(
name = "req",
methods = {HttpMethod.GET, HttpMethod.POST},
authLevel = AuthorizationLevel.ANONYMOUS)
HttpRequestMessage<Optional<String>> request,
final ExecutionContext context) throws Exception {
context.getLogger().info("Java HTTP trigger processed a request.");
// Parse query parameter
final String query = request.getQueryParameters().get("name");
final String name = request.getBody().orElse(query);
if (name == null) {
return request.createResponseBuilder(HttpStatus.BAD_REQUEST).body("Please pass a name on the query string or in the request body").build();
} else {
return request.createResponseBuilder(HttpStatus.OK).body(name).build();
}
}
ExponentialBackoffRetry sample
@FunctionName("HttpExampleExponentialBackoffRetry")
@ExponentialBackoffRetry(maxRetryCount = 3, minimumInterval = "00:00:01", maximumInterval = "00:00:03")
public HttpResponseMessage runRetryExponentialBackoffRetry(
@HttpTrigger(
name = "req",
methods = {HttpMethod.GET, HttpMethod.POST},
authLevel = AuthorizationLevel.ANONYMOUS)
HttpRequestMessage<Optional<String>> request,
final ExecutionContext context) throws Exception {
context.getLogger().info("Java HTTP trigger processed a request.");
// Parse query parameter
final String query = request.getQueryParameters().get("name");
final String name = request.getBody().orElse(query);
if (name == null) {
return request.createResponseBuilder(HttpStatus.BAD_REQUEST).body("Please pass a name on the query string or in the request body").build();
} else {
return request.createResponseBuilder(HttpStatus.OK).body(name).build();
}
}
Add support service batch message for ServiceBusQueueTrigger and ServiceBusTopicTrigger
@FunctionName("ServiceBusQueueBatchTrigger")
public void serviceBusQueueBatchTrigger(
@ServiceBusQueueTrigger(name = "message", queueName = "SBQueueNameBatch", connection = "AzureWebJobsServiceBus", cardinality = Cardinality.MANY, dataType = "String") String[] messages,
@QueueOutput(name = "output", queueName = "test-servicebusqueuebatch-java", connection = "AzureWebJobsStorage") OutputBinding<String> output,
final ExecutionContext context
) {
context.getLogger().info("Java Service Bus Queue trigger function processed a message: " + messages[0]);
output.setValue(messages[0]);
}
@FunctionName("ServiceBusTopicBatchTrigger")
public void serviceBusTopicBatchTrigger(
@ServiceBusTopicTrigger(name = "message", topicName = "SBTopicNameBatch", subscriptionName="SBTopicNameBatchSubName",connection = "AzureWebJobsServiceBus", cardinality = Cardinality.MANY, dataType = "String") List<String> messages,
@QueueOutput(name = "output", queueName = "test-servicebustopicbatch-java", connection = "AzureWebJobsStorage") OutputBinding<String> output,
final ExecutionContext context
) {
context.getLogger().info("Java Service Bus Topic trigger function processed a message: " + messages.get(0));
output.setValue(messages.get(0));
}