I need to create asynchronous message queues dynamically in Java. My use case is sending email via multiple SMTP servers: I need to enforce that emails to the same SMTP server are processes sequentially, but emails to different SMTP servers may be processed concurrently. I've used JMS in the past, but as far as I can see it only allows for compile-time queue creation, whereas I need to create queues at runtime (one queue for each SMTP server).
Am I missing something regarding JMS or is there some other tool/proposal which I should have a look at?
I agree with Adam, the use case sounds like JMS is overhead. Java built-in functionality sufficient: