You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 22, 2023. It is now read-only.
I run into a problem with the header binding. When it deserializes a message with a header binding of type 'long' it throws in certain scenarios:
public class StockDataUpdateMessage
{
[MessageHeader("timestamp"), IgnoreDataMember]
public long Timestamp { get; set; }
}
If I send a message with this header and type 'string', everything works fine:
If I send a message with this header and type 'number', it throws an exception:
Here is the exception, it happens when the message is first deserialized:
System.InvalidCastException: Unable to cast object of type 'System.Int64' to type 'System.Byte[]'.
at EasyNetQ.MetaData.Bindings.HeaderBinding.FromMessageMetaData(MessageProperties source, Object destination)
at System.Collections.Generic.List1.ForEach(Action1 action)
at EasyNetQ.MetaData.MetaDataMessageSerializationStrategy.DeserializeMessage(MessageProperties properties, Byte[] body)
at EasyNetQ.RabbitAdvancedBus.<>c__DisplayClass17_0.b__0(Byte[] body, MessageProperties properties, MessageReceivedInfo messageReceivedInfo)
at EasyNetQ.RabbitAdvancedBus.<>c__DisplayClass21_0.b__0(Byte[] body, MessageProperties properties, MessageReceivedInfo receivedInfo)
at EasyNetQ.Consumer.HandlerRunner.InvokeUserMessageHandlerInternalAsync(ConsumerExecutionContext context)
What are your recommendations to handle the situation?
Thanks a lot!