Do we need a REST BPM/Function Widget?

Yes, I know there is RestSharp and HttpClient but as people call more APIs in their functions, will we run into socket exhaustion and lose performance for standing up new sockets for each call? :thinking:

If there was a REST widget, it could still call RestSharp or iHttpClientFactory to create sockets, but Epicor could use dependency injection to make it more efficient by pooling connections to the same target. I dont’ think we can do that with Functions or Directions. Can we?

One could also add some resilience capabilities (via Polly) through the widget to make those connections friendlier to network or service disruptions.

I haven’t added an Epicor Idea yet. I wanted to get your opinions first. Thoughts?

season 3 wall GIF

Part of me wonders if Invoke Workato Recipe is enough?

1 Like

Do we need a connector for each destination then? :thinking:

I’m thinking about freight services, map services, weather services, etc.

I was pondering something similar recently while working with my new console stuff.

I believe for most folks needs, we shouldn’t see socket exhaustion with httpclient, but if someone is doing a buttload of IO, we could.

I think RestSharp may have some mitigations for this issue, but I might have dreamed that.


BTW, on another note, I can’t get HTTP client to behave in a epicor function where I create more than one request. I had to switch to RestSharp.

1 Like

Probably it wouldn’t be cheap

1 Like

Can we use HttpClientFactory ?

1 Like

Could we add resiliency in HttpClientFactory like we’d get with Workato? Maybe @Olga could shed some light on this. :thinking: Just wondering if it’s worth an Idea or not.

1 Like

I wouldn’t mind a helper / pool that could be called from functions, both code and widget.

Not sure exactly what to write up, but having epicor on the base level providing it would be great.

Issue gone.

1 Like

And I wonder if the socket pool is smaller in containers?

1 Like

Yes, but I’m still wondering if it will help at all. (the factory)

It’s still standing up multiples, but it works a little differently in the timeouts and handler setup. I’m trying to read and understand if it would help mitigate the issue (not solve).

I don’t do a lot of heavy IO like this, so a lot of this is unfamiliar.

A lot has also changed in the use and implementation of HTTPClient in the last few years as well.

Is not Polly is already part of http factory? I don’t remember.

As for containers you will have to allow outgoing calls to that site too

1 Like

If I read this correctly, it seems you can if you do dependency injection but I don’t think we have access to the Builder to do that. To set that up, a widget might be useful, at least that was my thought.