@@ -357,6 +357,11 @@ public ResponseEntity generateAndPublish(final String msgProtocol, final String
357
357
mp = msgProtocol ;
358
358
}
359
359
360
+ String mt = null ;
361
+ if (!StringUtils .isEmpty (msgType )) {
362
+ mt = msgType ;
363
+ }
364
+
360
365
MsgService msgService = null ;
361
366
if (StringUtils .isEmpty (msgProtocol ) ||
362
367
((msgService = PublishUtils .getMessageService (msgProtocol , msgServices )) == null )) {
@@ -398,9 +403,9 @@ public ResponseEntity generateAndPublish(final String msgProtocol, final String
398
403
parsedTemplates .append ("[" );
399
404
for (JsonElement eventJson : events ) {
400
405
// -- parse params in incoming request -> body -------------
401
- if (!eventTypeExists (msgService , msgType )) {
406
+ if (!eventTypeExists (msgService , mt )) {
402
407
return createResponseEntity (HttpStatus .BAD_REQUEST , JSON_ERROR_STATUS ,
403
- "Unknown event type '" + msgType + "'" );
408
+ "Unknown event type '" + mt + "'" );
404
409
}
405
410
406
411
JsonNode parsedTemplate = eventTemplateHandler .eventTemplateParser (eventJson .toString (), msgType );
@@ -427,7 +432,7 @@ public ResponseEntity generateAndPublish(final String msgProtocol, final String
427
432
+ appendAttributeAndValue ("okToLeaveOutInvalidOptionalFields" , ensureValueNonNull (okToLeaveOutInvalidOptionalFields ));
428
433
429
434
ResponseEntity <String > response = restTemplate .postForEntity (generateUrl ,
430
- entity , String .class , generateURLTemplate .getMap (mp , msgType ));
435
+ entity , String .class , generateURLTemplate .getMap (mp , mt ));
431
436
432
437
responseStatus = response .getStatusCode ();
433
438
String responseBody = null ;
0 commit comments