Hi Vavricka, The absence of the SessionPrincipal would suggest the calling thread is somehow running without the Session's _accessControllerContext which would suggest a bug.
The AMQP connection implementations organise for connection work to be done with the AbstractAMQPConnection#_accessControllerContext and session work is done additionally with AbstractAMQPSession#_accessControllerContext. In 0-10 case, the pertinent code is AMQPConnection_0_10Impl#received and ServerAssembler#received(java.util.List<org.apache.qpid.server.protocol.v0_10.ServerFrame>). Do you have a stack trace generated within the checkOverfull method, including the thread name, and a reproducing test case you can share? Kind regards, Keith Wall. On 2 June 2017 at 11:04, Vavricka <[email protected]> wrote: > Hi, > > I would like to get current session in Java Broker source code. In class > ProducerFlowControlOverflowPolicyHandler in checkOverfull() method there is > current session get by > > Set<SessionPrincipal> sessionPrincipals = > subject.getPrincipals(SessionPrincipal.class); > > When I use this for AMQP 1.0 connection, everything goes fine and I get > session. But when I use AMQP 0-10 client for connection to broker, > SessionPrincipal is empty. > > I checked that in constructor of AbstractAMQPSession session added to > Subject. But when I get Subject in OverflowPolicyHandler, there is no > SessionPrincipal. > > Simplified code how I get current session below: > > Subject subject = > Subject.getSubject(AccessController.getContext()); > Set<SessionPrincipal> sessionPrincipals = > subject.getPrincipals(SessionPrincipal.class); > SessionPrincipal sessionPrincipal = > sessionPrincipals.iterator().next(); > AMQPSession<?, ?> session = > sessionPrincipal.getSession(); > > Am I doing anything wrong? > > Vavricka > > > > -- > View this message in context: > http://qpid.2158936.n2.nabble.com/Qpid-Java-Broker-Get-SessionPrincipal-tp7663741.html > Sent from the Apache Qpid users mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
