I am working on a throttling system for my ingest that will check to see if
my upstream JMS broker is backed up to a particular threshold and, if it is
backed up, begin to route messages to disk instead of sending them to the
database.
I'm wondering the best way to implement this using the correct EIP
paradigms. I'll need to periodically (maybe every 2 minutes) check on the
state of the broker and I was thinking of implementing a quartz route that
would check the state and send a message into my main ingest routes with a
special header (like throttle=true/false).
I was thinking my main ingest routes can maintain their own state and
further set some type of header like "shouldThrottle" on each of their
messages so that I can use content based routing to determine where the
messages should go:
(header.get(shouldThrottle) == true) ? to('disk') : to('database')
Does this seem like a reasonable solution or am I going about this the
wrong way? I know EIP is all about trying to keep state in the streams
instead of the processors. I'm not sure if there's a better solution than
having the "state checker" send a message to the main ingest processors so
they can set their own state.
Thanks much!
my upstream JMS broker is backed up to a particular threshold and, if it is
backed up, begin to route messages to disk instead of sending them to the
database.
I'm wondering the best way to implement this using the correct EIP
paradigms. I'll need to periodically (maybe every 2 minutes) check on the
state of the broker and I was thinking of implementing a quartz route that
would check the state and send a message into my main ingest routes with a
special header (like throttle=true/false).
I was thinking my main ingest routes can maintain their own state and
further set some type of header like "shouldThrottle" on each of their
messages so that I can use content based routing to determine where the
messages should go:
(header.get(shouldThrottle) == true) ? to('disk') : to('database')
Does this seem like a reasonable solution or am I going about this the
wrong way? I know EIP is all about trying to keep state in the streams
instead of the processors. I'm not sure if there's a better solution than
having the "state checker" send a message to the main ingest processors so
they can set their own state.
Thanks much!