You can configure the producer and the consumer in the Java example in a number of
different ways by passing -D plus option flags to the clients at
runtime, as shown:
ant consumer -Durl=tcp://hostname:1234 -Dtopic=true
You can configure both the consumer and the producer by passing them the following properties.
url
Used to specify a custom URL for the broker. For example,
tcp://hostname:1234.
topic
A boolean to determine whether to use topics or queues. Defaults
to false.
subject
Used to specify a custom destination. For example, MyQueue or MyTopic.
durable
A boolean to specify that you want to create a durable topic.
Defaults to false.
max
The maximum number of messages to be produced or consumed before the client shuts down.
transacted
A boolean to specify whether transactions should be used. Defaults
to false.
sleepTime
The time to wait between message consumptions.
verbose
Used to print out more information. Defaults to true.
When running the consumer, you can also pass in the following arguments:
clientId
A string used to identify the client.
ack-mode
Sets the type of acknowledgement to use. See the JavaDoc for java.jmx.Session for
details.
receive-time-out
An integer that specifies the time to wait until the message is consumed.