Starts in:
1 DAY
20 HRS
10 MIN
43 SEC
Starts in:
1 D
20 H
10 M
43 S
Open Closed

Unable to send file via Ocelot #5165


User avatar
0
andmattia created
  • ABP Framework version: v7.1.0
  • UI type: Angular
  • DB provider: EF Core / MongoDB

I've a method POST to send file that work on own microservice but when call came from OCELOT all data send it is blank/null.

If I expose directly the microservice it works.

My call come from HttpClient


4 Answer(s)
  • User Avatar
    0
    andmattia created

    I add more information about our landscape.

    5 microservice 2 gateway (Ocelot) 1 AuthServer 4 application connceted via HttpClient via geteway with DynamicProxy

    We try to configure gateway with static proxy but we have some issue when try to create the proxy so we move to dynamic. In our gateway we have 2 dependency (because we expose 2 microservice usede via HttpClient). We are able to comunicate via HttpClient from our remote application but one off this service need to recevie file. Before move from 5.3.1 to 7.1.x this method works fine via gateway now it's broken.

    We investigate and we see that remote service push data and multpart from remote as we expected to gateway, the gateway route che call to correct microservice but all parameters sesmse to be empty.

    we try to expose our service via Ngrok locally and call arrive empty.

    We publush on internet our remote microservice and it works fine (file will be stream as expected).

    Our microservice are hosted on IIS with local certificate but use on Ocelot the tag

    "DangerousAcceptAnyServerCertificateValidator": true,
    

    the service affected to not forward file stream is configured

    {
          "DangerousAcceptAnyServerCertificateValidator": true,
          "ServiceKey": "DataLoader Service",
          "DownstreamPathTemplate": "/api/loader/{everything}",
          "DownstreamScheme": "https",
          "DownstreamHostAndPorts": [
            {
              "Host": "localhost",
              "Port": 45266
            }
          ],
          "UpstreamPathTemplate": "/api/loader/{everything}",
          "UpstreamHttpMethod": [
            "Put",
            "Delete",
            "Get",
            "Post"
          ]
        },
    
  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    Can you share the project to galip.erdem@volosoft.com

  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    Re-opening the issue, the problem is not solved yet.

  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    Re-opening the issue again. I've sent an email but couldn't receive any reply about it.

    I could not run the solution you've sent because of azure nuget source.

    Can you help me to understand the problem better; is the file sending working when you deploy to a server but it is not working on the local server?

    We are able to comunicate via HttpClient from our remote application but one off this service need to recevie file. Before move from 5.3.1 to 7.1.x this method works fine via gateway now it's broken.

    The problem seems to be related to the client proxy. We moved to static client proxies after v7.0 that you may want to look at.

    If it is about the file size, you may also want to check this ocelot issue about how to fix it.

    We can also arrange an online meeting where you can explain the problem in more detail so I can try to help you better.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06