JBossSession session = (JBossSession) conn.createSession(true, Session.SESSION_TRANSACTED);
ClientSessionDelegate clientSessionDelegate = (ClientSessionDelegate) session.getDelegate();
SessionState sessionState = (SessionState) clientSessionDelegate.getState();
MessageConsumer consumerHA = session.createDurableSubscriber((Topic) destination, "T1");
JBossMessageConsumer jbossConsumerHA = (JBossMessageConsumer) consumerHA;
org.jboss.jms.client.delegate.ClientConsumerDelegate clientDelegate =
(org.jboss.jms.client.delegate.ClientConsumerDelegate) jbossConsumerHA.getDelegate();
ConsumerState consumerState = (ConsumerState) clientDelegate.getState();