Description Usage Arguments Details Value Note Author(s) References See Also Examples
Make a connection to a queue for writing.
The queue can be on a local, or remote host. It is important to know what type of queue it is as the underlying implementation details are different. Currently, only 'activeMQ' and 'rabbitMQ' are supported.
All connections should be closed when no longer needed.
1 | queueAproducer <- messageQueue.factory.getProducerFor(url, queue, queueType)
|
url |
URL to the machine hosting the queue in the format 'tcp://<hostname>:<port>' |
queue |
Name of the queue (and/or topic) to connect to on that host. The format of this is dictated by the queue type you are connecting to. |
queueType |
What type of queue provider are you connecting to? Required because each queue type functions differently under the covers. Supported Values: 'rabbitMQ' or 'activeMQ' |
.
If successful, this method returns an object representing a producer for a queue. If unsuccessful, this method returns null.
.
Matt MacGillivray
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # 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.