Ask Your Question

Customize REST Error Response???

asked 2019-01-30 09:15:47 -0500

daveh gravatar image

updated 2019-02-13 09:05:33 -0500

Is there a way to customize the REST Microservice Pipeline's error response. Our enterprise has a standardized error response that differs from the the one generated by StreamSets. Sure would be sweet to be able to generate our own response.



Pipeline screeny:

image description

Example of error response payload we would like to have the pipeline return when appropriate:

    “errors” : [
                    “code”: “XXXX”,
                    “message”: “Please enter valid pcID”,
                    “message_language”: “ENG”,
                    “message_language_locale”: “USA”,
                    “internal_code”: “26-10-8”,
                    “fail_count” : “1”

Where XXXX is the HTTP Code which could be a 522 for downstream processing issue or a 403 forbidden, etc. This response body then would replace the default one generated by the stages.

Thanks again.

P.S. sorry for late response.... TOO MUCH WORK!!!

edit retag flag offensive close merge delete


Can you give an example of one of your pipelines? I think there's a way to do this.

metadaddy gravatar imagemetadaddy ( 2019-01-30 10:24:09 -0500 )edit

Not sure how to provide example. I could upload the exported json, but not sure how to do that, as I don't see an 'attachment' link anywhere. Suggestions??? Thanks.

daveh gravatar imagedaveh ( 2019-02-01 14:56:30 -0500 )edit

Editing your question and adding a screenshot of the pipeline, with a bit more explanation of what you'd like to achieve would be great.

metadaddy gravatar imagemetadaddy ( 2019-02-01 15:29:29 -0500 )edit

Mr. metadaddy, I hope this helps

daveh gravatar imagedaveh ( 2019-02-13 09:05:59 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2019-03-15 19:52:24 -0500

metadaddy gravatar image

In StreamSets Data Collector 3.8.0 and later, you can use an Expression Evaluator to build the error response and enable 'Send Raw Response' in the REST Service origin to return the record 'as is'.

edit flag offensive delete link more


Roger that Mr. metadaddy, Will give a try when able and will advise back. Thx.

daveh gravatar imagedaveh ( 2019-03-25 09:56:21 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-01-30 09:15:47 -0500

Seen: 219 times

Last updated: Mar 15