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

StackOverflow https://stackoverflow.com/questions/23670270

  •  23-07-2023
  •  | 
  •  

Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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."

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top