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]

Reply via email to