-1

Since i had bad introduction that confused people, I am editing the question and removing the introduction I previously made.

Now, here is the business case for which now I have concerns. C# pseudocode:

 Array.ForEach(files, filename =>
                    {
                        try
                        {
                           WcfServiceClient wcfClient = new WcfServiceClient();
                           wcfClient.SomeMethodWhichPostsFile(filename);
                        }
                        catch (Exception ex)
                        {
                            LogException(ex)
                        }
                    }
                );

I am confused because of existence of WSBinding which is reliable, and basicHTTPBinding is not. I know that WSBinding with reliable sessions guarantees delivery, order, content is encrypted etc. But in the case I described with pseudocode, according to my opinion I have all of these supported even with basicHttpBinding and HTTPS over TCP. TCP provides me reliability, order guarantees and HTTPS encryption.

  1. (1. is removed) Am I right related to previous? Or to rephrase: is there an example to show that basicHttpBindind under specified conditions can not provide the same features as WS binding with reliable sessions?

  2. My business case requires to accept WCF calls by the order they are issued. If I send them synchronously from the client in a foreach loop (as shown in pseudo code), I assume the order at the server is guaranteed regardless if those are sent within one TCP connection or not, since I am waiting for the response and then I send another request. Even loadbalancer can not disorder messages here since there is no parallelization, messages are sent one by one synchronously. I assume disordering could happen only if I send messages without waiting for response in fire and forget manner and I use different TCP connections. So, am I right here? :)

Miloš
  • 149
  • 1
  • 12
  • *"It can be found at the lot of sites that HTTP is not reliable."* - This is a claim without source. Please cite the relevant source and make sure that their understanding of what *reliable* means matches your understanding - and also explain what this understanding is. Because, *reliable* can mean many different things. – Steffen Ullrich Nov 15 '18 at 16:51
  • Example:"Reliable messaging is the guarantee that a message sent by a sending application is indeed received at the other end, and received only once. One of the most common objections against REST is that REST doesn't offer reliable messaging." - https://www.infoq.com/articles/no-reliable-messaging Anyway, maybe I started the question wrongly, but that was just introduction to the cases described, not the point of the question.Point of my question is that someone confirms or denies my understandings related to the bullets 1, 2 and 3 and me to understand why WS reliablity when TCP offers it. – Miloš Nov 15 '18 at 18:13

1 Answers1

0

There are different meanings of the term reliability and the interpretation also depends on the context. Your interpretation of reliability in your question is message is delivered. The interpretation of reliability in the source you cite is instead message is delivered exactly once. Your confusion comes from taking the statement "HTTP is not reliable" which was meant for one interpretation of reliability and using it in the your different interpretation of reliability.

HTTP cannot guarantee that the message gets only delivered once, it can at most guarantee that the message is delivered at least once. It can happen that the underlying TCP connection breaks while sending the request or receiving the response. In this case the client might ignore the problem or retry, which might result in no message delivered (ignoring errors while sending request) but also the same message delivered multiple times (retrying if connections breaks during response). By retrying until the response is received successfully one can guarantee that the message is received at least once, which is your interpretation of reliability but not the one from the statement you cite.

Steffen Ullrich
  • 114,247
  • 10
  • 131
  • 172
  • I appreciate your effort to help, and this post helped. By reading your answer I found another question, formulated better then mine but with the same essence. I will mark that question's answer as answer of this one. I upvoted your answer and I am sorry you downvoted my question for bad introduction. Quoting other sites was not the essence. I now think that my assumption 2 is wrong, but it would be nice to get your opinion for 2. and 3. – Miloš Nov 16 '18 at 00:08
  • @Miloš: Information which are important to answer the question should be part of the question and not a comment. My downvote is locked by the system until you actually edit the question instead of adding only a comment. As for 2.+3.: it is not clear what your requirements for reliability actually is so it cannot be answered. Given your code it does not provide *delivered exactly once* though. It does not even even provide *delivered at least once* since you only make a single attempt for each request and ignore any failures which can happen if the TCP connection breaks during delivery. – Steffen Ullrich Nov 16 '18 at 01:33