Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is changing from wcf binding transferMode from "Buffered" to "Streamed" considered a breaking change for the client?

I have a WCF service endpoint that serves binary documents through a stream. The endpoint looks something like this:

public Stream GetFile(int fileId){
...
}

The basicHttpBinding for this service endpoint is configured erroneously to use TransferMode="Buffered". The service endpoint is currently used by integrating parties outside my control. Due to the memory consumption issues with buffered transfermode I want to change this to TransferMode="Streamed".

Can I safely do this change on the service binding configuration and expect that this will not break anything for any integrating parties?

like image 312
Andreas Presthammer Avatar asked May 15 '14 05:05

Andreas Presthammer


People also ask

What is a buffered transfer in WCF?

Windows Communication Foundation (WCF) transports support two modes for transferring messages: Buffered transfers hold the entire message in a memory buffer until the transfer is complete. A buffered message must be completely delivered before a receiver can read it.

How do I select between buffered and streamed transfer modes?

Selecting between buffered and streamed transfer modes is done on the binding element of the transport. The binding element has a TransferMode property that can be set to Buffered, Streamed, StreamedRequest, or StreamedResponse. Setting the transfer mode to Streamed enables streaming communication in both directions.

What are the different types of WCF transfers?

Windows Communication Foundation (WCF) transports support two modes for transferring messages: Buffered transfers hold the entire message in a memory buffer until the transfer is complete. Streamed transfers expose the message as a stream.

What is the difference between buffered and streamed TCP transfers?

Changing the transfer mode from buffered to streamed also changes the native channel shape of the TCP and named pipe transports. For buffered transfers, the native channel shape is IDuplexSessionChannel. For streamed transfers, the native channels are IRequestChannel and IReplyChannel.


2 Answers

To the best of my knowledge, WCF streamed mode transfer is opt-in at the client, meaning that even if you change it at the server, unless the client changes their end as well they'll still receive the stream in its entirety before serving it as a buffered chunk of data. In other words, it should be transparent to your clients, but will enable them to opt-in to a streamed response.

like image 176
Haney Avatar answered Oct 14 '22 00:10

Haney


Official Microsoft documentation on the matter confirms it is opt-in and does NOT affect functionality meaning it should not be a breaking change.

"You can turn on streaming for requests and replies or for both directions independently at either side of the communicating parties without affecting functionality. However, you should always assume that the transferred data size is so significant that enabling streaming is justified on both endpoints of a communication link. For cross-platform communication where one of the endpoints is not implemented with WCF, the ability to use streaming depends on the platform's streaming capabilities."

like image 38
bkqc Avatar answered Oct 14 '22 01:10

bkqc