Create a Producer
/producers/{producerName}
producerName
.Request
-
producerName: string
The name of the producer.
-
deliveryMode: string
Optional. Whether messages sent via the producer are required to be stored in persistent storage. If present, the value must be
persistent
ornon_persistent
; default ispersistent
. If the value ispersistent
, the message must be stored in persistent storage; otherwise, it may or may not be stored in persistent storage. Messages in persistent storage can persist through outages or failover of the service. -
destination(optional): string
Optional. The destination to which all messages sent through this producer are sent. If present, the value must have one of the following forms:
/queues/
queueName/topics/
topicName/temporaryQueues/
queueName/temporaryTopics/
topicName
If this parameter is omitted, the producer is a "wildcard" producer; the destination to which a message is sent via such a producer must be specified as a parameter in each send operation performed via this producer. Wildcard producers may be used to send messages to multiple different destinations.
-
messageIdEnabled(optional): string
Optional. Whether message IDs are set on messages. If present, the value must be
true
orfalse
; default istrue
. Note: The value of this parameter is a hint to the service, which may disregard the value. -
session: string
Required. The name of the session in which to create the producer.
-
ttl(optional): string
Optional. The amount of time for which the message will be kept in the service if not received. If present, the value must be a strictly positive long integer or the value
maximum
; default ismaximum
. The value determines the time in milliseconds between when a message is dispatched and when the JMS broker may delete it if not yet delivered. The valuemaximum
indicates that the maximum time-to-live allowed by the service (the number of milliseconds in 2 weeks) should be used.
Response
201 Response
400 Response
Error Codes
missingParameter
: Theconnection
parameter was not supplied.badParameter
: One of the following occurred:- The
destination
parameter value did not parse as a specification of a queue or topic. - The
messageIdEnabled
parameter had a value other thantrue
orfalse
. - The value of the
deliveryMode
parameter did not parse as a delivery mode. - The value of the
ttl
parameter was not a valid time-to-live.
- The
sessionParameterNotFound
: The session by which to create the producer does not exist.destinationParameterNotFound
: The default destination specified for the producer does not exist.timeToLiveTooLarge
: Thettl
parameter was supplied, but was an integer that is larger than that permitted by the service (the number of milliseconds in 2 weeks).
409 Response
Error Codes
producerAlreadyExists
: A producer with the specified name already exists.
500 Response
Error Codes
operationFailed
: A low-level exception occurred in attempting to create the producer.
Examples
cURL Command
Create a "wildcard" producer which has an unspecified destination at creation allowing the send operation to specify the destination.
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/producers/myFirstProducer?session=myFirstSession"
There is no request body to submit with the HTTP request and there is no response body.
Create a producer with a specified destination meaning any send with this producer goes to that destination.
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/producers/myFirstProducer?session=myFirstSession&destination=/queues/myFirstQueue"
There is no request body to submit with the HTTP request and there is no response body.
Back to Top