Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Storage][Webjobs] Prepare Storage Webjobs Extension release. #24794

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions eng/Packages.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@
<PackageReference Update="Azure.Security.KeyVault.Secrets" Version="4.2.0" />
<PackageReference Update="Azure.Security.KeyVault.Keys" Version="4.2.0" />
<PackageReference Update="Azure.Security.KeyVault.Certificates" Version="4.2.0" />
<PackageReference Update="Azure.Storage.Blobs" Version="12.8.0" />
<PackageReference Update="Azure.Storage.Blobs" Version="12.10.0" />
<PackageReference Update="Azure.Storage.Queues" Version="12.8.0" />

<!-- Other approved packages -->
<PackageReference Update="Microsoft.Azure.Amqp" Version="2.5.6" />
Expand Down Expand Up @@ -165,8 +166,8 @@
<PackageReference Update="Azure.ResourceManager.Storage" Version="1.0.0-alpha.20210831.3" />
<PackageReference Update="Azure.Search.Documents" Version="11.2.0" />
<PackageReference Update="Azure.Security.KeyVault.Secrets" Version="4.2.0-beta.4" />
<PackageReference Update="Azure.Storage.Blobs" Version="12.8.0" />
<PackageReference Update="Azure.Storage.Files.DataLake" Version="12.5.0" />
<PackageReference Update="Azure.Storage.Blobs" Version="12.10.0" />
<PackageReference Update="Azure.Storage.Files.DataLake" Version="12.8.0" />
<PackageReference Update="BenchmarkDotNet" Version="0.11.5" />
<PackageReference Update="Castle.Core" Version="4.4.0" />
<PackageReference Update="CommandLineParser" Version="2.8.0" />
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Release History

## 5.0.0-beta.6 (Unreleased)
## 5.0.0 (2021-10-21)
- General availability of Microsoft.Azure.WebJobs.Extensions.Storage.Blobs 5.0.0.
- Fixed bug where internal message format of blob trigger didn't interop with previous major versions of the extension.
- Adding Dynamic Concurrency support.
- Execution log when using Event Grid Blob Trigger vs Blob Trigger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<Version>5.0.0-beta.6</Version>
<Version>5.0.0</Version>
<Description>This extension adds bindings for Storage</Description>
<!-- https://github.com/Azure/azure-sdk-for-net/issues/19222 -->
<NoWarn>$(NoWarn);IDT002;IDT003</NoWarn>
Expand All @@ -12,6 +12,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.Azure.WebJobs" />
<PackageReference Include="Microsoft.Extensions.Azure" />
<PackageReference Include="Azure.Storage.Blobs" />
<PackageReference Include="Azure.Storage.Queues" />
</ItemGroup>

<ItemGroup>
Expand All @@ -22,9 +24,4 @@
<ItemGroup>
<Compile Include="..\..\..\eventgrid\Microsoft.Azure.WebJobs.Extensions.EventGrid\src\TriggerBinding\HttpRequestProcessor.cs" Link="EventGrid\HttpRequestProcessor.cs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Azure.Storage.Blobs\src\Azure.Storage.Blobs.csproj" />
<ProjectReference Include="..\..\Azure.Storage.Queues\src\Azure.Storage.Queues.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,11 @@ internal static void RegisterSharedWatcherWithQueueProcessor(QueueProcessor queu
{
if (sharedWatcher != null)
{
EventHandler<PoisonMessageEventArgs> poisonMessageEventHandler = (object sender, PoisonMessageEventArgs e) =>
queueProcessor.MessageAddedToPoisonQueueAsync += (queueProcessor, e) =>
{
sharedWatcher.Notify(e.PoisonQueue.Name);
return Task.CompletedTask;
};
queueProcessor.MessageAddedToPoisonQueue += poisonMessageEventHandler;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ internal protected QueueProcessor(QueueProcessorOptions queueProcessorOptions)
/// <summary>
/// Event raised when a message is added to the poison queue.
/// </summary>
public event EventHandler<PoisonMessageEventArgs> MessageAddedToPoisonQueue;
public event Func<QueueProcessor, PoisonMessageEventArgs, Task> MessageAddedToPoisonQueueAsync;

internal QueuesOptions QueuesOptions { get; private set; }

Expand Down Expand Up @@ -134,7 +134,7 @@ protected virtual async Task CopyMessageToPoisonQueueAsync(QueueMessage message,
await poisonQueue.AddMessageAndCreateIfNotExistsAsync(message.Body, cancellationToken).ConfigureAwait(false);

var eventArgs = new PoisonMessageEventArgs(message, poisonQueue);
OnMessageAddedToPoisonQueue(eventArgs);
await OnMessageAddedToPoisonQueueAsync(eventArgs).ConfigureAwait(false);
}

/// <summary>
Expand Down Expand Up @@ -217,9 +217,9 @@ protected virtual async Task DeleteMessageAsync(QueueMessage message, Cancellati
/// Called to raise the MessageAddedToPoisonQueue event.
/// </summary>
/// <param name="e">The event arguments.</param>
protected internal virtual void OnMessageAddedToPoisonQueue(PoisonMessageEventArgs e)
protected internal virtual Task OnMessageAddedToPoisonQueueAsync(PoisonMessageEventArgs e)
{
MessageAddedToPoisonQueue?.Invoke(this, e);
return MessageAddedToPoisonQueueAsync?.Invoke(this, e) ?? Task.CompletedTask;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 5.0.0-beta.6 (Unreleased)
## 5.0.0 (2021-10-21)
- General availability of Microsoft.Azure.WebJobs.Extensions.Storage.Queues 5.0.0.
- Change `QueueProcessor.MessageAddedToPoisonQueue` to async event and rename to `QueueProcessor.MessageAddedToPoisonQueueAsync`.
- QueuesOptions.MaxPollingInterval other than default is now honored in "Development" environment.
- Adding Dynamic Concurrency support.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ public PoisonMessageEventArgs(Azure.Storage.Queues.Models.QueueMessage message,
public partial class QueueProcessor
{
protected internal QueueProcessor(Microsoft.Azure.WebJobs.Host.Queues.QueueProcessorOptions queueProcessorOptions) { }
public event System.EventHandler<Microsoft.Azure.WebJobs.Host.Queues.PoisonMessageEventArgs> MessageAddedToPoisonQueue { add { } remove { } }
public event System.Func<Microsoft.Azure.WebJobs.Host.Queues.QueueProcessor, Microsoft.Azure.WebJobs.Host.Queues.PoisonMessageEventArgs, System.Threading.Tasks.Task> MessageAddedToPoisonQueueAsync { add { } remove { } }
protected internal virtual System.Threading.Tasks.Task<bool> BeginProcessingMessageAsync(Azure.Storage.Queues.Models.QueueMessage message, System.Threading.CancellationToken cancellationToken) { throw null; }
protected internal virtual System.Threading.Tasks.Task CompleteProcessingMessageAsync(Azure.Storage.Queues.Models.QueueMessage message, Microsoft.Azure.WebJobs.Host.Executors.FunctionResult result, System.Threading.CancellationToken cancellationToken) { throw null; }
protected virtual System.Threading.Tasks.Task CopyMessageToPoisonQueueAsync(Azure.Storage.Queues.Models.QueueMessage message, Azure.Storage.Queues.QueueClient poisonQueue, System.Threading.CancellationToken cancellationToken) { throw null; }
protected virtual System.Threading.Tasks.Task DeleteMessageAsync(Azure.Storage.Queues.Models.QueueMessage message, System.Threading.CancellationToken cancellationToken) { throw null; }
protected internal virtual void OnMessageAddedToPoisonQueue(Microsoft.Azure.WebJobs.Host.Queues.PoisonMessageEventArgs e) { }
protected internal virtual System.Threading.Tasks.Task OnMessageAddedToPoisonQueueAsync(Microsoft.Azure.WebJobs.Host.Queues.PoisonMessageEventArgs e) { throw null; }
protected virtual System.Threading.Tasks.Task ReleaseMessageAsync(Azure.Storage.Queues.Models.QueueMessage message, Microsoft.Azure.WebJobs.Host.Executors.FunctionResult result, System.TimeSpan visibilityTimeout, System.Threading.CancellationToken cancellationToken) { throw null; }
}
public partial class QueueProcessorOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<Version>5.0.0-beta.6</Version>
<Version>5.0.0</Version>
<Description>This extension adds bindings for Storage</Description>
<!-- https://github.com/Azure/azure-sdk-for-net/issues/19222 -->
<NoWarn>$(NoWarn);IDT002</NoWarn>
Expand All @@ -12,17 +12,14 @@
<ItemGroup>
<PackageReference Include="Microsoft.Azure.WebJobs" />
<PackageReference Include="Microsoft.Extensions.Azure" />
<PackageReference Include="Azure.Storage.Queues" />
</ItemGroup>

<ItemGroup>
<Compile Include="$(AzureStorageWebjobsExtensionSharedSources)\**\*.cs" LinkBase="Shared" />
<Compile Include="$(MicrosoftAzureWebJobsExtensionsClientsSources)\**\*.cs" LinkBase="Shared" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Azure.Storage.Queues\src\Azure.Storage.Queues.csproj" />
</ItemGroup>

<PropertyGroup>
<DefineConstants>STORAGE_WEBJOBS_PUBLIC_QUEUE_PROCESSOR</DefineConstants>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ public void CreateQueueProcessor_CreatesProcessorCorrectly()
QueueProcessor queueProcessor = QueueListenerFactory.CreateQueueProcessor(queue, poisonQueue, _loggerFactory, mockQueueProcessorFactory.Object, queueConfig, watcherMock.Object) as QueueProcessor;
Assert.False(processorFactoryInvoked);
Assert.AreNotSame(expectedQueueProcessor, queueProcessor);
queueProcessor.OnMessageAddedToPoisonQueue(new PoisonMessageEventArgs(null, poisonQueue));
queueProcessor.OnMessageAddedToPoisonQueueAsync(new PoisonMessageEventArgs(null, poisonQueue));
Assert.True(poisonMessageHandlerInvoked);

QueueProcessorOptions processorFactoryContext = null;
Expand Down Expand Up @@ -545,7 +545,7 @@ public void CreateQueueProcessor_CreatesProcessorCorrectly()
queueProcessor = QueueListenerFactory.CreateQueueProcessor(queue, poisonQueue, _loggerFactory, mockQueueProcessorFactory.Object, queueConfig, watcherMock.Object) as QueueProcessor;
Assert.True(processorFactoryInvoked);
Assert.AreSame(expectedQueueProcessor, queueProcessor);
queueProcessor.OnMessageAddedToPoisonQueue(new PoisonMessageEventArgs(null, poisonQueue));
queueProcessor.OnMessageAddedToPoisonQueueAsync(new PoisonMessageEventArgs(null, poisonQueue));
Assert.True(poisonMessageHandlerInvoked);

// if poison message watcher not specified, event not subscribed to
Expand All @@ -554,7 +554,7 @@ public void CreateQueueProcessor_CreatesProcessorCorrectly()
queueProcessor = QueueListenerFactory.CreateQueueProcessor(queue, poisonQueue, _loggerFactory, mockQueueProcessorFactory.Object, queueConfig, null) as QueueProcessor;
Assert.True(processorFactoryInvoked);
Assert.AreSame(expectedQueueProcessor, queueProcessor);
queueProcessor.OnMessageAddedToPoisonQueue(new PoisonMessageEventArgs(null, poisonQueue));
queueProcessor.OnMessageAddedToPoisonQueueAsync(new PoisonMessageEventArgs(null, poisonQueue));
Assert.False(poisonMessageHandlerInvoked);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,13 @@ public async Task CompleteProcessingMessageAsync_MaxDequeueCountExceeded_MovesMe
QueueProcessor localProcessor = new QueueProcessor(context);

bool poisonMessageHandlerCalled = false;
localProcessor.MessageAddedToPoisonQueue += (sender, e) =>
localProcessor.MessageAddedToPoisonQueueAsync += (sender, e) =>
{
Assert.AreSame(sender, localProcessor);
Assert.AreSame(_poisonQueue, e.PoisonQueue);
Assert.NotNull(e.Message);
poisonMessageHandlerCalled = true;
return Task.CompletedTask;
};

string messageContent = Guid.NewGuid().ToString();
Expand Down Expand Up @@ -188,12 +189,13 @@ public async Task BeginProcessingMessageAsync_MaxDequeueCountExceeded_MovesMessa
QueueProcessor localProcessor = new QueueProcessor(context);

bool poisonMessageHandlerCalled = false;
localProcessor.MessageAddedToPoisonQueue += (sender, e) =>
localProcessor.MessageAddedToPoisonQueueAsync += (sender, e) =>
{
Assert.AreSame(sender, localProcessor);
Assert.AreSame(_poisonQueue, e.PoisonQueue);
Assert.NotNull(e.Message);
poisonMessageHandlerCalled = true;
return Task.CompletedTask;
};

string messageContent = Guid.NewGuid().ToString();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Release History

## 5.0.0-beta.6 (Unreleased)

## 5.0.0 (2021-10-21)
- General availability of Microsoft.Azure.WebJobs.Extensions.Storage 5.0.0.
Please refer to [`Microsoft.Azure.WebJobs.Extension.Storage.Blobs`](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/CHANGELOG.md) and [`Microsoft.Azure.WebJobs.Extension.Storage.Queues`](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/CHANGELOG.md) for detailed list of changes.

## 5.0.0-beta.5 (2021-07-09)
Please refer to [`Microsoft.Azure.WebJobs.Extension.Storage.Blobs`](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/CHANGELOG.md) and [`Microsoft.Azure.WebJobs.Extension.Storage.Queues`](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/CHANGELOG.md) for detailed list of changes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<Version>5.0.0-beta.6</Version>
<Version>5.0.0</Version>
<Description>This extension adds bindings for Storage</Description>
<!-- This package is a metapackage. The flag below makes sure it doesn't include any DLL-->
<IncludeBuildOutput>false</IncludeBuildOutput>
Expand Down
Loading