Create a Producer

put

/producers/{producerName}

Create a producer with the name producerName.

Request

Path Parameters
Query Parameters
  • Optional.  Whether messages sent via the producer are required to be stored in persistent storage.  If present, the value must be persistent or non_persistent; default is persistent.  If the value is persistent, 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.
  • 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.

  • Optional.  Whether message IDs are set on messages.  If present, the value must be true or false; default is trueNote: The value of this parameter is a hint to the service, which may disregard the value.
  • Required.  The name of the session in which to create the producer.
  • 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 is maximum.  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 value maximum indicates that the maximum time-to-live allowed by the service (the number of milliseconds in 2 weeks) should be used.
Back to Top

Response

201 Response

Producer created.

400 Response

Error Codes

  • missingParameter: The connection 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 than true or false.
    • 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.
  • sessionParameterNotFound: The session by which to create the producer does not exist.
  • destinationParameterNotFound: The default destination specified for the producer does not exist.
  • timeToLiveTooLarge: The ttl 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.
Back to Top

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