Closes and releases memory reserved when this producer was created.
When a queue producer is created, objects are created in the background and exist for the lifetime of that producer. Explicitly closing the producer safely deallocates memory and restores natural order to the world.
status <- messageQueue.producer.close(producer)
The producer object created from
Returns a positive number (i.e. > 0) if it was successful. Returns a negative number (i.e. < 0) if it was unsuccessful.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
# NORMALLY, this url would be of the form 'tcp://host:61616', but for testing, activeMQ provides # a local/internal queue that works by default queueUrl <- "vm://localhost?broker.persistent=false" # create a queue producer queueAproducer <- messageQueue.factory.getProducerFor(queueUrl,"queueA","activeMQ") # ... do some stuff ... # put a message on the queue textMessage <- "this is the message I want to send" status <- messageQueue.producer.putText(queueAproducer, textMessage) # close the producer status <- messageQueue.producer.close(queueAproducer)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.