Forum Discussion

Henchway's avatar
Henchway
Contributor
5 years ago

Settings a HTTP response code for triggered tasks

Hi everyone,

we’re offering a triggered task as a sort of simplified API for a more complex REST API (specifically Jira).

What we want to achieve is to influence the HTTP return code, status and message we deliver back to the caller of the triggered task based on the return result of the REST API.

Here’s a brief description for context:

Assuming there’s an error in the Jira Search snap, the error will bubble up to the pipeline execute snap, which in turn triggers the attached error pipe of the template pipe.
This will ensure that the error is correctly logged, however, the response to the caller of the triggered task will be 200 in any case.

I’m unsure of 2 points:
Where is the response formed and delivered back to the caller? At the Error pipe or already somewhere before that?
Is there any way to influence what is delivered back to the caller? Ideally we’d like to implement a solution in the template pipeline for e.g. common response codes, but want to refrain from having to implement ‘repsonse code conditionals’ in every integration pipeline.

Any suggestions are highly appreciated!

Thanks and best regards
Thomas

7 Replies

  • winosky's avatar
    winosky
    New Contributor III

    This is awesome @koryknick, this sheds some light. I’m going to assume the JSON Formatter snap is also in that list as that was the one that did it for me. Although I do also have a gate snap but the plex didn’t started falling over until I added the JSON Formatter so it sounds like a combination of memory intensive snaps.
    Now that I think about it, it might not even be just memory intensive snaps but enough snaps to cause the heap size to go over it’s limit.
    Fortunately I found a better alternative but I’m interested if you developed a method into determining ways to throttle read snaps or is throwing ram at the plex your conclusion?
    Thanks