I am posting to the Active MQ REST API which is returning a plain text “Message sent” response, which indicates success. This appears to be causing an exception in the Event logs, which is expecting JSON. I have tried altering the headers to accept plain text with no luck.
Curl:
var response = curl(“http://admin:admin@localhost:8161/api/message?destination=queue://print”, {
method: “POST”,
header: [“Content-Type: application/json”],
data: doc
});
log(‘curl’, response);
Event Log:
2018-10-08T20:13:31.110-07:00 [INFO] “document” {“seqStart”:0,“seqEnd”:0,“snapStart”:17,“snapEnd”:17,“failOverLog”:[[33482003417536,0]]}
2018-10-08T20:13:31.123-07:00 [INFO] OnUpdate Exception: undefined:1
2018-10-08T20:13:31.123-07:00 [INFO] Message sent
2018-10-08T20:13:31.123-07:00 [INFO] ^
2018-10-08T20:13:31.123-07:00 [INFO] SyntaxError: Unexpected token M in JSON at position 0
2018-10-08T20:13:31.123-07:00 [INFO] at OnUpdate (case_end.js:9:32)