Reputation: 33
I'm developing my application on .net core framework which uses the following code to push messages to queue which is to be received by a webjob.
topicClient = new TopicClient(connection)
Message message = new Message(utf8encodedtext)
await topicClient.SendAsync(message);
BrokeredMessage support(Microsoft.ServiceBus namespace) is not yet there for .net core. I'm using the following code for Webjob
public static void ProcessQueueMessage([ServiceBusTrigger("topicgeneric","subscription")] BrokeredMessage message, TextWriter log)
{
log.WriteLine(message.Label);
}
}
With this setup I'm able to receive messages. However the web job doesn't support Microsoft.Azure.ServiceBus.Message. Is there any workaround to use Messages instead of BrokeredMessage are there any tradeoffs/compatibility issue/data loss. I want to re-write my webjob in .net core framework. Will it still work (currently its written in .net framework) as Microsoft.ServiceBus nuget is not supported in .net core
Upvotes: 1
Views: 1258
Reputation: 35154
WebJobs SDK version 2.x is using the old service bus client with BrokeredMessage
class.
WebJobs SDK version 3.x is using the new .NET Standard service bus client (Microsoft.Azure.ServiceBus
with Message
class). It's still in preview though, 3.0.0-beta4
is the last release is of today.
So, you'd have to pick the matching versions: either use all old or all new.
BrokeredMessage support(Microsoft.ServiceBus namespace) is not yet there for .net core
BrokeredMessage
will never appear in the new SDK, it's been replaced by Message
. They are not compatible to each other, so various issues are possible.
Upvotes: 2