Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suggestions for JMS Queue and Topic naming conventions

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.

like image 802
BenM Avatar asked Oct 27 '09 14:10

BenM


People also ask

What should be the naming convention for methods?

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.

What is the difference between queue and Topic in JMS?

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 do we use naming conventions?

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.

Is Topic same as queue?

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.


1 Answers

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.

like image 137
Dave Jefferson Avatar answered Oct 03 '22 02:10

Dave Jefferson