[ 
https://issues.apache.org/jira/browse/ARTEMIS-1589?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Johan Stenberg updated ARTEMIS-1589:
------------------------------------
    Description: 
ActiveMQProtonRemotingConnection#getClientID currently returns the local 
container's clientID and not the actual (remote) client ID. Which it should 
from my interpretation of the JavaDoc at 
[RemotingConnection.java#L234|https://github.com/apache/activemq-artemis/blob/master/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/protocol/RemotingConnection.java#L234]

[StompConnection#getClientID|https://github.com/apache/activemq-artemis/blob/master/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java#L426]
 also returns the actual remote client ID.

  was:
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()}}

     Issue Type: Bug  (was: New Feature)
        Summary: ActiveMQProtonRemotingConnection#getClientID does not return 
remote client ID  (was: Make RemoteContainerId accessible via 
ActiveMQProtonRemotingConnection)

> ActiveMQProtonRemotingConnection#getClientID does not return remote client ID
> -----------------------------------------------------------------------------
>
>                 Key: ARTEMIS-1589
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1589
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: AMQP
>    Affects Versions: 2.4.0
>            Reporter: Johan Stenberg
>            Priority: Minor
>
> ActiveMQProtonRemotingConnection#getClientID currently returns the local 
> container's clientID and not the actual (remote) client ID. Which it should 
> from my interpretation of the JavaDoc at 
> [RemotingConnection.java#L234|https://github.com/apache/activemq-artemis/blob/master/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/protocol/RemotingConnection.java#L234]
> [StompConnection#getClientID|https://github.com/apache/activemq-artemis/blob/master/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompConnection.java#L426]
>  also returns the actual remote client ID.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to