This question already has an answer here:
Swagger like documentation for queueing and messaging like mqtt or sqs [closed]
(1 answer)
Closed 3 years ago.
We use Open API specifications (OAS) for HTTP APIs. We use these in our microservice/applications to generate a Swagger UI, but it's also great for documentation and collaboration.
Some internal messaging is also done asynchronously via a message broker (RabbitMQ/AMQP). Is there something that other people/companies use to document async messages operations? It would be nice to just hand integration teams something like an OAS...
I'm currently working with a team who are evaluating Async API for describing services that use messaging over AMQP and other similar protocols. It sounds like it might address some of your needs?
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
So I'm building a web shop using Firestore and Firebase for the first time, I'm also new to NoSQL. I have the following architectural problem: When a customer places an order the client sends the products ordered to Firestore directly which stores the order in a collection raw_orders. My idea then was to have a Cloud Function trigger on the document create which processes it and builds an invoice and such. However I read that this function invocation may be delayed for 10 seconds, I would like to have a synchronous solution instead.
Instead I had the idea to create a HTTP Cloud Function where the customer can POST the order to, the HTTP function then processes the order and pushes it to Firestore, the function then returns the orderID or something to the customer. This approach feels much more safe since the user won't have to talk to the database directly. Also it solves the issues that the a function triggered by a Firestore create might be delayed.
However I'm new to Firebase and I'm not sure if this is architecturally the preferred way. The method I propose seems to be more in line with regular old REST APIs.
What do you think?
Thanks!
It sounds like you definitely have some server-side code and database operations that you can't trust the clients to do. (Keep in mind that firestore security rules are your only protection -- anyone can run whatever code they want within those rules, not just the code you provide).
Cloud functions give you exactly this -- and since you both want the operation to be synchronous (from the view of your client) and presumably have some way for the client to react to errors in the process, a cloud function would make a lot of sense for you to use.
Using cloud functions in this way is very common in Firebase apps, even if it isn't pure REST.
Moreover, if you are using Firebase more generally in your client, it might be more natural to use a callable cloud function rather than an http function, as this will handle the marshaling of the parameters in a much more native way than a raw HTTP request might. However, it isn't clear in your case since it sounds like you're using the REST API today.
Keep in mind that there are additional costs (or specific quotas, depending on your pricing plan) for running cloud functions. The pricing is based on invocations, as well as CPU and RAM usage of your functions.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
Currently we are working on large scale angular application. As per our servers and security architecture, we have three servers assume A | B | C (Client). Now A server has all database and all firewall rules and some specific ports open and outside world cannot access server A directly, which means C (Client) cannot access server A directly. We have to go through server B. and then server B make request to server A and send the response to C.
If above is making sense to you.
As per our current architecture, we have added WCF Service to Server A and WebApi to Server B and exposing the WCF service through Service Contract as an Interface and Client Factory.
Now we making to HTTP Request through our Angular Client (C Server) to server B and then B forward that request to server A after perform some request validation rules and provide us the output. I just want to know are we following the right approach. Having a WCF Service seems we are using some outdated approach. We are totally depend on Microsoft technologies on back end.
What are the other options we can try here.
Regards
Your architecture is ok and you are right when you say that WCF Service seems outdated.
I use a similar architecture but instead of WCF Service I use RESTful services provided by a NET CORE 2.0 api.
For my project I started from this template: QuickApp - ASP.NET Core/Angular5 Project Template.
This application consists of:
Template pages using Angular5 and TypeScript
RESTful API Backend using ASP.NET Core MVC Web API
Database using Entity Framework Core
Authentication based on OpenID Connect
API Documentation using Swagger
Angular CLI for managing client-side libraries
Theming using Bootstrap
This template use a single project for the api (the Net Core controlles classes) and the client (the Angular client app) but separating them will be very simple.
Into the template you can se the use of AutoMapper for the object-object mapper. It's usefult in the controller when you use a 'ViewModel' class instead of the model class. A ViewModel is a container-type class, which represents only the data you want to display on your web page.
I also suggest you to use Autofact to manage dependency injection.
Pretty much sounds like the API-Gateway pattern often found within microservice architectures.
Take a look at this page: http://microservices.io/patterns/apigateway.html
Usually, the implementation of such a gateway is lightweight and simple, I agree that WCF is not the right option. You might be better off building a simple ASP.NET Core REST endpoint that redirects your requests to server A.
I would like to create a websocket client for the Custom Speech service using a programming language such as Java, NodeJs, Go. Where can I find some technical information on how to consume that websocket from scratch (the expected message, fields, etc)?. I already read the CSS documentation but it focuses on how to use the SDK libraries for C#, javaScript, Android. What should I take into account if wanted to create my own SDK for a different language?
Thanks in advance.
Custom Speech Service uses the same API interface as the Bing Speech API, so you can use the Speech Protocol documentation at https://learn.microsoft.com/en-us/azure/cognitive-services/Speech/API-Reference-REST/websocketprotocol.
You can also start with the Websocket Javascript implementation sample at https://github.com/Azure-Samples/SpeechToText-WebSockets-Javascript.
I am creating a client program that calls various APIs, one of which is the Evernote API, through purely HTTP calls, without the use of any SDKs provided by Evernote. I realize that this makes my life harder, but it makes the lives of the users of my product much easier.
So far I have been able to authenticate with oauth 1.0 to the Evernote server. However, it's not immediately clear how to make the HTTP call after I have the oauth_token.
Where is the endpoint to make API calls to create a note on an oauth-authenticated Evernote user account? What are the url parameters for such a call? Or, what are the requirements to include in such an HTTP request?
Does Evernote use HTTP to make such calls anyway? If not, what do they use?
Do I have to format the note in XML format, or does it accept JSON as well?
Evernote does not have a RESTful API. According to the CTO, it's due to a requirement to shuttle very large amounts of data and HTTP is not efficient. There is a project on github aiming to implement a RESTful API for Evernote.
https://github.com/ttddyy/evernote-rest-webapp
CTO's Reasoning:
http://blog.programmableweb.com/2013/10/03/is-evernotes-restless-api-approach-a-model-for-other-api-designs/
I haven't used Evernote in years and never used the API.
Evernote uses thrift which can be a bit tricky to deal with. This choice is explained in this blog post. I really advise you to use the SDK as it hides all the thrift complexity.
As mentioned above, a rest wrapper is available on github. It seems very cool but it's new and not official. Use it at your own risk.
This question already has answers here:
Can I incorporate both SignalR and a RESTful API?
(3 answers)
Closed 9 years ago.
I like how Web API allows to create a RESTful interface. Also I like how Signal-R allow you to push updates to clients.
But is OK to use both at the same time? I mean, Signal-R keeps a connection to the server all the time (or simulates that with long polling), is not a waste of resources to continue creating different connection to perform interactions in Web API?
I could interact with the server through the Signal-R connection, but then I loose all the great Web API functionality.
Cheers.
I've seen this question pop up repeatedly and my answer has always been that you should use SignalR only for real-time messaging (e.g. either notifications from the server or inter-client messaging) and use WebAPI everywhere else (e.g. client just telling the server to do something/asking for some resource).
While you could use SignalR for the latter, once you get to a certain scale you are incurring a massive penalty with respect to how each message to the server has to be fanned out across a backplane implementation just so that eventually only the server actually needs to acknowledge it.