1
0
mirror of synced 2024-11-05 02:59:16 +00:00
Tapeti/Tapeti/IMessageSerializer.cs
Mark van Renswoude f8fca5879c [ci skip] Major refactoring for 2.0
- Compiles, but that's about it. Plenty of ToDo's left before it will run. Beware, ye who enter here.
- Cleanup of the internals, with the aim to keep the interface to application code compatible
- Added the ability to declare durable queues on startup and update the bindings
- Possibly fixed an issue with publish timeouts being logged after a reconnect
2019-08-13 20:30:04 +02:00

27 lines
1.0 KiB
C#

using Tapeti.Config;
namespace Tapeti
{
/// <summary>
/// Provides serialization and deserialization for messages.
/// </summary>
public interface IMessageSerializer
{
/// <summary>
/// Serialize a message object instance to a byte array.
/// </summary>
/// <param name="message">An instance of a message class</param>
/// <param name="properties">Writable access to the message properties which will be sent along with the message</param>
/// <returns>The encoded message</returns>
byte[] Serialize(object message, IMessageProperties properties);
/// <summary>
/// Deserializes a previously serialized message.
/// </summary>
/// <param name="body">The encoded message</param>
/// <param name="properties">The properties as sent along with the message</param>
/// <returns>A decoded instance of the message</returns>
object Deserialize(byte[] body, IMessageProperties properties);
}
}