Hello,
I have a little problem when using ActiveMQ's "Virtual Topic" feature
together with dynamically created/stopped Camel routes.
My scenario:
- My camel application offers a web service which other systems within the
company can use to subscribe/unsubscribe for messages that will be then sent
to them over a REST API.
- Camel manages all processed messages internally with an embedded ActiveMQ
broker.
- The other systems may disconnect from time to time (due to maintenance
work or failures)
- When a previously subscribed system reconnects after a shutdown, it should
get all messages that were processed during it's offline time.
My setup:
- The processed messages are sent to a Active MQ Virtual Topic
<http://activemq.apache.org/virtual-destinations.html>
- A self-implemented Manager bean dynamically creates/removes a camel route
for every system that subscribes/unsubscribes.
- These dynamically created routes listen on the virtual topics and send the
data coming in from the virtual topic to the REST interface of the different
systems (or mark the systems as ""offline if an error occurs)
My Test:
1.) Start up the camel application
2.) Subscribe a (dummy) system for updates via the Webservice - Camel
dynamically creates a route for this system that consumes the virtual topic
3.) Let camel process a message (M1) - it is sent to the subscribed system,
as designed
4.) Set the dummy system offline, Camel stops & removes the route for this
system (again, as expeced)
5.) Let Camel process another message (M2)
6.) Re-Subscribe the dummy system (again, a Camel route is created for the
system, receiving messages from the virtual topic)
I would expect (due to the "queue character" of the virtual topic) that the
dummy system now receives the message that was sent during it'soffline time.
But this is not the case. Nothing happens. New Messages (M3, M4) I put into
Camel are forwarded correctlly, but the message M2 is lost.
Am I missing a point here? Is it a mistake to remove the consuming route
from the Camel context when set to offline? Do I understand the use of
virtual topics correctly or are they the wrong stuff for my usecase?
Any ideas & sugesstions are welcome.
Thanks a lot,
Joerg
--
View this message in context:
http://camel.465427.n5.nabble.com/ActiveMQ-Durability-with-dynamically-created-Virtual-Topic-consumers-tp5780446.html
Sent from the Camel - Users mailing list archive at Nabble.com.