azure-service-bus-dotnet icon indicating copy to clipboard operation
azure-service-bus-dotnet copied to clipboard

MessageInteropExtensions.GetBody<T>() potential bug?

Open SeanFeldman opened this issue 6 years ago • 7 comments

The method has the following block prior to attempting payload deserialization:

https://github.com/Azure/azure-service-bus-dotnet/blob/9d4d1ca430ab9b068537378c485005872065f874/src/Microsoft.Azure.ServiceBus/Extensions/MessageInterOpExtensions.cs#L83-L86

I've tried sending a message using sender.SendAsync(new BrokeredMessage(byte[])) and retrieving message using the new client with

var msg = await receiver.ReceiveAsync()
msg.GetBody<byte[]>()

as well as senging using sender.SendAsync(new BrokeredMessage(new MemoryStream(byte[]))), but the block has never executed. What's the scenario it serves?

SeanFeldman avatar May 02 '18 06:05 SeanFeldman

@Azure/azure-service-bus-write ping

SeanFeldman avatar May 03 '18 07:05 SeanFeldman

Could you try sending messages using old client with message body of type https://github.com/Azure/azure-service-bus-dotnet/blob/9d4d1ca430ab9b068537378c485005872065f874/src/Microsoft.Azure.ServiceBus/Amqp/AmqpMessageConverter.cs#L531-L546

nemakam avatar May 03 '18 20:05 nemakam

No luck @nemakam. That block never executes.

SeanFeldman avatar May 04 '18 03:05 SeanFeldman

@nemakam any updates on your end?

SeanFeldman avatar May 08 '18 06:05 SeanFeldman

I haven't had time to look into this task. There are few higher priority tasks that I'm looking into. As of now, we don't know any scenario which is failing because of this, do we?

nemakam avatar May 08 '18 18:05 nemakam

As of now, we don't know any scenario which is failing because of this, do we?

I have a use case where I want to go through the extension as I don't know if the sender has sent byte that were serialized or not. According to the code, ASB should be able to determine if bytes were sent w/o encoding and return earlier with no need to go through decerialization part. Yet is failing, causing my code to throw.

It's not something blowing up in production, but if this code does nothing A) Should be removed not to confuse B) If it's there for a reason, then it's not wroking.

SeanFeldman avatar May 08 '18 19:05 SeanFeldman

@nemakam I'm at the point where I need to handle messages from old and new client and this issue become relevant again.

SeanFeldman avatar Jun 08 '18 19:06 SeanFeldman