ShipitSmarter.Core.Messaging.Subscriber
8.0.27-20240404132455.pr57.sha-668bc98
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.27-20240404132455.pr57.sha-668bc98
NuGet\Install-Package ShipitSmarter.Core.Messaging.Subscriber -Version 8.0.27-20240404132455.pr57.sha-668bc98
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.27-20240404132455.pr57.sha-668bc98" />
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.27-20240404132455.pr57.sha-668bc98
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ShipitSmarter.Core.Messaging.Subscriber, 8.0.27-20240404132455.pr57.sha-668bc98"
#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.27-20240404132455.pr57.sha-668bc98&prerelease // Install ShipitSmarter.Core.Messaging.Subscriber as a Cake Tool #tool nuget:?package=ShipitSmarter.Core.Messaging.Subscriber&version=8.0.27-20240404132455.pr57.sha-668bc98&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.27-20240404132455.pr57.sha-668bc98)
- ShipitSmarter.Core.Messaging (>= 8.0.27-20240404132455.pr57.sha-668bc98)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.