Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6042201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:45:50+00:00 2026-05-23T06:45:50+00:00

We have ActiveMQ onto which the events that happen in the system are published.

  • 0

We have ActiveMQ onto which the events that happen in the system are published. The project involves users adding entities to their watch-list and whenever there are events on those entities I would like an email to be sent out to the interested participants.

The use-case roughly translates to some one expressing an interest in a product information page on the catalog and an email being sent whenever any activity happens on that product (price goes down, there is a positive review etc.,). I had modelled this interaction as a Camel route.

So, for example, if the user says email me whenever this product’s rating equals 5, then the following route would be added to the camel context:

from("activemq:topic:events.product.save").filter().xpath("/object[<object id>]/rating").isEqualTo("5").to("email:<user's email>")

Similarly if the user wants to be notified whenever there is a new comment on a product, another route would be created and so on. This could potentially, end up creating thousands of routes as each user starts adding their watches of interest.

Some questions that I have are:

  • Is this an acceptable way of creating dynamic routes? One option I am considering is to use recipient lists. But I haven’t been able to come up with a solution that would make it elegant to route messages to the bean that would return the recipient list. For example for the case explained above would the bean have a bunch of if-else to see which recipient list to return?

  • The camelcontext has a method to load routes from a xml file but no method to persist the existing routes. What would be simplest (and efficient) way to persist these dynamically created routes? This thread in the camel-users list sums up my request.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T06:45:50+00:00Added an answer on May 23, 2026 at 6:45 am

    Given the dynamic nature of your subscription requirements, you should use a database to store the information rather than trying to create dynamic routes. This is a much more scalable/appropriate use of technology…

    Then you can only need a single static route or a POJO consumer (see below) that can process the product update messages using a simple POJO bean (bean-binding can help, etc). The POJO bean would then be responsible for querying the database to find all “interested” users and send an email using camel-mail

    public class NotificationBean {
    
        @Consume(uri="activemq:topic:events.product.save")
        public void onUpdate(@XPath("/object/id") String id, 
                             @XPath("/object/rating") String rating) {
            //query database for subscriptions for this product ID/rating, etc.
            //for each interested subscriber
                //send email (camel-mail, etc)
        }
    
        public void addSubscription(String productID, Integer rating, String email) {
            //create/update subscription entry in database, etc...
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a system that uses ActiveMQ (Queues) - and have exactly one producer
I have a small Spring MVC webapp (which embeds ActiveMQ) that is designed to
Running ActiveMQ 5.4.0. I have a group of users that subscribe and publish to
I have a production system that uses ActiveMQ (5.3.2) to send messages from server
I have a message listener (using ActiveMQ) that implements SessionAwareMessageListener. When the onMessage(Message,Session) method
I have a simple Spring config for unit tests that includes ActiveMQ embedded broker,
I have an ActiveMQ JMS-to-JMS bridge, in which messages from a remote broker are
I have a .NET service that uses the ActiveMQ client. I have implemented a
I've found ActiveMQ that use for message broker and that's good for cross-platform Have
I have a system (let's call it System A) that allows the user to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.