Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
houseofcat committed Apr 24, 2024
1 parent f6b825e commit 6dcb87b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 4 additions & 7 deletions src/HouseofCat.RabbitMQ/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ namespace HouseofCat.RabbitMQ;

public static class Constants
{
// Publisher
public static string HeaderPrefix { get; set; } = "X-";

// Consumer
public static string HeaderForContentType { get; set; } = "ContentType";
public const string HeaderValueForContentTypeBinary = "application/octet-stream";
public const string HeaderValueForContentTypePlainText = "text/plain";
public const string HeaderValueForContentTypeJson = "application/json";
public const string HeaderValueForContentTypeMessagePack = "application/msgpack";

public static string HeaderPrefix { get; set; } = "X-";
public static string HeaderForContentType { get; set; } = "ContentType";

public static string HeaderForObjectType { get; set; } = "X-RD-OBJECTTYPE";
public static string HeaderValueForMessageObjectType { get; set; } = "IMESSAGE";

Expand All @@ -23,8 +22,6 @@ public static class Constants

public static string HeaderForTraceParent { get; set; } = "traceparent";

public const string RangeErrorMessage = "Value for {0} must be between {1} and {2}.";

public static string MessagingSystemKey { get; set; } = "messaging.system";
public static string MessagingSystemValue { get; set; } = "rabbitmq";

Expand Down
2 changes: 0 additions & 2 deletions src/HouseofCat.RabbitMQ/Messages/Message.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,13 @@ public sealed class Message : IMessage
public string RoutingKey { get; set; }

[JsonIgnore]
[Range(1, 2, ErrorMessage = Constants.RangeErrorMessage)]
public byte DeliveryMode { get; set; } = 2;

[JsonIgnore]
public bool Mandatory { get; set; }

// The max-queue priority though is 10, so > 10 is treated as 10.
[JsonIgnore]
[Range(0, 10, ErrorMessage = Constants.RangeErrorMessage)]
public byte PriorityLevel { get; set; }

[JsonIgnore]
Expand Down

0 comments on commit 6dcb87b

Please sign in to comment.