Questions tagged [ocelot]

Ocelot is a .NET API Gateway.

Ocelot is a .NET API Gateway. This project is aimed at people using .NET running a micro services/service orientated architecture that need a unified point of entry into their system. However it will work with anything that speaks HTTP and run on any platform that ASP.NET Core supports.

In particular I want easy integration with IdentityServer reference and bearer tokens.

We have been unable to find this in my current workplace without having to write our own Javascript middlewares to handle the IdentityServer reference tokens. We would rather use the IdentityServer code that already exists to do this.

Ocelot is a bunch of middlewares in a specific order.

Ocelot manipulates the HttpRequest object into a state specified by its configuration until it reaches a request builder middleware where it creates a HttpRequestMessage object which is used to make a request to a downstream service. The middleware that makes the request is the last thing in the Ocelot pipeline. It does not call the next middleware. The response from the downstream service is retrieved as the requests goes back up the Ocelot pipeline. There is a piece of middleware that maps the HttpResponseMessage onto the HttpResponse object and that is returned to the client. That is basically it with a bunch of other features!

Home repo

Documentations

273 questions
2
votes
0 answers

The WebSocket is in an invalid state ('Aborted') for this operation

We're using subscriptions and we're seeing an unhandled exception in our log files with the following stack trace: previousRequestId: no previous request id, message: Exception caught in global error handler, exception message: The WebSocket is in…
Karol Pisarzewski
  • 680
  • 3
  • 12
  • 21
2
votes
0 answers

Is it possible to return a hardcoded response in Ocelot API Gateway?

In other api gateways, like Gloo, it is possible to create a route that instead of going downstream, it returns a "directResponseAction", like status = 200 and body = "hello". Is it possible to do the same thing in Ocelot API Gateway? To make it…
Auresco82
  • 603
  • 6
  • 14
2
votes
1 answer

Ocelot gateway support multiple claims in RouteClaimsRequirement

At the moment our config on .net core looks like this "RouteClaimsRequirement": { "Claim": "settings_read" }, Is it possible to add more claims like below. "RouteClaimsRequirement": { "Claim": "settings_read,settings_admin" }, Otherwise people with…
Patola
  • 515
  • 8
  • 30
2
votes
0 answers

signalR hub with Ocelot Gateway

I created a dummy solution then tried to connect MVC client with signalR hub through Ocelot Api gateway. ocelot works well with other http/https endpoints, but not so with signalR websocker MVC client port => 5010 ocelot gateway => 5006 signalR hub…
ayman hadi
  • 21
  • 3
2
votes
1 answer

Unhandled Rejection (Error) (HttpError) when connecting to SignalR hub in Ocelot Api Gateway via React Client Application

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: Unhandled Rejection (Error): new HttpError index.js:1 [2021-01-31T02:42:31.498Z] Error: Failed to…
user2768479
  • 716
  • 1
  • 10
  • 25
2
votes
1 answer

How to use gRPC service in .net api gateway?

I want to use the gRPC service with the api gateway. How can I use it for gRPC in .netcore? Can it be done using Ocelot?
2
votes
0 answers

Handle authentication api gateway ocelot net core

Hello I am applying a microservices architecture, but I ran into a known problem such as authentication to my apis. Since I have several microservices, I don't want to handle the authentication in each one of them so I implemented an api gateway…
Alonso Contreras
  • 605
  • 2
  • 12
  • 29
2
votes
1 answer

Why I am getting different status code from ocelot?

I have a microservice project with ocelot API Gateway. In one service I have retuned 204(No Content) response. When I run that service directly then I am getting a proper response but when I run that service using ocelot then I am getting…
Nirmal
  • 41
  • 6
2
votes
1 answer

Ocelot placeholder for downstream host

I have an API Gateway running in .NET Core 3.1 using Ocelot. Everything works fine as expected. Now I'm trying to substitute the downstream host during the middleware process. Here's my configuration.json: { "Routes": [ { …
KTOV
  • 559
  • 3
  • 14
  • 39
2
votes
1 answer

Ocelot not passing websockets to microservice

I'm trying to connect to SignalR hubs using Ocelot as proxy. SignalR is plugged in microservice that gateway passing through websockets traffic. Negotation via HTTP request is executed successfully, but further communication via websockets seems to…
Lutz Harrold
  • 123
  • 3
  • 10
2
votes
1 answer

.net core Ocelot A public method named 'ConfigureDevelopment' or 'Configure' could not be found

The code below belongs to .net core web api, which I call OcelotApiGateway. I installed Ocelot 16.0.1 via nuget package manager on the OcelotApiGateway. this is my Program.cs using Microsoft.AspNetCore.Hosting; using…
Mehmet Topçu
  • 1
  • 1
  • 16
  • 31
2
votes
0 answers

asp.net core web api does not accept extra headers

I have a Web API Gateway which calls other micro services. The communication between Gateway and micro services works fine. I am not able to use "AddClaimsToRequest" but am able to use "UpstreamHeaderTransform" . Does OCelot 16.xx supports…
Full Stack Brain
  • 455
  • 1
  • 6
  • 19
2
votes
1 answer

Ocelot API gateway setting only TimeOut value throwing error

According to Ocelot document Quality Of Service we can metion only TimeOutValue in Routes, like "QoSOptions": { "TimeoutValue":5000 } but this is throwing exception like Ocelot.Requester.Middleware.HttpRequesterMiddleware: Debug: requestId:…
Nithya
  • 582
  • 8
  • 19
2
votes
2 answers

Integrating Ocelot 16.0 with ASP.Net Core 3.1 not working as I need to use Swagger with Ocelot

I have used Ocelot with Asp.Net Core 2.1 and its working but when using with Asp.Net Core 3.1 it is not working at all. In my opinion, it is not picking up the "ocelot.json" file. Following is my Program.cs file: using System; using…
2
votes
0 answers

Ocelot Asp.net Core PreAuthentication Middleware

I'm currently using Ocelot as Api Gateway for a micro-services architecture. I have some authenticated reroutes and to be able to use it I declared a authentication Middleware like this : var authenticationProviderKey = "Authentification"; …
lioleveau
  • 518
  • 1
  • 6
  • 23