-
Notifications
You must be signed in to change notification settings - Fork 584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataContract Serialized Stream-Bodied Messages Sent in Repair and Submit Are Corrupted #245
Comments
I think that you might just need to instantiate the new BrokeredMessage with the body of the old message as a stream:
|
Hi @c-lombardi the Clone overloaded method in the BrokeredMessageExtensions class should do exactly what you are looking for. This is the first time that I receive this feedback. Could you please debug the application and see if the proper method overload is used when choosing Stream as format for the message to resubmit? public static BrokeredMessage Clone(this BrokeredMessage message, Stream stream)
{
if (stream == null)
{
return null;
}
if (stream.CanSeek)
{
stream.Seek(0, SeekOrigin.Begin);
}
var clone = message.Clone();
BodyStreamPropertyInfo.SetValue(clone, stream);
return clone;
} |
I see what you are saying now and that seems to have resolved the problem for me in my local build! |
Just making sure you're always using the latest release that can be obtained here. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
When re-queuing Dead-Letter-Queued messages with a Stream body that have a custom content type that was serialized by a Data-Contract-Serializer, the stream sent in the new message can no longer be read by the application that originally Data-Contract-Serialized the message.
Attempting to re-queue the same messages with ByteArray and String content types are also unsuccessfully able to be de-serialized by the application.
It appears that the message body is corrupted when the body was a custom content type and serialized with the DataContractSerializer.
The text was updated successfully, but these errors were encountered: