I'm using a DefaultMessageListenerContainer
to consume a JMS message and then invoke a bean that extracts the user-id from SecurityContextHolder.getContext().getAuthentication().getPrincipal()
before inserting a record into the database. The user-id is null as you would expect because there is no authenticated principal.
Is there a neat solution to give the MDP a principal to run as? Something equivalent to run-as in the Servlet specification but for principals rather than roles.