I just tried this and it works as expected: public void testCreateTcpConnectionUsingKnownLocalPort() throws Exception { broker = new BrokerService(); broker.setPersistent(false); TransportConnector connector = broker.addConnector("tcp://localhost:61610?wireFormat.tcpNoDelayEnabled=true"); broker.start();
// This should create the connection. ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61610/localhost:51610"); connection = (ActiveMQConnection)cf.createConnection(); assertNotNull(connection); broker.stop(); } On 6 May 2010 19:09, Mark Galea <mmga...@gmail.com> wrote: > > When I try to use the slash notation on the spring config it gives me that > it > is unable to connect to the host. Do you have any example of how to do > this? > > Thanks a lot for your prompt reply. > > M > > > > Gary Tully wrote: > > > > I think you should use that / (slash) notation on in the spring config > for > > the broker URl passed to the connection factory. The transport connector > > on > > the broker will use a single port. > > > > On 6 May 2010 17:51, Mark Galea <mmga...@gmail.com> wrote: > > > >> > >> Hi there, > >> > >> I have two machines which have ports 12004 and 12010 open. I have a > >> process > >> which connects to an activemq server (Machine 1) on port 12004 but I > want > >> that server to reply back to Machine 2 on port 12010. The reply ports > >> back > >> from the server are randomly selected and I want this to be 12010 > >> specifically. This is similar to the OpenMQ setting > >> -Dimq.jms.tcp.port=12010. > >> > >> Is there a way to do this? > >> > >> I have checked on the site and found this page: > >> > >> > >> > http://activemq.apache.org/how-do-i-define-a-local-address-and-local-port-for-tcp-or-ssl.html > >> > >> Is this related? Do I set this in the spring configuration or on the > >> transport connectors? > >> > >> <transportConnectors> > >> <transportConnector name="openwire" > >> uri="tcp://0.0.0.0:12004/0.0.0.0:12010"/> > >> </transportConnectors> > >> > >> Both of these have failed :( I would appreciate if someone could shed > >> some > >> light on this problem. > >> > >> Thanks, > >> > >> Mark > >> > >> > >> > >> -- > >> View this message in context: > >> http://old.nabble.com/Firewall-ports-tp28476565p28476565.html > >> Sent from the ActiveMQ - User mailing list archive at Nabble.com. > >> > >> > > > > > > -- > > http://blog.garytully.com > > > > Open Source Integration > > http://fusesource.com > > > > > > -- > View this message in context: > http://old.nabble.com/Firewall-ports-tp28476565p28477611.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > > -- http://blog.garytully.com Open Source Integration http://fusesource.com