ShipitSmarter.Core.Messaging.Subscriber
8.0.20-20240305130535.pr49.sha-d72faac
This is a prerelease version of ShipitSmarter.Core.Messaging.Subscriber.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package ShipitSmarter.Core.Messaging.Subscriber --version 8.0.20-20240305130535.pr49.sha-d72faac
NuGet\Install-Package ShipitSmarter.Core.Messaging.Subscriber -Version 8.0.20-20240305130535.pr49.sha-d72faac
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ShipitSmarter.Core.Messaging.Subscriber" Version="8.0.20-20240305130535.pr49.sha-d72faac" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ShipitSmarter.Core.Messaging.Subscriber --version 8.0.20-20240305130535.pr49.sha-d72faac
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ShipitSmarter.Core.Messaging.Subscriber, 8.0.20-20240305130535.pr49.sha-d72faac"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ShipitSmarter.Core.Messaging.Subscriber as a Cake Addin #addin nuget:?package=ShipitSmarter.Core.Messaging.Subscriber&version=8.0.20-20240305130535.pr49.sha-d72faac&prerelease // Install ShipitSmarter.Core.Messaging.Subscriber as a Cake Tool #tool nuget:?package=ShipitSmarter.Core.Messaging.Subscriber&version=8.0.20-20240305130535.pr49.sha-d72faac&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ShipitSmarter.Core.Messaging.Subscriber
Defines interfaces and implementations for receiving messages.
IMessageHandler
The client will require an implementation of the IMessageHandler
. The recommended way of implementing this interface is by creating a control flow based on the Message.Subject
:
public class MessageHandler : IMessageHandler
{
public MessageHandler(
// Inject handlers and other dependencies
)
public Task Handle(Message message) {
if (MyMessage.Subject == message.Subject) {
var myMessage = MyMessage.Deserialize(message);
return myMessageHandler.Handle(myMessage);
}
if (MyOtherMessage.Subject == message.Subject) {
var myOtherMessage = MyOtherMessage.Deserialize(message);
return myOtherMessageHandler.Handle(myOtherMessage);
}
...
}
}
GoogleSubscriberClient
The subscriber client is implemented as a BackgroundService
. You have to register it together with an implementation of IMessageHandler
, TMessageHandler
.
services.AddGoogleSubscriberClient<TMessageHandler>("project-id", "subscription-id");
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Google.Cloud.PubSub.V1 (>= 3.9.1)
- Microsoft.Extensions.Hosting (>= 8.0.0)
- ShipitSmarter.Core (>= 8.0.20-20240305130535.pr49.sha-d72faac)
- ShipitSmarter.Core.Messaging (>= 8.0.20-20240305130535.pr49.sha-d72faac)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.