Skip to content

Commit

Permalink
fixed cloning by utilizing Service Bus .Clone(stream) instead of .Clo…
Browse files Browse the repository at this point in the history
…ne(string) (#247)

* fixed cloning by utilizing Service Bus .Clone() instead of custom .Clone() for Streams

* updated to pass stream and call static helper function for cloning with a stream as suggested

* handled for multiple messages off of the message object

* removed unnecessary whitespace change

Co-authored-by: Christopher Lombardi <clombardi@confluence.com>
  • Loading branch information
c-lombardi and christopherlombardiconfluence committed Nov 13, 2020
1 parent 8970c2c commit afb66ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ServiceBusExplorer/Forms/MessageForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ private async void btnSubmit_Click(object sender, EventArgs e)
// For body type ByteArray cloning is not an option. When cloned, supplied body can be only of a string or stream types, but not byte array :(
outboundMessage = bodyType == BodyType.ByteArray ?
brokeredMessage.CloneWithByteArrayBodyType(txtMessageText.Text) :
brokeredMessage.Clone(txtMessageText.Text);
brokeredMessage.Clone(brokeredMessage.GetBody<Stream>());
}
else
{
Expand All @@ -395,7 +395,7 @@ private async void btnSubmit_Click(object sender, EventArgs e)
// For body type ByteArray cloning is not an option. When cloned, supplied body can be only of a string or stream types, but not byte array :(
outboundMessage = bodyType == BodyType.ByteArray ?
message.CloneWithByteArrayBodyType(messageText) :
message.Clone(messageText);
message.Clone(message.GetBody<Stream>());
}

outboundMessage = serviceBusHelper.CreateMessageForApiReceiver(outboundMessage,
Expand Down

0 comments on commit afb66ae

Please sign in to comment.