For larger JMS deployments what are your best practice suggestions for naming conventions?
Currently we're following the suggestions in the Sun Developer Network Blueprints. For example:
jms/<resource-name>[Queue|Topic]
I am concerned about scaling this as we get more and more queues and topics in the system. I'm particularly interested in hearing about experiences using hierarchical naming and how people have decided upon their naming conventions.
Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized. Except for variables, all instance, class, and class constants are in mixed case with a lowercase first letter. Internal words start with capital letters.
A Topic forwards a message from the producer to many consumers at once. It's a broadcast. This is often called Publish-and-Subscribe (Pub/Sub) messaging. A Queue may also have many consumers, but it forwards each message to only one consumer.
Why use naming conventions? Naming records consistently, logically and in a predictable way will distinguish similar records from one another at a glance, and by doing so will facilitate the storage and retrieval of records, which will enable users to browse file names more effectively and efficiently.
In queue, you only have one receiver or consumer; unlike in topic where in you can have your message be disseminated to a number of subscribers. Also, in topic, the publisher has to be continuously active for a subscriber to receive the messages. Otherwise the message will be reallocated.
I would suggest something that incorporates corporate group, application and version information into a namespace hierarchy.
For example: jms/mygroup.myproject.version.resource.queue
This is useful if you have disparate technical groups using the same jms server cluster. Also it prevents "crosstalk" between different versions of the same application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With