Jump to content

Andre Capelli

Members
  • Content Count

    11
  • Joined

  • Last visited

Everything posted by Andre Capelli

  1. Hi guys! I'm having a little problem, my rest api on horse (Backend, console application), it's working very nice, but, i'm about to receive about 1000 jsons, how can I control that? The response time 201 - Created is about 1 ~ 2 seconds for one json. Thanks.
  2. Andre Capelli

    Receiving multiples JSON on Rest API Horse

    I think it's better to recreate after reading this.
  3. Andre Capelli

    Receiving multiples JSON on Rest API Horse

    How would I do that? Can You give some examples?
  4. Andre Capelli

    Receiving multiples JSON on Rest API Horse

    Yes, I have to send the response back if occurs any error in any part of the SQL, the server is a web site (RD Station)
  5. Andre Capelli

    Receiving multiples JSON on Rest API Horse

    Yes, 201 for created and all information updated, and 400 if error on create or on insert any information ( the server will try again in 15 minutes, they control that) I'm thinking in save every json on a txt file right on the post, and create a parallel thread to do all the working later, that can work right?
  6. Andre Capelli

    Receiving multiples JSON on Rest API Horse

    Exactly, I can't control. Yes, the Backend it's where Delphi code is with Horse, the server is a client that sends posts. The server sends a post to a URL that redirects to the Backend, I just receive the rest calls and after the whole code I send back the response. I didn't understand too, after I created a log it's easy to see the processing stops and starting again with the new request thanks for the help, I'll look up about creating a queue
  7. Andre Capelli

    Receiving multiples JSON on Rest API Horse

    Yes, that's why I'm trying to rewrite that code, works only for one json. The json is like this {"leads":[{json}]} - one like this for each person {"leads":[{json}]} - another person and that go on. Now, the Backend is working with a delay on the posts {"leads":[{json}]}, because it only process one at a time. Example: the server send 3 posts with {"leads": [{json}]}, {"leads": [{json}]}, {"leads": [{json}]} in the same moment, how to control that at the same time?
  8. Andre Capelli

    Receiving multiples JSON on Rest API Horse

    Option 2, here it's an example of the json: { "leads": [{ "id": "1872278237", "email": "brodherjoao141186@gmail.com", "name": "Piu", "company": null, "job_title": null, "bio": null, "public_url": "http://app.rdstation.com.br/leads/public/55f0e6d6-418e-4d65-903b-663914ab9f22", "created_at": "2021-11-25T00:21:16.855-03:00", "opportunity": "true", "number_conversions": "1", "user": null, "first_conversion": { "content": { "telefone": "71 99723-9477", "nome": "Piu", "traffic_source": "utm_source=Facebook%20Ads\u0026utm_medium=cpc\u0026utm_campaign=Vila%20Valqueire%20Telefone%20Branco", "identificador": "Vila Valqueire Telefone Branco", "email_lead": "brodherjoao141186@gmail.com", "UF": null }, "created_at": "2021-11-25T00:21:16.876-03:00", "cumulative_sum": "1", "source": "Vila Valqueire Telefone Branco", "conversion_origin": { "source": "Facebook Ads", "medium": "cpc", "value": null, "campaign": "Vila Valqueire Telefone Branco", "channel": "Paid Search" } }, "last_conversion": { "content": { "telefone": "71 99723-9477", "nome": "Piu", "traffic_source": "utm_source=Facebook%20Ads\u0026utm_medium=cpc\u0026utm_campaign=Vila%20Valqueire%20Telefone%20Branco", "identificador": "Vila Valqueire Telefone Branco", "email_lead": "brodherjoao141186@gmail.com", "UF": null }, "created_at": "2021-11-25T00:21:16.876-03:00", "cumulative_sum": "1", "source": "Vila Valqueire Telefone Branco", "conversion_origin": { "source": "Facebook Ads", "medium": "cpc", "value": null, "campaign": "Vila Valqueire Telefone Branco", "channel": "Paid Search" } }, "custom_fields": {}, "website": null, "personal_phone": "71 99723-9477", "mobile_phone": null, "city": null, "state": null, "tags": ["max filial vv", "vila valqueire - ads"], "lead_stage": "Lead", "last_marked_opportunity_date": "2021-11-25T00:29:39.508-03:00", "uuid": "55f0e6d6-418e-4d65-903b-663914ab9f22", "fit_score": "d", "interest": 0 } ] } I'm treating only one json per time, that way, if the Backend receive another post, he stop decoding that json and start on the new one, I don't know how to control that. And yes, i'm opening and closing the connection for each json, I only send the response 201 back when all is done.
  9. Andre Capelli

    Receiving multiples JSON on Rest API Horse

    I have a Webhook pointing at the DDNS in the Cliente Server
  10. Andre Capelli

    Receiving multiples JSON on Rest API Horse

    The Backend works fine now, but it works receiving one json at time.
  11. Andre Capelli

    Receiving multiples JSON on Rest API Horse

    Sorry, let me elaborate. Yes, It's in Delphi, the Backend will receive the JSONs and Insert into the Database. The response time was just in case anyone needed. But the problem is how I receive that much json and read and insert one per time, or all of them at the same time.
×