@@ -156,6 +156,14 @@ public ResponseEntity send(final String msgProtocol, final String userDomain, fi
156
156
return new ResponseEntity (e .getMessage (), HttpStatus .NOT_FOUND );
157
157
}
158
158
}
159
+
160
+ //here add check for limitation for events in array is fetched from REMReM property and checked during publishing.
161
+ if (body .isJsonArray () && (body .getAsJsonArray ().size () > maxSizeOfInputArray )) {
162
+ return createResponseEntity (HttpStatus .BAD_REQUEST , JSON_ERROR_STATUS ,
163
+ "The number of events in the input array is too high: " + body .getAsJsonArray ().size () + " > "
164
+ + maxSizeOfInputArray + "; you can modify the property 'maxSizeOfInputArray' to increase it." );
165
+
166
+ }
159
167
synchronized (this ) {
160
168
SendResult result = messageService .send (body , msgService , userDomain , tag , routingKey );
161
169
log .info ("HTTP Status: {}" , messageService .getHttpStatus ().value ());
@@ -310,8 +318,8 @@ public ResponseEntity generateAndPublish(final String msgProtocol, final String
310
318
//here add check for limitation for events in array is fetched from REMReM property and checked during publishing.
311
319
if (bodyJsonArray .size () > maxSizeOfInputArray ) {
312
320
return createResponseEntity (HttpStatus .BAD_REQUEST , JSON_ERROR_STATUS ,
313
- "The number of events in the input array is too high: " + bodyJsonArray .size () + " > " + maxSizeOfInputArray + ", " +
314
- "You can modify the property 'maxSizeOfInputArray' to increase it" );
321
+ "The number of events in the input array is too high: " + bodyJsonArray .size () + " > "
322
+ + maxSizeOfInputArray + "; you can modify the property 'maxSizeOfInputArray' to increase it. " );
315
323
}
316
324
for (JsonElement element : bodyJsonArray ) {
317
325
if (element .isJsonObject ()) {
0 commit comments