ocelot | a language extension library
kandi X-RAY | ocelot Summary
kandi X-RAY | ocelot Summary
ocelot is a collection of libraries to provide features that the C language lacks, various data structures that most programs use in common, and facilities for interaction between a program and its environment. This package collects libraries into three categories called cbl, cdsl and cel. Libraries belonging to cbl(C basic library) provide features that the the language lacks and include alternative memory allocators and an exception handling facility. Those to cdsl(C data structure library) implement various data structures frequently used by most programs. Those to cel(C environment library) aid interaction with the execution environment.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ocelot
ocelot Key Features
ocelot Examples and Code Snippets
Community Discussions
Trending Discussions on ocelot
QUESTION
There is a couple of confusing points in the documentation that make me struggle to understand how exactly distribution across the cluster happens in Orleans. Hence, the questions.
Question #1
Orleans claims to have a built-in distribution capabilities to distribute across multiple servers. To me it sounds that Orleans can act as a load balancer itself and can scale out automatically. Thus, if I deploy Orleans app to several servers, then service discovery and load management should happen automatically, correct?
In this case, why some docs and articles suggest using other tools, like Ocelot or Consul, as a single entry point to Orleans cluster?
Question #2
I would like to use simple but distributed in-memory storage across several servers, like Redis or Apache Ignite, and I would like to know if it's possible to use a simple grain as this kind of a data storage?
Let's say, one grain will store a collection of restaurants and some other grain will keep track of the last 1000 visitors for selected restaurant. Can I activate these 2 grains only once as a singleton collection, add or remove records to each collection, and use these 2 grains as in-memory storage evenly available to all nodes in the cluster? Also, if answer is yes, do I need to add locks to these collections or each grain always exists in a single thread?
...ANSWER
Answered 2021-May-30 at 02:05- Service discovery and load management happen automatically indeed. Consul is not a strong required. The only external requirement is a Membership table provider - something that is used internally by Orleans Clustering. There are many build in Membership table providers that come already built-in with Orleans. For example, Azure table storage. all you need is to configure Orleans to use it and of course have Azure storage account. Consul is another alternative to Membership table provider and there are more.
Another thing that does not come built-in is infrastructure scaling. If your service demand increases, something need to ask the infrastructure provider (Cloud Provider) to add more Servers. Once servers are added, Orleans will automatically adjust the workload and load balance across the new servers as well. But figuring out that more servers are needed and adding them is not done by Orleans itself (there likely some externally contributed tools to do that. maybe K8 can be configured to do that? I am not completely sure about that).
- Yes, you can use those 2 grains as in-memory storage, just like you wrote. And no, you do not need to use locks. All grains are single threaded.
QUESTION
I have a local Kubernetes install based on Docker Desktop. I have a Kubernetes Service setup with Cluster IP on top of 3 Pods. I notice when looking at the Container logs the same Pod is always hit.
Is this the default behaviour of Cluster IP? If so how will the other Pods ever be used or what is the point of them using Cluster IP?
The other option is to use a LoadBalancer type however I want the Service to only be accessible from within the Cluster.
Is there a way to make the LoadBalancer internal?
If anyone can please advise that would be much appreciated.
UPDATE:
I have tried using an LoadBalancer type and the same Pod is being hit all the time also.
Here is my config:
...ANSWER
Answered 2021-May-24 at 18:49I solved it. It turned out that Ocelot API Gateway was the issue. I added this to the Ocelot configuration:
QUESTION
I'm trying to use Ocelot (Api gateway) + consul + my web api (.Net 5) via HTTPS in docker;
- ocelot - v17.0.0
- consul - latest https://hub.docker.com/_/consul
- my service - ASP.NET 5 Web Api
ANSWER
Answered 2021-Apr-18 at 23:20you have a ssl error last case. You may 2 options for this issue
best.option you creating your own certificate and then getting it trusted by your local or remote machine.
quick option you can add this line your ocelot.json
"DangerousAcceptAnyServerCertificateValidator": true
you should add networks
tag on your docker-compose file.
like below:
QUESTION
As per the documentation i tried to merge my config files so they are a bit more readable. The generated ocelot.json file however is not like expected. My folder structure is like follows:
Below is a text representation of this:
...ANSWER
Answered 2021-Apr-12 at 12:02Since your different route configuration files are located in a folder you should make sure the correct overload of the AddOcelot method is called. In this case the method should be called with the folder name containing the route files.
For example:
QUESTION
I am trying to open my SCORM education in a new window but when i do, all the reporting stops working (The same goes if i do it in an iframe). When i just do location.href = scormURL; then it works fine. My scorm file is in a different domain then the LMS.
It seems like the SCORM api doesn't get initialized after doing loadFromJSON(response) on my scorm response. But this problem only occurs when i open in a new window or show the scorm education in an iframe.
I use SCORM2004.
EDIT: It was XSS problem and it was solved by routing to azure CDN via ocelot gateway to get the same domain.
...ANSWER
Answered 2021-Mar-04 at 04:04My scorm file is in a different domain then the LMS.
This is your problem.
The only link the SCORM package has to your LMS (and therefore to your reporting) is the SCORM API. Modern browsers do not allow CORS (cross-origin resource sharing) by default because it opens you to XSS (cross-site scripting) attacks.
The package may be able to find the API if one exists on the external domain, but it will not be able to communicate with the LMS directly.
The way I worked around this was to add a wrapper .js
file on the external domain that hosted the SCORM API and used Window.postMessage
to pass calls back to the LMS.
You then use window.open
or your iframe
to open a page on the external domain which has access to scorm_wrapper.js
and its own iframe
that hosts your package.
Because the Window.opener
method is not reliable and not fully-featured when the current window
was opened from a different origin, we will use the domain directly.
Since we control the LMS, we know the domain it is running on and since we just opened the package, we know it should be active. We can postMessage
it to ask for a reply.
QUESTION
I created an ocelot gateway that redirects to an api. this works file on localhost but as soon as i deploy the projects to azure app services ocelot stops working. the api still works though.
I already set the DownstreamHostAndPorts to the api app service url and the port to 443. Also the BaseUrl has been set to the gateways app service url.
...ANSWER
Answered 2021-Mar-13 at 12:31This morning it suddenly worked without changing anything. I think something happened in my cache maybe. I did try to empty it though. Maybe it had to do with the cache in azure.
QUESTION
Good day, I have an issue with a custom response in API Gateway Ocelot with Middleware. inside FormatResponse(context.Response) I change response for specific endpoint and I see the new response on debug but I receive the original Response in final result on postman. ex : original Response
...ANSWER
Answered 2021-Feb-16 at 14:03The best answer from Richard Deeming: https://www.codeproject.com/Questions/5294847/Fix-issue-with-custom-response-NET-core-API-gatewa
QUESTION
I am trying to connect to a SignalR hub behind an Ocelot Api gateway from a React application. However, when doing so I get the following error:
...ANSWER
Answered 2021-Jan-31 at 03:28First of all, web sockets secure (wss), which is not mentioned in the Ocelot documentation, can be used as DownStreamScheme as pointed out by sam9291 here (https://github.com/ThreeMammals/Ocelot/issues/1179).
Secondly, Cors must be enabled on the SignalR app with AllowCredentials() as detailed by Microsoft here (https://docs.microsoft.com/en-us/aspnet/core/signalr/security?view=aspnetcore-5.0).
Thirdly, there has to be a {catchAll} route in the ocelot.json, which is necessary becausse the handshake involves getting/posting to other routes:
QUESTION
I have a web application making requests to different APIs through an Ocelot API gateway. One of the endpoints require authentication via JWT sent as an Authorization header in the format "Authorization: Bearer {access_token}" (the "Bearer" keyword identifying it as a bearer/token authentication scheme). This token is specific for the app and is not used to authenticate with the gateway (which uses a different authentication scheme), rather it is stored as a claim in the application's secure HttpOnly cookie.
While Ocelot does support transforming claims into headers (https://ocelot.readthedocs.io/en/latest/features/claimstransformation.html),
...ANSWER
Answered 2021-Jan-29 at 23:20Delegating Handlers (https://docs.microsoft.com/en-us/dotnet/api/system.net.http.delegatinghandler?view=net-5.0, https://ocelot.readthedocs.io/en/latest/features/delegatinghandlers.html ), adding "stuff" to the request before it is sent, turned out to be very suitable for this task. As the Ocelot claims transformation takes place before they are called, it is simply a matter of transforming the claims to headers, then concatenating their values and adding them as a new header.
First edit ocelot.json:
QUESTION
I am trying to follow Microsoft's Ocelot API Gateway tutorial (https://docs.microsoft.com/en-us/dotnet/architecture/microservices/multi-container-microservice-net-applications/implement-api-gateways-with-ocelot).
First I intialized a new empty ASP.NET Core web app:
...ANSWER
Answered 2021-Jan-21 at 12:16From the documentation, WebHost
is in the namespace Microsoft.AspNetCore
. But in your code, It hasn't the using to this namespace.
In Visual Studio, you can try Go to definition on WebHost
to discover where the type come.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ocelot
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page