messageQueue.producer.putText: Put a text message on a queue

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

For a producer bound to a queue, put a text message into that queue.

Usage

1
status <- messageQueue.producer.putText(producer, text)

Arguments

producer

The producer object created from messageQueue.factory.getProducerFor

text

The text message to put onto the queue

Details

.

Value

Returns a positive number (i.e. > 0) if it was successful. Returns a negative number (i.e. < 0) if it was unsuccessful.

Note

.

Author(s)

Matt MacGillivray

References

.

See Also

messageQueue.factory.getProducerFor

Examples

 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)

messageQueue documentation built on May 2, 2019, 4:45 p.m.