activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: Newbie Questions
Date Thu, 01 Feb 2007 17:27:27 GMT
On 1/26/07, saleem145 <> wrote:
> Hello,
> I am trying to build a very simple finance application. I would like to use
> a message bus to broadcast stock prices. The publisher would connect to an
> exchange, get the prices and publish them onto the message bus. The
> subscribers would connect to the message bus and read stock prices of it.
> The publishers would work all the time, but the subscribers may or may not
> be active. If they are not active, then I would just like the latest quote
> to be cached and the older ones removed from the queue. Also the publishers
> and subcribers would work asyncronously.
> The messages would have the following format --
> 1. TimeStamp
> 2. Stock Ticker
> 3. Bid
> 4. Ask
> On the subscription end, I would like to be able to have a command which
> looks for a price of a particular stock ticker. For example, Fetch("IBM",
> "Bid") and this should return the latest bid price.

For this part, enable last image caching on your price topics and use
retroactive consumers

then anyone subscribing to a price topic will immediately receive the
last price message. Then to implement your 'Fetch' just wrap up the
creation of a consumer, wait for the first message, then close the
consumer down again in a helper function

> So the requirements are quite simple. Would ActiveMQ be suitable for such a
> project.


> I need details on how does ActiveMQ works.
> 1. I presume ActiveMQ will be installed and run on a dedicated machine. My
> publsher will need to connect to ActiveMQ and send it messages. Upon receipt
> of messages ActiveMQ will store the messages in files since they need to be
> persistent (I do not need queueing). Receivers will connect to ActiveMQ and
> it will respond with appropriate answers. Is my understanding correct??


> 2. Is there a way in ActiveMQ, to specify if messages should be persistent
> and how long they should persist.

This is a JMS question - you decide in the producer of a message
whether or not its persistent via JMS's setDeliveryMode on

> 3. Can queueing be disabled.

Again a JMS question. Yes - just use a Topic rather than a Queue as
the destination

> 4. Is there a way to view and manage the different queues graphically??

Yes, see the Web Console or JConsole in the JDK

> 5. How will it locate the appropriate file fast -- will I need to create a
> seperate queue for each equity??

ActiveMQ can deal with things for you - just create a new Topic for
each equity (if you want folks to be able to subscribe to that kind of

> 6. If so, what if the names of all possible equities is not known in
> advance?? Each time I have a new equity will I need to make changes, or will
> it be able to handle it automatically.

ActiveMQ can handle you creating topics or queues dynamically at runtime.

> 7. Which is the best Open Source Message Bus for my needs??

ActiveMQ! :)



View raw message