|
Activating and Deactivating Routes Environment VariablesMost administrative tasks described here use two environment variables:
NOTE: UNIX commands in this guide were written for the Creating Queues and TopicsCreating a dropbox for a queue or topic is as easy as creating a handful of directories in the
shared
Here is how to create a queue called
Or a queue called
Message RoutingDropboxMQ messages can be routed from one destination to another or simply routed to a holding
location and consumed later. Routes are listed in a Example
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
route1.selector=JMSPriority < 200 and JMSReplyTo \= 'ReplyQueue1'route2.selector=JMSType in ('WorkOrder', 'ManifestDoc', \ 'CatalogQuery') |
When an active route has been selected, messages are moved to that route's directory. This
directory is located in the routing directory of the dropbox and has the same name as
the route defined in the routing.properties file. On UNIX file systems, this
directory can actually be a symbolic link to another dropbox's target directory
thereby causing messages to be routed from one dropbox to another.
Once the route's selector is defined and the route's directory is in place, the route is ready to be
activated. To activate a route, simply create an in-use file in the routing directory
with a filename of the form {route-name}.in-use. The following example shows how to
activate route1 for TestQueue1:
|
To deactivating a route, remove the in-use file:
|
DropboxMQ has several mechanisms for controlling if and how quickly messages are produced and consumed. It is important to note that these mechanisms are only implemented by DropboxMQ clients. Shell scripts or other non-JMS clients sending and receiving messages will not be affected by these locks and controls.
Note: If any flow mechanisms are active, any affected DropboxMQ client will log a warning message once every five minutes per affected producer/consumer.
The Global Read Lock, when in place, prevents all consumers from consuming messages. All DropboxMQ consumers that attempt to consume messages when the lock is place will behave exactly as though no messages exist.
To create the Global Read Lock:
|
To remove the Global Read Lock:
|
Local Read Locks also prevent consumers from consuming messages, but these locks only affect consumers for a single destination.
To create a Local Read Lock on the TestQueue1 queue:
|
To remove a Local Read Lock on the TestQueue1 queue:
|
Write Lock Properties control if a producer attempting to send a message to a particular destination will be permitted to do so and if there will be any delay in doing so. Write locks can be dangerous because they can cause a DropboxMQ client to hang for an indeterminate amount of time. There are two values that can be specified in the Write Lock Properties:
| Name: | delay-milliseconds |
| Type: | long |
| Default: | -1 (indefinitely) |
| Example: | 8000 (8 seconds) |
Specifies how long a producer will wait before being permitted to send a
message. If -1 is specified, the producer will wait indefinitely or until the
target-limit requirement is met. |
|
| Name: | target-limit |
| Type: | int |
| Default: | 0 |
| Example: | 1000 |
Specifies the maximum number of messages that can be waiting on a destination.
If fewer than this number of messages are waiting in the target directory, any
message will be sent without delay (regardless of the delay-milliseconds
value). If 0 is specified, each message will be delayed by the time specified
in delay-milliseconds (or indefinitely if delay-milliseconds is
-1). |
|
If the property file doesn't exist, messages are not delayed at all. If the property file exists,
but no properties are defined, messages will be delayed indefinitely (values default to
delay-milliseconds of -1 and target-limit of 0). This means
that all messages producers of a particular destination can be quickly locked out by simply
touching a write-lock.properties file similarly to how read-locks are
created.
To create a Write Lock Properties file on the TestQueue1 queue specifying an 8 second delay when more than 1000 messages exist:
|
To remove a Write Lock Properties file on the TestQueue1 queue:
|
NOTE: UNIX commands in this guide were written for the /bin/sh shell and its
derivatives.