Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.
/ ServerCommon Public archive

GetRawBody method #423

Merged
merged 1 commit into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;

namespace NuGet.Services.ServiceBus
Expand All @@ -20,5 +21,6 @@ public interface IReceivedBrokeredMessage
Task AbandonAsync();
string GetBody();
TStream GetBody<TStream>();
Stream GetRawBody();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change on a public interface, do we need to be concerned about that here?

Copy link
Contributor Author

@agr agr Feb 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're the only consumer and the only meaningful implementation is shipped with the interface. It might break tests (in case we have test implementation of that interface), but I'll fix those as I update the package in consuming projects. So, I don't think there is a concern.

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
using System.Threading.Tasks;
Expand Down Expand Up @@ -48,6 +49,11 @@ public TStream GetBody<TStream>()
return ServiceBusClientHelper.DeserializeXmlDataContract<TStream>(ServiceBusReceivedMessage.Body);
}

public Stream GetRawBody()
{
return ServiceBusReceivedMessage.Body.ToStream();
}

public Task CompleteAsync()
{
return _args.CompleteMessageAsync(ServiceBusReceivedMessage);
Expand Down