Acknowledge, Commit, Rollback, or Recover a Session
post
/sessions/{sessionName}/state
Perform the specified operation. If the action is
acknowledge
or
recover
, and the session is set to acknowledge messages automatically (either with acknowledgement mode
auto
or
dups_ok
), this is a no-op. If the action is
commit
or
rollback
, and the session is not transacted, this is a no-op. If the action is
recover
and the session is transacted, a 500 error response is generated.Request
Path Parameters
-
sessionName: string
The name of the session.
Query Parameters
-
action: string
Required. The action to take on the session. It must have value
acknowledge
,commit
,rollback
, orrecover
. The value determines whether the operation is to acknowledge any unacknowledged messages received through the session, commit any uncommitted sends and receives, roll back any uncommitted sends and receives, or recover any unacknowledged messages.
Response
200 Response
Action completed successfully.
400 Response
Error Codes
missingParameter
:Theaction
parameter was not supplied.badParameter
:The value of the action parameter was notacknowledge
,commit
,rollback
, orrecover
.
404 Response
Error Codes
sessionNotFound
:The requested session does not exist.
500 Response
Error Codes
operationFailed
:A low-level exception occurred in attempting to execute the specified action.
Examples
cURL Commands
Create a transacted session.
cookie=/tmp/messaging-cookie curl -s -u $USER:$PASS -c $cookie -b $cookie \ -H "X-OC-ID-TOKEN-STATUS: disabled" \ -X PUT "https://messaging.us2.oraclecloud.com/myService-myTenant/api/v1/sessions/myFirstSession?connection=myFirstConnection&transacted=true"
There is no request body to submit with the HTTP request and there is no response body.
Commit the session.
cookie=/tmp/messaging-cookie curl -s -u $USER:$PASS -c $cookie -b $cookie \ -H "X-OC-ID-TOKEN-STATUS: disabled" \ -X POST "https://messaging.us2.oraclecloud.com/myService-myTenant/api/v1/sessions/myFirstSession/state?action=commit"
There is no request body to submit with the HTTP request and there is no response body.
Rollback the session.
cookie=/tmp/messaging-cookie curl -s -u $USER:$PASS -c $cookie -b $cookie \ -H "X-OC-ID-TOKEN-STATUS: disabled" \ -X POST "https://messaging.us2.oraclecloud.com/myService-myTenant/api/v1/sessions/myFirstSession/state?action=rollback"
There is no request body to submit with the HTTP request and there is no response body.
Back to Top