REST interface ...is exceeding the 65535 bytes limit

REST interface ...is exceeding the 65535 bytes limit

Hello,I have design an REST interface for an sql db. After the 22 URI for the rest interface, I receive the following error: The code of method tRESTRequest_1_LoopProcess(Map<String,Object>) is exceeding the 65535 bytes limit.I think I need to split the rest interface, but I cant set second rest interface in job. I can create a second job with an rest interface over an other ports, but this solution is not so nice.Have anybody an other solution?Greets Benjamin

Re: REST interface ...is exceeding the 65535 bytes limit

The first thing to try is to use childjobs (jobs run using the tRunJob component) in your REST service. It sounds like you have a lot of components in your service to handle the 22 URIs. You should be able to package each of the URI processing paths into child jobs. Doing this will massively reduce the amount of code in your service.

Re: REST interface ...is exceeding the 65535 bytes limit

Can some parts in your URIs be captured as templates ?Example, instead of/1/2/a/1/3/aetcdo/1/{id}/aand then have an 'id' variable in a schema.Another option to try is to capture several segments with regular expressions:/1/{id:.*}in this case 'id' will capture either 2/a or 3/aSergey

Re: REST interface ...is exceeding the 65535 bytes limit

Hang on, are you trying to run this from the Studio? It sounds like you are trying to run the service from the Studio and that maybe why you are feeling limited. You can create a service for each URI (in my opinion that would be better) and have them all running with the same port in Apache Karaf (the Runtime). When running in the Studio you really are limited.

Re: REST interface ...is exceeding the 65535 bytes limit

I would recommend putting a local version of Karaf on your development machine and creating a kar file for every service you want to provide. This way you can have them all running in karaf together and test other components with them using the Studio. There is also the issue of Talend Studio not being a perfect copy of the Karaf environment. You will find that some things that work on Studio will not work the same in Karaf (and vice versa). The development lifecycle of a Talend service/route should be to build it on the Studio and then move it to test in the Karaf. Then keep your successful routes and services in your local Karaf so that you can test new routes and services being built in Studio with the ones running in Karaf. It's a bit fiddly, but makes life a lot easier in the long run.

Re: REST interface ...is exceeding the 65535 bytes limit

OK, so if your single service currently has an endpoint like below...http://myservices:8090/services/mydbservices...and your HTTP request URIs are something like..../select/insert/update....you could try something like this. Create 22 web services each with an endpoint that includes the HTTP request URI. Like below...http://myservices:8090/services/mydbservices/selecthttp://myservices:8090/services/mydbservices/inserthttp://myservices:8090/services/mydbservices/updateYes, this will mean more services, but it is arguably better to decouple your functionality. 22 different requests in a single service is a bit much to be honest. This way you can keep you endpoints consistent and won't have an issue with size.