Details
-
Bug
-
Status: Closed
-
Medium
-
Resolution: Done
-
Casablanca Release, Dublin Release
-
None
Description
From: Cillian O'Shea (Ericsson)
I want to ask you about this error we are getting from apex.
2018-10-20 22:18:37,733 [procId=processId_IS_UNDEFINED] WARN c.e.a.c.i.m.i.w.RawMessageHandler - Error while forwarding events for Apex-SonApexEngine:com.ericsson.apex.service.engine.main.ApexEventMarshaller:retOutputProducer-2:0
com.ericsson.apex.service.engine.event.ApexEventRuntimeException: send of event to URL "http://jboss:8080/son-om/cm-change/v1/changes" using HTTP "POST" failed with status code 201 and message "", event:
We are using a standard RestClient producer
"retOutputProducer": {
"carrierTechnologyParameters": {
"carrierTechnology": "RESTCLIENT",
"parameterClassName": "com.ericsson.apex.plugins.event.carrier.restclient.RESTClientCarrierTechnologyParameters",
"parameters":
},
"eventProtocolParameters":
,
"eventNameFilter": "ChangeEvent"
},
We are sending a 201 response back because it is the correct code as we see for a creation.
“If a resource has been created on the origin server, the response SHOULD be 201”
https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.5
My question is why does the apex only consider 200 to be a correct response?
From ApexRestClientProducer,
// Check that the request worked
if (response.getStatus() != Response.Status.OK.getStatusCode())
There are many other status codes that should be considered here also.
https://docs.oracle.com/javaee/7/api/javax/ws/rs/core/Response.Status.html