title: Jboss EAP 6.3 - listen to remote JMS topic (HornetQ)
body: <p>I have one Jboss EAP 6.3 instance with the HornetQ topic hosted there (jndi - "java:jboss/exported/jms/topic/TestTopic" so should be visible remotely) and I have another instanse (say Client) deployed to the same Jboss version. I have to listen to that TestTopic from the Client using @MessageDriven approach. I googled a lot but I still do not know how to specify a connection to the remote host to listen to that Topic. 
  I found an example of using @ActivationConfigProperty(propertyName = "connectionParameters", propertyValue = "host=SOME_HOST;port=SOME_PORT"), but that property is not specified in the spec and seems to not have an influence.</p>
  
  <p>Affairs so far:
  a part of standalone.xml:</p>
  
  <pre><code>&lt;subsystem xmlns="urn:jboss:domain:messaging:1.4"&gt;
          &lt;hornetq-server&gt;
              &lt;persistence-enabled&gt;true&lt;/persistence-enabled&gt;
              &lt;journal-type&gt;NIO&lt;/journal-type&gt;
              &lt;journal-min-files&gt;2&lt;/journal-min-files&gt;
  
              &lt;connectors&gt;
                  &lt;netty-connector name="netty" socket-binding="messaging"/&gt;
                  &lt;netty-connector name="netty-throughput" socket-binding="messaging-throughput"&gt;
                      &lt;param key="batch-delay" value="50"/&gt;
                  &lt;/netty-connector&gt;
                  &lt;in-vm-connector name="in-vm" server-id="0"/&gt;
              &lt;/connectors&gt;
  
              &lt;acceptors&gt;
                  &lt;netty-acceptor name="netty" socket-binding="messaging"/&gt;
                  &lt;netty-acceptor name="netty-throughput" socket-binding="messaging-throughput"&gt;
                      &lt;param key="batch-delay" value="50"/&gt;
                      &lt;param key="direct-deliver" value="false"/&gt;
                  &lt;/netty-acceptor&gt;
                  &lt;in-vm-acceptor name="in-vm" server-id="0"/&gt;
              &lt;/acceptors&gt;
  
              &lt;security-settings&gt;
                  &lt;security-setting match="#"&gt;
                      &lt;permission type="send" roles="guest"/&gt;
                      &lt;permission type="consume" roles="guest"/&gt;
                      &lt;permission type="createNonDurableQueue" roles="guest"/&gt;
                      &lt;permission type="deleteNonDurableQueue" roles="guest"/&gt;
                  &lt;/security-setting&gt;
              &lt;/security-settings&gt;
  
              &lt;address-settings&gt;
                  &lt;address-setting match="#"&gt;
                      &lt;dead-letter-address&gt;jms.queue.DLQ&lt;/dead-letter-address&gt;
                      &lt;expiry-address&gt;jms.queue.ExpiryQueue&lt;/expiry-address&gt;
                      &lt;redelivery-delay&gt;0&lt;/redelivery-delay&gt;
                      &lt;max-size-bytes&gt;10485760&lt;/max-size-bytes&gt;
                      &lt;page-size-bytes&gt;2097152&lt;/page-size-bytes&gt;
                      &lt;address-full-policy&gt;PAGE&lt;/address-full-policy&gt;
                      &lt;message-counter-history-day-limit&gt;10&lt;/message-counter-history-day-limit&gt;
                  &lt;/address-setting&gt;
              &lt;/address-settings&gt;
  
              &lt;jms-connection-factories&gt;
                  &lt;connection-factory name="InVmConnectionFactory"&gt;
                      &lt;connectors&gt;
                          &lt;connector-ref connector-name="in-vm"/&gt;
                      &lt;/connectors&gt;
                      &lt;entries&gt;
                          &lt;entry name="java:/ConnectionFactory"/&gt;
                      &lt;/entries&gt;
                  &lt;/connection-factory&gt;
                  &lt;connection-factory name="RemoteConnectionFactory"&gt;
                      &lt;connectors&gt;
                          &lt;connector-ref connector-name="netty"/&gt;
                      &lt;/connectors&gt;
                      &lt;entries&gt;
                          &lt;entry name="java:jboss/exported/jms/RemoteConnectionFactory"/&gt;
                      &lt;/entries&gt;
                  &lt;/connection-factory&gt;
                  &lt;pooled-connection-factory name="hornetq-ra"&gt;
                      &lt;transaction mode="xa"/&gt;
                      &lt;connectors&gt;
                          &lt;connector-ref connector-name="in-vm"/&gt;
                      &lt;/connectors&gt;
                      &lt;entries&gt;
                          &lt;entry name="java:/JmsXA"/&gt;
                      &lt;/entries&gt;
                  &lt;/pooled-connection-factory&gt;
              &lt;/jms-connection-factories&gt;
  
              &lt;jms-destinations&gt;
                  &lt;jms-queue name="ExpiryQueue"&gt;
                      &lt;entry name="java:/jms/queue/ExpiryQueue"/&gt;
                  &lt;/jms-queue&gt;
                  &lt;jms-queue name="DLQ"&gt;
                      &lt;entry name="java:/jms/queue/DLQ"/&gt;
                  &lt;/jms-queue&gt;
                  &lt;jms-topic name="TestTopic"&gt;
                      &lt;entry name="java:/jms/topic/TestTopic"/&gt;
                      &lt;entry name="java:jboss/exported/jms/topic/TestTopic"/&gt;
                  &lt;/jms-topic&gt;
              &lt;/jms-destinations&gt;
          &lt;/hornetq-server&gt;
      &lt;/subsystem&gt;
  </code></pre>
  
  <p>and my bean settings</p>
  
  <pre><code>@MessageDriven(mappedName = "TestTopicRemote", activationConfig = {
      @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
      @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
      @ActivationConfigProperty(propertyName = "destination", propertyValue = "java:jboss/exported/jms/topic/TestTopic"),
      @ActivationConfigProperty(propertyName = "connectionFactoryLookup", propertyValue = "jms/RemoteConnectionFactory"),
      @ActivationConfigProperty(propertyName = "clientId", propertyValue = "guest"),
      @ActivationConfigProperty(propertyName = "connectionParameters", propertyValue = "host=MY_HOST;port=5445")})
  </code></pre>