Hi, I am trying to make a simple solution to recei...
# suitescript
m
Hi, I am trying to make a simple solution to receive all requests from our customer's system in a queue, rather than giving them several endpoints. We will create the RESTlets as usual, but we won't give them the link, instead we will create a custom record, like:
Copy code
id
action
json_body
status
error
and one RESTlet to receive everything, that will just save the requests to that record. Then, with a scheduled script, we loop over them, and call the RESTlets with the JSON bodies. What do you think?
b
the usual is to have a restlet that creates the custom records. and a map/reduce to process the records
m
didn't use map/reduce before... do you have a sample?
b
dont use a restlet to also process the records, you wont be able to easily authenticate with it with serverside scripts
as usual, check the help for examples
m
@battk got it, thanks šŸ™
k
• You should consider Concurrency cost, • Restlet Governance units • time of creation and MR processing time
s
there are better queueing systems than NetSuite you could consider.
m
@Kevin
Concurrency cost
The client already uses a fixed number of workers to send the requests.
RESTlet Governance
I will use map/reduce as battk said, or you mean there is a limit on the number of requests it can receive, even within the concurrency limit?
time of creation and MR processing time
Not sure what do you mean... the requests will take time to get processed yes, it is a necessary tradeoff I guess.
@Shawn Talbert You mean an external one?
I think the client won't pay for that.
k
Marwan - I would say, let restlet to receive batch size that can handle sufficient to Governance and then let Map/Reduce to handle it.
m
@Kevin what if it wasn't sent as patches? Anything could go wrong?
k
if then Restlet will end up throwing Governance limit out
s
Yes, I mean external queueing. Some cloud providers have 'free' tier that might meet your needs. One nice thing about an external queue is you can use it to (async) notify the processing result as well as being a queue for the data to process. There are also lots of client support for these queues, but it is an external system to think about.
My main point is to avoid assuming NetSuite as the only option for containing ALL your technical NetSuite solutions.
m
Got it, thanks, will keep it in mind. ā¤ļø šŸ™