P.S. Brian - don't forget that Shiro has a SubjectAwareExecutorService that, if pluggable into ActiveMQ's threading configuration, would ensure dispatch threads retain a Subject. This way, you don't need to force the application thread to be used.
-- Les Hazlewood CTO, Katasoft | http://www.katasoft.com | 888.391.5282 twitter: @lhazlewood | http://twitter.com/lhazlewood katasoft blog: http://www.katasoft.com/blogs/lhazlewood personal blog: http://leshazlewood.com On Thu, Dec 1, 2011 at 10:42 AM, Kalle Korhonen <[email protected]> wrote: > On Thu, Dec 1, 2011 at 8:08 AM, Brian Demers <[email protected]> wrote: >> Has anyone created (or know of a lib) an ActiveMQ BrokerFilter for Shiro? >> I started looking into doing this (so I would at least ask the right >> questions). It was easy to get authc working, but after that I started >> scratching my head. I don't know enough (at the moment) about the threading >> model of activeMQ to know when/if the subject should be bound to the >> ThreadContext, or if/when subject.execute() can be called. >> Any ideas or nudges in the right direction? > > Incidentally, I did some (non-security related) work with ActiveMQ and > threading in the past. When do you need the subject, on the producer > side or with message listeners? The message dispatcher uses different > threads from the producer, so just attaching the subject to the > producer's application thread doesn't help the dispatch thread, unless > you use dispatchAsync=false. The following may help: > http://fusesource.com/wiki/display/ProdInfo/Understanding+the+Threads+Allocated+in+ActiveMQ. > That link and my knowledge is from a couple of years back, so things > may have changed... > > Kalle
