Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在不影响Queue.TopicDestination
Queue
Topic
Destination
如果用户没有这样的权限,就会抛出异常,并且是零感情。
但是如果用户有这样的权限,那么新消息会出现在Queue/Topic中,这是不应该发生的。
有没有办法进行这样的测试?是否可以在不提交的情况下使用事务?
我认为一般来说,这取决于您使用的 JMS 提供程序,因为 JMS 本身并没有指定安全机制。例如,在 IBM MQ 上,Session.createProducer(Destination queueOrTopic)如果您无权向目标发送/发布消息,调用将引发 InvalidDestinationException。
Session.createProducer(Destination queueOrTopic)