Search the Community
Showing results for tags 'mars'.
Found 8 results
-
How to access database for doing additional task in a separate thread in MARS
ertank posted a topic in MARS-Curiosity REST Library
Hello, There are some chain requests triggered from clients. Some requests among them takes time processing on the server side. I should send a response to client fast. Server side operations are not relevant to the response. Since, MARS is handling each request in a separate thread, I also created a custom thread for this time consuming operation and process it. My problem is, database context is removed as soon as response is sent and its thread is destroyed. Any further database operations from that point in my custom thread results in access violation. Is there a way that I can get a database connection from MARS database pool for my own custom threads independent of requests? Thanks & Regards, Ertan -
Hello, I have a company that would like to send me some data over a webhook. They want me to provide them access information for an x-api-key header. I know that MARS uses Authorization header for secure access. I am not sure if it is possible to support x-api-key header for a specific use case. Any help is appreciated. Thanks & Regards, Ertan
-
How to automatically delete temporary files using MARS
ertank posted a topic in MARS-Curiosity REST Library
Hello, MARS file serve samples are based on fixed static data (ContentTypes demo). I have several endpoints serving dynamic data in ZIP files. When upload finishes on the server side, remaining temporary files are kept on disk. This become a problem on server systems in time. I would like to learn if it is possible to have MARS delete them automatically at the end of the communication. I will write my own thread but asking before just in case. Thanks & Regards, Ertan -
Hello, I normally use UniDAC with MARS. This time, I have to use FireDAC and I am not used to FireDAC at all. I checked MARS demo applications to prepare my INI file as below: [DefaultEngine] Port=8085 ThreadPoolSize=100 FireDAC.MAIN_DB.DriverID=FB FireDAC.MAIN_DB.Database="D:\rest_server\SAMPLE.FDB" FireDAC.MAIN_DB.User_Name=SYSDBA FireDAC.MAIN_DB.Password=mypassword FireDAC.MAIN_DB.Protocol=TCPIP FireDAC.MAIN_DB.Server=localhost FireDAC.MAIN_DB.Pooled=True FireDAC.MAIN_DB.POOL_MaximumItems=100 FireDAC.MAIN_DB.TxOptions.Isolation=xiReadCommitted When server tries to establish a database connection, client receives below error: Internal server error: [EFDException] [FireDAC][Stan][Def]-254. Definition [MAIN_DB] is not found in [] Server EXE is built as a windows service application. Fbclient.dll file with correct bitness and version is in the same directory as my EXE file. I have following in my code to make sure MARS uses certain definition in INI file. [Connection('MAIN_DB'), Path('token')] TTokenResource = class(TMARSTokenResource) Any help is appreciated. Thanks & Regards, Ertan
-
MARS running as Indy standalone Windows Service, correct cert locations
marcovaldo posted a topic in MARS-Curiosity REST Library
Hi All, Sorry for duplicating information! I repostet under new Topic for better visibility. May this save others the days I lost... CERTIFICATE LOCATIONS FOR WINDOWS SERVICE DIFFERENT TO WINDOWS APPLICATION! (at least on Win10/Pro as I have) : the cert files (supposed to be in bin/executable folder) MUST BE IN C:\Windows\SysWOW64\ folder also a cert.pem is queried from C:\usr\local\ssl\cert (i copied the root cert to this name, however not sure if necessary) so if sticking with Indy default names, the files are: C:\Windows\SysWOW64\localhost.pem root cert C:\Windows\SysWOW64\localhost.crt cert C:\Windows\SysWOW64\localhost.key key Selfsigned cert OK (created using XCA) For copying to this folder, of course Admin rights are necessary. If you are using a VMWare VM for Delphi 10.4.X, as I do, and the project files are in the shared VM drive outside the VM, you need 2-step copy: 1) project/bin to local desktop 2) local desktop to SysWOW64 All the above is for WIN32 Service target, as I did not tryout X64 yet. I am happy to be out of the swamp and back on the road (after fighting Windows and not Project) Kind Greetings, ckranich- 7 replies
-
- indy service
- mars
-
(and 1 more)
Tagged with:
-
Hello, There is that custom build old DataSnap application. It works with Firebird database and only provides 3 methods; GetData, ExecuteQuery, SwitchDatabase. Their use is as their names indicate. All of the methods are called in a single long URL such as datasnapserver/GetData/SELECT * FROM EMPLOYEE That returns SQL result as JSON string. Other 2 methods simply return True/False and error message if False. As the nature of the GetData method, it sometimes gets quite long and complicated URL including all that JOINs, WHERE and conditions added. I wonder if similar can be done using MARS, and have it handle returned data to be filled in a memory table. This maybe a long shot, but I also would like to put all these SQLs in body of the GET request, if such a thing is possible. Thanks.
-
Hello, When I check GitHub there are several version tags in it, and there is trunk. I wonder if it is safer to use these version tags? Thought they seem to be replaced in time, do they receive patches? For the record, I am using Delphi 10.3.1. Thanks & regards, Ertan
-
Overriding the JWT_SECRET_PARAM_DEFAULT & JWT_ISSUER_PARAM_DEFAULT
Stuart Clennett posted a topic in MARS-Curiosity REST Library
Hi, Does anyone know the required steps to override the JWT params defaults for SECRET and ISSUER please? I can see they seem to need to be in the Activation.Parameters... but I'm not sure how to get them in there? Thanks in advance, Stuart