Web Service may be active, or only passive (always receive a request)

Asked

Viewed 233 times

1

What is called a Web Service (Active, Middleware, Passive, or is it always Web Service?) that sends data to a client or other Web Service when an event occurs in the system to which it belongs?

Example, when a change in the status of an order occurs, of "not billed" to "billed", and I want to send this change to the client or other Web Service. This function is a Web Service, or is a function of the client keep checking every X time, if there has been change in the request?

Or should I create another service for that purpose.

  • 2

    From the description it appears to be webhook.

2 answers

2


Apparently by the description of your doubt this is done with a webhook;

What Are Webhooks?

Every time an event happens in your application, it is responsible for how this information is received in real time.

How it works?

In general webhooks will post the data to you (such as JSON, XML or even form data).

The service provider will do the Handling of this information often allowing you to choose how this information is received by your application.

NOTE: nowadays most web frameworks already come with a predefined configuration and will make your work easier(search by echo Standard).

Simple care when using a webhook

  • Webhooks are responsible for data delivery, in case there is any error in your application this data may be lost.

  • Learn how to interpret error messages and how your provider handles the responses to each action, so you can tailor your program to handle any application errors.

  • Keep in mind that a webhook can handle multiple simultaneous requests, make sure your application can support scalability without losing quality.

Good overall that’s it, in case you still have any doubts take a look at this link:

  • Using Websockets as a solution is this kind of problem, it’s a good idea?

  • From what I understand, the Laravel is done in PHP, there is some good equivalent for . NET?

1

He can be active yes, study Websocket, in short, Websocket is a persistent connection between the served and the clients, the server, whenever there is a change, can send information directly to the clients that are connected.

  • I believe that maintaining an open connection between server and client in such cases is unfeasible. Imagine the day you have 100 pending orders... keeping 100 active connections can be quite damaging to the system.

  • Websockets require very little of the server, its protocol is extremely light and, I have seen cases of 2000 connected clients and the server practically does not spend processing nor network.

  • @Guilhermebarros is right, I have a websocket application running daily with 150+ people connected all the time and no more than 100mb of RAM spent by the server.

  • Yes I know the Websockets, but it does not seem to me the correct solution for this context, I had even thought about this possibility, but had been in doubt. Now you can’t imagine that Websockets consumed so little memory compared to the amount of connections. What Resiliencythis occurs some severe Exception/crash on some connection?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.