Table of Contents

AcknowledgedEventArgs Class

Definition

Namespace
Savvyio.Messaging
Assemblies
Savvyio.Core.dll
Source
src/Savvyio.Core/Messaging/AcknowledgedEventArgs.cs

Provides data for message related operations.

public class AcknowledgedEventArgs : EventArgs
Inheritance
AcknowledgedEventArgs

Examples

This example shows how to capture the AcknowledgedEventArgs payload that a message publishes after successful processing. The handler promotes transport properties into the event args so later pipeline steps can inspect the acknowledgement state.

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Savvyio;
using Savvyio.Messaging;

namespace ExampleApp;

public sealed class AcknowledgedEventArgsExample
{
    public async Task<IDictionary<string, object>> CaptureAsync()
    {
        var message = new Message<CreateOrderCommand>("msg-42", new Uri("urn:orders"), "orders.created", new CreateOrderCommand("ORD-42"));
        message.Properties["tenant"] = "eu-west";
        AcknowledgedEventArgs? observed = null;
        message.Acknowledged += (_, args) =>
        {
            observed = args;
            return Task.CompletedTask;
        };
        await message.AcknowledgeAsync().ConfigureAwait(false);
        return observed?.Properties ?? new Dictionary<string, object>();
    }
}

public sealed record CreateOrderCommand(string OrderId) : Request;

Constructors

Name Description
AcknowledgedEventArgs(IDictionary<string, object>)

Initializes a new instance of the AcknowledgedEventArgs class.

Fields

Name Description
Empty

Represents an event with no event data.

Properties

Name Description
Properties

Share state between components during message processing.

See Also