Reputation: 5770
I am developing a webapp using Spring and there are several other apps that are influenced by the information generated in mine. Basically they want to know when a change has been made in the data I manage. This data can be filtered by a certain A property.
Since the number of apps to "subscribe" to this information is variable, I thought about implementing a JMS publisher/subscriber model in which I create queues according to the filtering A property and then notify of changes to that queue. All subscribers would then receive the notification through their JMS listeners.
Is this scenario even possible? That is, can I embed a JMS queue in my Spring webapp (how?) and can I create these queues dynamically (i.e. I create queues for my A catalogue, then if a new element gets added to that catalogue, a new queue should be created dynamically without human intervention). Or is there any better solution to create this filtering functionality?
Upvotes: 4
Views: 3884
Reputation: 22374
You can use selectors (by property A) instead of creating queue:
http://www.coderanch.com/t/499633/Spring/Configure-Spring-JMS-message-selector
http://docs.oracle.com/cd/E19798-01/821-1841/bncer/index.html
For dynamic queue, see Creating temporary JMS jms topic in Spring
http://docs.oracle.com/javaee/1.4/api/javax/jms/TemporaryQueue.html
Upvotes: 1