Event exception when curl response is text


#1

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)


#2

Response from above endpoint needs to be JSON. Could you confirm if that’s the case?


#3

@asingh was this fixed in the latest 6.0 release?


#4

Hi,

6.0 was very short release for Eventing after 5.5. We GA-ed Timers as part of 6.0 release. cURL is still in DP in 6.0.

That said, cURL is being worked on now and we’re planning to GA it in next server release, along with few other customer asks - source bucket mutations, from prior deployment feed boundary, feeds and couple of others features. If you would be interested, we could share a developer build in few weeks timeframe with revised cURL implementation.

Thanks,
Abhishek