[ https://issues.apache.org/jira/browse/ARTEMIS-1589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16319171#comment-16319171 ]
Johan Stenberg commented on ARTEMIS-1589: ----------------------------------------- I can make a PR but I would like to know first if that is seen as useful extension and if so what should actually be exposed (just the container ID or the amqpConnection). > Make RemoteContainerId accessible via ActiveMQProtonRemotingConnection > ---------------------------------------------------------------------- > > Key: ARTEMIS-1589 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1589 > Project: ActiveMQ Artemis > Issue Type: New Feature > Components: AMQP > Affects Versions: 2.4.0 > Reporter: Johan Stenberg > Priority: Minor > > To access the remote containerId in an ActiveMQServerPlugin we currently have > to use reflection. Something like: > {code:java} > public void afterCreateSession(final ServerSession session) throws > ActiveMQException { > try { > ActiveMQProtonRemotingConnection con = (ActiveMQProtonRemotingConnection) > session.getRemotingConnection(); > Field amqpConnectionField = > ActiveMQProtonRemotingConnection.class.getDeclaredField("amqpConnection"); > AMQPConnectionContext amqpConnection = amqpConnectionField.get(con); > String containerId = amqpConnection.getRemoteContainer(); > } catch (final Exception ex) { > throw new RuntimeException(ex); > } > } > {code} > So it would be very helpful if ActiveMQProtonRemotingConnection could be > extended to provider a getter for the amqpConnection field or a getter that > returns the remoteContainer ID via {{amqpConnection.getRemoteContainer()}} -- This message was sent by Atlassian JIRA (v6.4.14#64029)