EasyNetQ.Management.Client
EasyNetQ.Management.Client copied to clipboard
ParameterShovelValue.deleteafter doesn't work with integers
Probably, deleteafter
JsonProperty
should have special JsonConverter
, writing it as integer if value can be converted to integer, and as a string otherwise.
Also, delete-after
property seems to be deprecated in some RabbitMQ version, and src-delete-after
should be used instead.
@inikulshin if you found the error in the source code, a PR will be much appreciated, thank you 😄
Reference: https://www.rabbitmq.com/shovel-dynamic.html
@Pliner what's the best type for SrcDeleteAfter
(every solution will require custom JsonConverter
):
-
record DeleteAfter(DeleteAfterEnum, int?)
- SrcDeleteAfter = new DeleteAfter(DeleteAfterEnum.Never)
- SrcDeleteAfter = new DeleteAfter(DeleteAfterEnum.QueueLength)
- SrcDeleteAfter = new DeleteAfter(10)
-
string
(custom JsonConverter will read/write integer if can be parsed from string)- SrcDeleteAfter = DeleteAfterNever // readonly string DeleteAfterNever = "never"
- SrcDeleteAfter = DeleteAfterQueueLength // readonly string DeleteAfterNever = "queue-length"
- SrcDeleteAfter = "10"
-
enum DeleteAfter { Never = -1, QueueLength = -2 }
and every other value is treated as integer- SrcDeleteAfter = DeleteAfter.Never
- SrcDeleteAfter = DeleteAfter.QueueLength
- SrcDeleteAfter = (DeleteAfter)10
@zidad see previous comment.