-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Migrate SB extensions to new SDK #18330
Changes from 3 commits
e80d0be
e26bac3
a149fe1
cd93ac1
fa5542d
552083c
0314856
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,13 +36,6 @@ public ServiceBusTriggerAttribute(string topicName, string subscriptionName) { } | |
} | ||
namespace Microsoft.Azure.WebJobs.ServiceBus | ||
{ | ||
public partial class BatchOptions | ||
{ | ||
public BatchOptions() { } | ||
public bool AutoComplete { get { throw null; } set { } } | ||
public int MaxMessageCount { get { throw null; } set { } } | ||
public System.TimeSpan OperationTimeout { get { throw null; } set { } } | ||
} | ||
public static partial class Constants | ||
{ | ||
public const string AzureWebsiteSku = "WEBSITE_SKU"; | ||
|
@@ -58,30 +51,34 @@ public enum EntityType | |
} | ||
public partial class MessageProcessor | ||
{ | ||
public MessageProcessor(Microsoft.Azure.ServiceBus.Core.MessageReceiver messageReceiver, Microsoft.Azure.ServiceBus.MessageHandlerOptions messageOptions) { } | ||
public Microsoft.Azure.ServiceBus.MessageHandlerOptions MessageOptions { get { throw null; } } | ||
protected Microsoft.Azure.ServiceBus.Core.MessageReceiver MessageReceiver { get { throw null; } set { } } | ||
public virtual System.Threading.Tasks.Task<bool> BeginProcessingMessageAsync(Microsoft.Azure.ServiceBus.Message message, System.Threading.CancellationToken cancellationToken) { throw null; } | ||
public virtual System.Threading.Tasks.Task CompleteProcessingMessageAsync(Microsoft.Azure.ServiceBus.Message message, Microsoft.Azure.WebJobs.Host.Executors.FunctionResult result, System.Threading.CancellationToken cancellationToken) { throw null; } | ||
public MessageProcessor(Azure.Messaging.ServiceBus.ServiceBusProcessor processor) { } | ||
public System.Func<Azure.Messaging.ServiceBus.ProcessErrorEventArgs, System.Threading.Tasks.Task> ExceptionHandler { get { throw null; } } | ||
public virtual System.Threading.Tasks.Task<bool> BeginProcessingMessageAsync(Azure.Messaging.ServiceBus.ServiceBusReceiver receiver, Azure.Messaging.ServiceBus.ServiceBusReceivedMessage message, System.Threading.CancellationToken cancellationToken) { throw null; } | ||
public virtual System.Threading.Tasks.Task CompleteProcessingMessageAsync(Azure.Messaging.ServiceBus.ServiceBusReceiver receiver, Azure.Messaging.ServiceBus.ServiceBusReceivedMessage message, Microsoft.Azure.WebJobs.Host.Executors.FunctionResult result, System.Threading.CancellationToken cancellationToken) { throw null; } | ||
} | ||
public partial class MessagingProvider | ||
{ | ||
public MessagingProvider(Microsoft.Extensions.Options.IOptions<Microsoft.Azure.WebJobs.ServiceBus.ServiceBusOptions> serviceBusOptions) { } | ||
public virtual Microsoft.Azure.ServiceBus.ClientEntity CreateClientEntity(string entityPath, string connectionString) { throw null; } | ||
public virtual Azure.Messaging.ServiceBus.ServiceBusReceiver CreateBatchMessageReceiver(string entityPath, string connectionString) { throw null; } | ||
public virtual Azure.Messaging.ServiceBus.ServiceBusClient CreateClient(string connectionString) { throw null; } | ||
public virtual Microsoft.Azure.WebJobs.ServiceBus.MessageProcessor CreateMessageProcessor(string entityPath, string connectionString) { throw null; } | ||
public virtual Microsoft.Azure.ServiceBus.Core.MessageReceiver CreateMessageReceiver(string entityPath, string connectionString) { throw null; } | ||
public virtual Microsoft.Azure.ServiceBus.Core.MessageSender CreateMessageSender(string entityPath, string connectionString) { throw null; } | ||
public virtual Microsoft.Azure.ServiceBus.SessionClient CreateSessionClient(string entityPath, string connectionString) { throw null; } | ||
public virtual Azure.Messaging.ServiceBus.ServiceBusSender CreateMessageSender(string entityPath, string connectionString) { throw null; } | ||
public virtual Azure.Messaging.ServiceBus.ServiceBusProcessor CreateProcessor(string entityPath, string connectionString) { throw null; } | ||
public virtual Microsoft.Azure.WebJobs.ServiceBus.SessionMessageProcessor CreateSessionMessageProcessor(string entityPath, string connectionString) { throw null; } | ||
} | ||
public partial class ServiceBusOptions : Microsoft.Azure.WebJobs.Hosting.IOptionsFormatter | ||
{ | ||
public ServiceBusOptions() { } | ||
public Microsoft.Azure.WebJobs.ServiceBus.BatchOptions BatchOptions { get { throw null; } set { } } | ||
public bool AutoCompleteMessages { get { throw null; } set { } } | ||
public Azure.Messaging.ServiceBus.ServiceBusClientOptions ClientOptions { get { throw null; } set { } } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. worth flattening ClientOptions as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah it might be better for consistency with EH. |
||
public string ConnectionString { get { throw null; } set { } } | ||
public Microsoft.Azure.ServiceBus.MessageHandlerOptions MessageHandlerOptions { get { throw null; } set { } } | ||
public System.Func<Azure.Messaging.ServiceBus.ProcessErrorEventArgs, System.Threading.Tasks.Task> ExceptionHandler { get { throw null; } set { } } | ||
public System.TimeSpan MaxAutoLockRenewalDuration { get { throw null; } set { } } | ||
public int MaxConcurrentCalls { get { throw null; } set { } } | ||
public int MaxConcurrentSessions { get { throw null; } set { } } | ||
public int MaxMessages { get { throw null; } set { } } | ||
public System.TimeSpan? MaxWaitTime { get { throw null; } set { } } | ||
public int PrefetchCount { get { throw null; } set { } } | ||
public Microsoft.Azure.ServiceBus.SessionHandlerOptions SessionHandlerOptions { get { throw null; } set { } } | ||
public string Format() { throw null; } | ||
} | ||
public partial class ServiceBusWebJobsStartup : Microsoft.Azure.WebJobs.Hosting.IWebJobsStartup | ||
|
@@ -91,11 +88,9 @@ public void Configure(Microsoft.Azure.WebJobs.IWebJobsBuilder builder) { } | |
} | ||
public partial class SessionMessageProcessor | ||
{ | ||
public SessionMessageProcessor(Microsoft.Azure.ServiceBus.ClientEntity clientEntity, Microsoft.Azure.ServiceBus.SessionHandlerOptions sessionHandlerOptions) { } | ||
protected Microsoft.Azure.ServiceBus.ClientEntity ClientEntity { get { throw null; } set { } } | ||
public Microsoft.Azure.ServiceBus.SessionHandlerOptions SessionHandlerOptions { get { throw null; } } | ||
public virtual System.Threading.Tasks.Task<bool> BeginProcessingMessageAsync(Microsoft.Azure.ServiceBus.IMessageSession session, Microsoft.Azure.ServiceBus.Message message, System.Threading.CancellationToken cancellationToken) { throw null; } | ||
public virtual System.Threading.Tasks.Task CompleteProcessingMessageAsync(Microsoft.Azure.ServiceBus.IMessageSession session, Microsoft.Azure.ServiceBus.Message message, Microsoft.Azure.WebJobs.Host.Executors.FunctionResult result, System.Threading.CancellationToken cancellationToken) { throw null; } | ||
public SessionMessageProcessor(Azure.Messaging.ServiceBus.ServiceBusSessionProcessor processor) { } | ||
public virtual System.Threading.Tasks.Task<bool> BeginProcessingMessageAsync(Azure.Messaging.ServiceBus.ServiceBusSessionReceiver receiver, Azure.Messaging.ServiceBus.ServiceBusReceivedMessage message, System.Threading.CancellationToken cancellationToken) { throw null; } | ||
public virtual System.Threading.Tasks.Task CompleteProcessingMessageAsync(Azure.Messaging.ServiceBus.ServiceBusSessionReceiver receiver, Azure.Messaging.ServiceBus.ServiceBusReceivedMessage message, Microsoft.Azure.WebJobs.Host.Executors.FunctionResult result, System.Threading.CancellationToken cancellationToken) { throw null; } | ||
} | ||
} | ||
namespace Microsoft.Extensions.Hosting | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,21 +3,21 @@ | |
|
||
using System; | ||
using System.Diagnostics.CodeAnalysis; | ||
using Microsoft.Azure.ServiceBus; | ||
using Azure.Messaging.ServiceBus; | ||
|
||
namespace Microsoft.Azure.WebJobs.ServiceBus.Bindings | ||
{ | ||
internal class ByteArrayToBrokeredMessageConverter : IConverter<byte[], Message> | ||
internal class ByteArrayToBrokeredMessageConverter : IConverter<byte[], ServiceBusMessage> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't returning a brokered message type any longer. (that was a T0 type) Should we consider renaming? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to make sure we don't have duplicated converters interms of input/output types. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Or missing converters now that we have two separate types. I think renaming might help make things more clear. |
||
{ | ||
[SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] | ||
public Message Convert(byte[] input) | ||
public ServiceBusMessage Convert(byte[] input) | ||
{ | ||
if (input == null) | ||
{ | ||
throw new InvalidOperationException("A brokered message cannot contain a null byte array instance."); | ||
} | ||
|
||
return new Message(input) | ||
return new ServiceBusMessage(input) | ||
{ | ||
ContentType = ContentTypes.ApplicationOctetStream | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing so that it won't display "Proxy: null"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is null bad?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It just seemed wrong when we are representing every setting as a string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was it
null
or"null"
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was "Proxy: null"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be better than empty, actually.