-
Notifications
You must be signed in to change notification settings - Fork 77
Modified endpoint generateAndPublish to accept array of events #294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
65fc749
0136d8b
14a5f7f
2d55610
04c79e6
5566a4d
7870507
be8ff35
6d9aca4
1fdf99d
4a596e3
4c624e5
acb0c70
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,12 +192,12 @@ | |
@ApiParam(value = "eiffel event", required = true) @RequestBody final String body) { | ||
try { | ||
JsonElement inputBody = JsonParser.parseString(body); | ||
return send(msgProtocol, userDomain, tag, routingKey, inputBody); | ||
Check warningCode scanning / CodeQL Information exposure through an error message Medium Error information Error loading related location Loading |
||
} catch (JsonSyntaxException e) { | ||
String exceptionMessage = e.getMessage(); | ||
log.error("Unexpected exception caught due to parsed json data", exceptionMessage); | ||
log.error("Cannot parse the following JSON data: " + body, exceptionMessage); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Separate the JSON data from the rest of logs: ... data:\n" + body + '\n' There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
return createResponseEntity(HttpStatus.BAD_REQUEST, JSON_FATAL_STATUS, | ||
"Invalid JSON parse data format due to: " + exceptionMessage); | ||
"Invalid JSON data:" + exceptionMessage); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A space missing after ':'. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
} | ||
} | ||
|
||
|
@@ -254,8 +254,8 @@ | |
|
||
try { | ||
JsonElement bodyJson = JsonParser.parseString(body); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should JSON parser be configured as in case of Generate service, i.e. not allowing duplicate keys, etc.? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah can do this but why we need this here? Is it necessary if already there is check for correct event publishing means like incorrect event is not published on mb basically There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, so we have the check in generator, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes that duplicate key check we implement basically in generate |
||
return generateAndPublish(msgProtocol, msgType, userDomain, tag, routingKey, parseData, failIfMultipleFound, | ||
failIfNoneFound, lookupInExternalERs, lookupLimit, okToLeaveOutInvalidOptionalFields, bodyJson); | ||
} catch (JsonSyntaxException e) { | ||
String exceptionMessage = e.getMessage(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use exceptionMessage at line above. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
log.error("Unexpected exception caught due to parsed json data", exceptionMessage); | ||
|
Uh oh!
There was an error while loading. Please reload this page.