Nueva publicación

Encontrar

Pregunta
· 18 mayo, 2025

REST API Issue

I have a rest API Class used for getting data from Cache 2018 version.
I have single route '/callfuntions'
I send the following parameters to the API :-  className, methodName, params
I use $CLASSMETHOD to execute and send the result back to the client.

If I make more that 10 to 12 requests in quick succession, then it stops sending data.

if I wait for over 10 seconds it allows me to send more requests to the API.  How do I resolve this?

3 comentarios
Comentarios (3)2
Inicie sesión o regístrese para continuar
Job
· 18 mayo, 2025

Do you have any openings for InterSystems developer Job

I am writing to express my interest in the "IRIS Ensemble Integration . I have 2 years of experience as an Ensemble IRIS Developer, working with Ensemble and IRIS for integration, server management, and application development. Looking for more opportunites to work under Iris Cache Objectscript

2 comentarios
Comentarios (2)2
Inicie sesión o regístrese para continuar
Pregunta
· 16 mayo, 2025

WSGI Flask application in IRIS Container - Where do packages need to be installed?

I'm trying to deploy a python/flask application to an Iris4Health container (2025.1) but running into some issues with packages and where they should be installed. 

First one if the flask packages themselves. I tried to installed the flask packages into the python external language server virtual environment, but even doing this when configuring the WSGI application in the web application section, it would complain about not having a WSGI framework. Once I created a custom container and added the flask package at the OS level, I was able to configure the web application without it complaining.
QUESTION: Is this the preferred method for adding the flask framework? (Creating a custom container with docker build using the iris2025.1 container as the base)

Second, once the flask application is running, what is the preferred method for adding packages. ex: flask-sqlalchamey, flask-session,etc  (that the flask would use)? Again, I tried adding these to the virtual python environment that iris creates (/dev/python/virtual/%Python Server_3252368016$) and then activating the venv and adding package using pip install in the venv.
I did this, but the flask application generates an error that it cannot find the packages... Are you supposed to add these packages the same way, in the base OS images via a docker build command?

Any help with this would be appreciated. i know that the WSGI stuff is listed as "experimental" but seems like this is a better way to host web apps

4 comentarios
Comentarios (4)2
Inicie sesión o regístrese para continuar
Pregunta
· 16 mayo, 2025

%JSON.Adaptor compilation issues under array-of-streams and computed property types

For background, I've developed code that relies on %JSON.Adaptor functionality across an entire package of classes in our codebase. In regenerating these classes with %JSON.Adaptor as a superclass, I've encountered compilation errors from the JSON adaptor generators in certain classes, triggered by certain property types or parameters that are incompatible.

There are two causes for these compilation errors: either 1) the property is computed, and therefore certain property methods in the code generated by the JSON adaptor, such as ..SetObjectId(), do not exist, or 2) the property is an array of streams, which is explicitly unsupported by the generator and will throw an error early in the compilation process, effectively rendering that class incompatible with %JSON.Adaptor use.

For issue 1), the workaround I found is to setting the property parameter %JSONINCLUDE = "none", which will exclude that property from the %JSON.Adaptor generator. Fortunately for now, this workaround suffices, but it also seems like it would useful for the generator to directly avoid generating property methods that do not exist.

For issue 2), there is an explicit condition that checks for an array-of-streams property and quits with an error in %JSON.Generator:GenerateMapping, which is called early in the code generation process. 

I tried circumventing this check with different parameters and settings, including %JSONINCLUDE, but to no avail. My workaround has been to set the class parameter %JSONENABLED = 0 to disable the method generation entirely for that class and manually define the adaptor methods that would normally be generated. Of course, this is suboptimal in terms of consistency and maintainability.

First, I'm curious if anyone else has encountered this and has a better workaround to deal with it in the short term.

Second, it seems that the JSON Adaptor would be a little more robust if it excluded the array-of-streams properties without throwing an error during compilation, or at least allowed %JSONINCLUDE to control whether an array-of-streams property is included, like it does for other property types. This would allow the JSON adaptor logic to be generated for the rest of the class properties even if the class contains an array-of-streams property, something that I have not found possible currently. 

Of course, there may also be good reasons for the current behavior, so if anyone from the IRIS team can provide more insight on the existing design of %JSON.Adaptor, the feasibility of updating it, or any workarounds, I'd be interested in hearing your thoughts. 

2 comentarios
Comentarios (2)2
Inicie sesión o regístrese para continuar
Comentarios (0)1
Inicie sesión o regístrese para continuar